diff options
author | 2017-05-11 01:06:09 +0200 | |
---|---|---|
committer | 2017-05-11 01:06:09 +0200 | |
commit | a7bf03217af780f4245af555efdbfdc7ca9e2935 (patch) | |
tree | 66698dc80d43d3ff023560bc483acf66a964212d /Makefile | |
parent | f32036a025d8ae7e6ef02aca8b080e5bca60fc11 (diff) |
Introduce flavours for containers
Multiple variations over a common base must be supported when creating AGL containers.
This commit introduces 'flavours' to achive this goal (see README.md for details).
Current supported flavours:
* generic : same image as before
* xds : new image dedicated to AGL DevKit
Change-Id: I0aa65a1d9e83a2d7aed43e0b135dc43c5537bc53
Signed-off-by: Stephane Desneux <stephane.desneux@iot.bzh>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 33 |
1 files changed, 21 insertions, 12 deletions
@@ -5,14 +5,15 @@ REGISTRY=docker.automotivelinux.org REPO=agl NAME=worker VERSION=$(shell tail -1 VERSION) +FLAVOUR=generic # --------------------------------------------------- # --- computed - don't touch ! # --------------------------------------------------- -IMAGE_NAME=$(REGISTRY)/$(REPO)/$(NAME):$(VERSION) -IMAGE_LATEST=$(REGISTRY)/$(REPO)/$(NAME):latest -CNAME=vm-$(NAME) +IMAGE_NAME=$(REGISTRY)/$(REPO)/$(NAME)-$(FLAVOUR):$(VERSION) +IMAGE_LATEST=$(REGISTRY)/$(REPO)/$(NAME)-$(FLAVOUR):latest +CNAME=vm-$(NAME)-$(FLAVOUR) help: @echo "Available targets:" @@ -31,6 +32,7 @@ help: @echo "- Docker registry: REGISTRY=$(REGISTRY)" @echo "- Image repository: REPO=$(REPO)" @echo "- Image name: NAME=$(NAME)" + @echo "- Flavour: FLAVOUR=$(FLAVOUR)" @echo "- Image version: VERSION=$(VERSION)" @echo "- Container name/host name: CNAME=$(CNAME)" @echo @@ -40,6 +42,10 @@ help: @echo "Images:" @docker images @echo + @echo "Available flavours:" + @echo "- generic (default) : can be used for most of the tasks (platform builds, sdk builds, ...)" + @echo "- xds : dedicated to daemons and tools part of XDS (cross development system)" + .PHONY:clean clean: @@ -67,21 +73,24 @@ distclean: clean done .PHONY:build-debug -build-debug: - @echo "------------------- Building image $(NAME) (debug mode) -------------------" +build-debug: INSTALL/flavours/$(FLAVOUR).tasks + @echo "------------------- Building image $(NAME)-$(FLAVOUR) (debug mode) -------------------" @touch INSTALL/DEBUG + @echo "FLAVOUR=$(FLAVOUR)" >INSTALL/flavour.conf @docker build --no-cache=true --rm --pull -t $(IMAGE_NAME) . - @rm -f INSTALL/DEBUG + @rm -f INSTALL/DEBUG INSTALL/flavour.conf @docker images # inside jenkins, we don't want the build script to break and wait for interaction # after first error. So we remove the file inside INSTALL dir which indicates to the # setup script to enable DEBUG. .PHONY:build -build: - @echo "------------------- Building image $(NAME) -------------------" +build: INSTALL/flavours/$(FLAVOUR).tasks + @echo "------------------- Building image $(NAME)-$(FLAVOUR) -------------------" @rm -f INSTALL/DEBUG + @echo "FLAVOUR=$(FLAVOUR)" >INSTALL/flavour.conf @docker build --no-cache=true --rm --pull -t $(IMAGE_NAME) . + @rm -f INSTALL/flavour.conf @docker images .PHONY:test @@ -109,14 +118,14 @@ push-latest: push .PHONY:export export: - @echo "Export image to docker_$(REPO)_$(NAME)-$(VERSION).tar.xz" - docker save $(IMAGE_NAME) | xz -T0 -c >docker_$(REPO)_$(NAME)-$(VERSION).tar.xz + @echo "Export image to docker_$(REPO)_$(NAME)-$(FLAVOUR)-$(VERSION).tar.xz" + docker save $(IMAGE_NAME) | xz -T0 -c >docker_$(REPO)_$(NAME)-$(FLAVOUR)-$(VERSION).tar.xz .PHONY:export-latest export-latest: docker tag $(IMAGE_NAME) $(IMAGE_LATEST) - @echo "Export image to docker_$(REPO)_$(NAME)-latest.tar.xz" - docker save $(IMAGE_LATEST) | xz -T0 -c >docker_$(REPO)_$(NAME)-latest.tar.xz + @echo "Export image to docker_$(REPO)_$(NAME)-$(FLAVOUR)-latest.tar.xz" + docker save $(IMAGE_LATEST) | xz -T0 -c >docker_$(REPO)_$(NAME)-$(FLAVOUR)-latest.tar.xz .PHONY:show-image show-image: |