diff --git a/containers/Makefile b/containers/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..25b919cbfe6d23914367a10df78a8080f9a744c2 --- /dev/null +++ b/containers/Makefile @@ -0,0 +1,90 @@ +# import config. +# You can change the default config with `make cnf="config_special.env" build` +cnf ?= config.env +include $(cnf) +# exports variables in config.env as environment variables +export $(shell sed 's/=.*//' $(cnf)) + + +# import deploy config +# You can change the default deploy config with `make cnf="deploy_special.env" release` + +SHELL = bash + +## Get our version tag and stable version tag +VERSION=$(shell head -n1 ../../VERSION) +STABLE=$(shell echo ${$(head -n1 ../../VERSION)%.*}) + +# help will output the help for each task +# thanks to https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html +.PHONY: help + +help: ## This help. + @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) + +.DEFAULT_GOAL := help + +# ========================================================================== +# +build: ## build the image + docker build -t $(APP_NAME):$(VERSION) . +build-unstable: ## build the image + docker build -t $(APP_NAME):$(VERSION)-unstable . + +build-nc: ## Build the container without caching (from scratch) + docker build --no-cache -t $(APP_NAME):$(VERSION) . +build-unstable-nc: ## Build the container without caching (from scratch) + docker build --no-cache -t $(APP_NAME):$(VERSION)-unstable . + +# ========================================================================== +# +login: ## Auto login to AWS-ECR unsing aws-cli + docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY} + echo "Login COMPLETE" + +master: build-nc publish-latest publish-stable +master-cached: build publish-latest publish-stable +stable: build-nc publish-stable +stable-cached: build publish-stable +version: build-nc publish-version +version-cached: build publish-version +unstable: build-unstable-nc publish-unstable +version-unstable: build-unstable publish-unstable + +publish: login publish-latest publish-version #publish-version ## Publish the `{version}` ans `latest` tagged containers to ECR + @echo "Publishing done" + + +publish-latest: login + @echo 'publish latest to $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME)' + docker tag $(APP_NAME):$(VERSION) $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):latest + docker push $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):latest + +publish-stable: login + @echo 'publish $(STABLE) to $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME)' + docker tag $(APP_NAME):$(VERSION) $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):$(STABLE) + docker push $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):$(STABLE) + +publish-version: login + @echo 'publish $(STABLE) to $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME)' + docker tag $(APP_NAME):$(VERSION) $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):$(VERSION) + docker push $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):$(VERSION) + +publish-unstable: login + @echo 'publish unstable to $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME)' + docker tag $(APP_NAME):$(VERSION)-unstable $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):unstable + docker push $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):unstable + +version: ## Output the current version + @echo $(VERSION) + +# ========================================================================== +# +info: ## Output the current version + @echo 'VERSION = $(VERSION) ' + @echo 'STABLE = $(STABLE) ' + @echo 'REG_NAME = $(REG_NAME) ' + @echo 'APP_NAME = $(APP_NAME) ' + @echo 'GL_GROUP = $(GL_GROUP) ' + @echo 'GL_REG_GROUP = $(GL_REG_GROUP)' + @echo 'GL_REG_NAME = $(GL_REG_NAME) ' diff --git a/containers/builder/Makefile b/containers/builder/Makefile deleted file mode 100644 index 208ea6f2e9a6f9c0da700464e5be8df10c3e8573..0000000000000000000000000000000000000000 --- a/containers/builder/Makefile +++ /dev/null @@ -1,224 +0,0 @@ -# import config. -# You can change the default config with `make cnf="config_special.env" build` -cnf ?= config.env -include $(cnf) -# exports variables in config.env as environment variables -export $(shell sed 's/=.*//' $(cnf)) - - -# import deploy config -# You can change the default deploy config with `make cnf="deploy_special.env" release` - -SHELL = bash -# grep the version from the mix file -VERSION=$(shell bash version.sh) - - -# help will output the help for each task -# thanks to https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html -.PHONY: help - -help: ## This help. - @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) - -.DEFAULT_GOAL := help - -# ========================================================================== -# -build: ## build the image - docker build -t $(APP_NAME) . - -build-nc: ## Build the container without caching (from scratch) - docker build --no-cache -t $(APP_NAME) . - -build-alt: ## build the container for various machine architectures (broadwell, haswell, knl) - @echo 'building for architecture: $(ALT_NAME)' - docker build -t $(APP_NAME)_$(ALT_NAME) -f Dockerfile.$(ALT_NAME) . - -build-alt-nc: ## build the container for various machine architectures (broadwell, haswell, knl) - @echo 'build-alt-nc: building for architecture: $(ALT_NAME)' - docker build --no-cache -t $(APP_NAME)_$(ALT_NAME) -f Dockerfile.$(ALT_NAME) . - -# ========================================================================== -# -run: ## Run container on port configured in `config.env` - docker run -i -t --rm --env-file=./config.env -p=$(PORT):$(PORT) --name="$(APP_NAME)" $(REPO)/$(APP_NAME):$(TAG_VERSION) - -up: build run ## Run container on port configured in `config.env` (Alias to run) - -stop: ## Stop and remove a running container - docker stop $(APP_NAME); docker rm $(APP_NAME) - -# ========================================================================== -# -tag: tag-latest tag-version #tag-version ## Generate container tags for the `{version}` and `latest` tags - -tag-latest: ## Generate container `{version}` tag - @echo 'create tag latest' - #docker tag $(APP_NAME) $(REPO)/$(APP_NAME):latest - -tag-version: ## Generate container `latest` tag - @echo 'creating tag $(APP_NAME):$(VERSION)' - docker tag $(APP_NAME):latest $(APP_NAME):$(VERSION) - -tag-alt: tag-alt-latest # tag-alt-version ## Generate container tags for the `{version}` ans `latest` tags - -tag-alt-latest: ## Generate container `{version}` tag - @echo 'create tag latest' - #docker tag $(APP_NAME)_$(ALT_NAME) $(REPO)/$(APP_NAME)_$(ALT_NAME):latest - -tag-alt-version: ## Generate container `{version}` tag - @echo 'create tag latest' - docker tag $(APP_NAME)_$(ALT_NAME) $(REG_NAME)/$(REPO)/$(APP_NAME)_$(ALT_NAME):$(VERSION) - -# ========================================================================== -# -login: ## Auto login to AWS-ECR unsing aws-cli - docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY} - echo "Login COMPLETE" - -release: build-nc publish ## Make a release by building and publishing the `{version}` ans `latest` tagged containers to ECR - @echo "Cleaning up" - docker rmi $(APP_NAME):latest - -develop: build-nc publish-dev ## Develop build, do not publish latest - @echo "Cleaning up" - #docker rmi $(APP_NAME):latest - -staging: build-nc publish-staging ## Develop build, do not publish latest - @echo "Cleaning up" - #docker rmi $(APP_NAME):latest - -release-cached: build publish ## Make a release by building and publishing the `{version}` ans `latest` tagged containers to ECR -develop-cached: build login publish-dev ## develop release -staging-cached: build login publish-staging ## develop release - -publish: login publish-latest publish-version #publish-version ## Publish the `{version}` ans `latest` tagged containers to ECR - @echo "Publishing done" - - -publish-latest: ## Publish the `latest` taged container to ECR - @echo 'publish latest to $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME)' - docker tag $(APP_NAME):latest $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):latest - docker push $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):latest - #docker rmi $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):latest - -publish-staging: ## Publish the `unstable` taged container to ECR - @echo 'publish unstable to $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME)' - docker tag $(APP_NAME):latest $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):testing - docker push $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):testing - -publish-dev: ## Publish the `unstable` taged container to ECR - @echo 'publish unstable to $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME)' - docker tag $(APP_NAME):latest $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):unstable - docker push $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):unstable - -publish-version: tag-version ## Publish the `{version}` taged container to ECR - @echo 'publish latest to $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):$(VERSION)' - docker tag $(APP_NAME):latest $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):$(VERSION) - docker push $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):$(VERSION) - #docker rmi $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):$(VERSION) - -push: login ## push after login @echo 'push latest to $(REG_NAME)/$(REPO)/$(APP_NAME):latest' - docker tag $(APP_NAME):latest $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):latest - docker push $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):latest - -# ========================================================================== -# -release-alt: build-alt publish-alt ## Make a release by building and publishing the `{version}` ans `latest` tagged containers to ECR - -publish-alt: login publish-alt-latest #publish-alt-version ## Publish the `{version}` ans `latest` tagged containers to ECR - -push-alt: login tag-alt-latest ## push after login - #docker push $(REG_NAME)/$(REPO)/$(APP_NAME)_$(ALT_NAME):latest - docker push $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME)_$(ALT_NAME):latest - -publish-alt-latest: #tag-alt-latest ## Publish the `latest` taged container to ECR - #docker push $(REG_NAME)/$(REPO)/$(APP_NAME)_$(ALT_NAME):latest - docker tag $(APP_NAME)_$(ALT_NAME):latest $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME)_$(ALT_NAME):latest - docker push $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME)_$(ALT_NAME):latest - docker rmi $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME)_$(ALT_NAME):latest - -publish-alt-version: tag-alt-version ## Publish the `latest` taged container to ECR - #docker push $(REG_NAME)/$(REPO)/$(APP_NAME)_$(ALT_NAME):$(VERSION) - docker push $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME)_$(ALT_NAME):$(VERSION) - -# ========================================================================== -# - -login-dockerhub: ## login to hub.docker.com - @echo 'docker hub login :' - docker login - -push-dockerhub: build #publish-version ## Publish the `{version}` ans `latest` tagged containers to ECR - @echo '$(DH_ORG)/$(APP_NAME):$(TAG_VERSION)' - docker push $(DH_ORG)/$(APP_NAME):latest - #docker push $(DH_ORG)/$(APP_NAME):$(VERSION) - -publish-dockerhub: build tag #publish-version ## Publish the `{version}` ans `latest` tagged containers to ECR - @echo '$(DH_ORG)/$(APP_NAME):$(TAG_VERSION)' - docker push $(DH_ORG)/$(APP_NAME):latest - #docker push $(DH_ORG)/$(APP_NAME):$(VERSION) - -# ========================================================================== -# -clean-tags: - docker rmi $(REPO)/$(APP_NAME):latest || true - docker rmi $(GL_GROUP)/$(APP_NAME):latest || true - docker rmi $(GL_REG_GROUP)/$(APP_NAME):latest || true - docker rmi $(REG_NAME)/$(REPO)/$(APP_NAME):latest || true - docker rmi $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):latest || true - docker rmi $(REPO)/$(APP_NAME)_$(ALT_NAME):latest || true - docker rmi $(GL_GROUP)/$(APP_NAME)_$(ALT_NAME):latest || true - docker rmi $(GL_REG_GROUP)/$(APP_NAME)_$(ALT_NAME):latest || true - docker rmi $(REG_NAME)/$(REPO)/$(APP_NAME)_$(ALT_NAME):latest || true - docker rmi $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME)_$(ALT_NAME):latest || true - -clean: - docker rmi $(REPO_NAME)/$(APP_NAME) || true - docker rmi $(REPO_NAME)/$(APP_NAME):$(TAG_VERSION) || true - docker rmi $(REPO_NAME)/$(APP_NAME):$(VERSION) || true - docker rmi $(REPO)/$(APP_NAME) || true - docker rmi $(REPO)/$(APP_NAME):$(TAG_VERSION) || true - docker rmi $(REPO)/$(APP_NAME):$(VERSION) || true - docker rmi $(REG_NAME)/$(REPO)/$(APP_NAME):latest || true - docker rmi $(REG_NAME)/$(REPO)/$(APP_NAME):$(TAG_VERSION) || true - docker rmi $(REG_NAME)/$(REPO)/$(APP_NAME) || true - docker rmi $(DH_ORG)/$(APP_NAME) || true - docker rmi $(DH_ORG)/$(APP_NAME):$(TAG_VERSION) || true - docker rmi $(DH_ORG)/$(APP_NAME):$(VERSION) || true - docker rmi $(GL_REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):latest || true - docker rmi $(GL_REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):$(VERSION) || true - docker rmi $(GL_REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME) || true - docker rmi $(GL_REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME)_$(ALT_NAME):latest || true - docker rmi $(GL_REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME)_$(ALT_NAME):$(VERSION) || true - docker rmi $(GL_REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME)_$(ALT_NAME) || true - docker rmi $(GL_REG_GROUP)/$(APP_NAME) || true - docker rmi $(GL_REG_GROUP)/$(APP_NAME):$(VERSION) || true - docker rmi $(GL_REG_GROUP)/$(APP_NAME)_$(ALT_NAME) || true - docker rmi $(GL_REG_GROUP)/$(APP_NAME)_$(ALT_NAME):$(VERSION) || true - docker rmi $(GL_REG_NAME)/$(REG_USER)/$(APP_NAME) || true - docker rmi $(GL_REG_NAME)/$(REG_USER)/$(APP_NAME):$(VERSION) || true - #docker rmi $(APP_NAME) || true - -version: ## Output the current version - @echo $(VERSION) - -# ========================================================================== -# -info: ## Output the current version - @echo 'VERSION = $(VERSION) ' - @echo 'REG_USER = $(REG_USER) ' - @echo 'REG_NAME = $(REG_NAME) ' - @echo 'ALT_NAME = $(ALT_NAME) ' - @echo 'APP_NAME = $(APP_NAME) ' - @echo 'REPO_NAME = $(REPO_NAME) ' - @echo 'DH_ORG = $(DH_ORG) ' - @echo 'GL_GROUP = $(GL_GROUP) ' - @echo 'GL_REG_GROUP = $(GL_REG_GROUP)' - @echo 'GL_REG_NAME = $(GL_REG_NAME) ' - @echo 'REPO = $(REPO) ' - @echo 'TAG_VERSION = $(TAG_VERSION) ' - -ls: ## list all docker images - docker images diff --git a/containers/builder/Makefile b/containers/builder/Makefile new file mode 120000 index 0000000000000000000000000000000000000000..d0b0e8e0086f68062b2b427755eb137285993ed3 --- /dev/null +++ b/containers/builder/Makefile @@ -0,0 +1 @@ +../Makefile \ No newline at end of file diff --git a/containers/builder/config.env b/containers/builder/config.env index 29f4d798964e7eedc430ea94b22a27ce5e1ec9d5..fea4ef6c4b32691a1c65f385e032603ab0d1ead6 100644 --- a/containers/builder/config.env +++ b/containers/builder/config.env @@ -1,22 +1,11 @@ -REG_TOKEN ?= ${CI_IMAGE_BUILD_PAT} -REG_USER ?= whit REG_HOST ?= eicweb.phy.anl.gov -REG_NAME ?= eicweb.phy.anl.gov:4567 REG_PORT ?= 4567 +REG_NAME ?= $(REG_HOST):$(REG_PORT) REG_URL ?= https://$(REG_HOST) -# name of alternate build: -# Dockerfile.$(ALT_NAME) --> $(APP_NAME)_${ALT_NAME} -ALT_NAME ?= broadwell - APP_NAME = eic_builder REPO_NAME = eic_builder -DH_ORG = eic - GL_GROUP = eic_container GL_REG_GROUP = containers/eic_container GL_REG_NAME = $(REG_NAME) - -REPO = $(REG_USER) -TAG_VERSION = latest diff --git a/containers/builder/version-stable.sh b/containers/builder/version-stable.sh new file mode 120000 index 0000000000000000000000000000000000000000..316bfa2e94a84a782afedb0b59897a2683399c30 --- /dev/null +++ b/containers/builder/version-stable.sh @@ -0,0 +1 @@ +../version-stable.sh \ No newline at end of file diff --git a/containers/builder/version.sh b/containers/builder/version.sh deleted file mode 100644 index 279e0acd2a1b6dcd6bd0c7132ec7af650a504541..0000000000000000000000000000000000000000 --- a/containers/builder/version.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -head -n1 ../../VERSION diff --git a/containers/builder/version.sh b/containers/builder/version.sh new file mode 120000 index 0000000000000000000000000000000000000000..fed96f12f725dccafa569bcab873f17b769004e6 --- /dev/null +++ b/containers/builder/version.sh @@ -0,0 +1 @@ +../version.sh \ No newline at end of file diff --git a/containers/release/Makefile b/containers/release/Makefile deleted file mode 100644 index 307466d05a0bd4fd2222854816cb217cf35095d2..0000000000000000000000000000000000000000 --- a/containers/release/Makefile +++ /dev/null @@ -1,224 +0,0 @@ -# import config. -# You can change the default config with `make cnf="config_special.env" build` -cnf ?= config.env -include $(cnf) -# exports variables in config.env as environment variables -export $(shell sed 's/=.*//' $(cnf)) - - -# import deploy config -# You can change the default deploy config with `make cnf="deploy_special.env" release` - -SHELL = bash -# grep the version from the mix file -VERSION=$(shell bash version.sh) - - -# help will output the help for each task -# thanks to https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html -.PHONY: help - -help: ## This help. - @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) - -.DEFAULT_GOAL := help - -# ========================================================================== -# -build: ## build the image - docker build -t $(APP_NAME) . - -build-nc: ## Build the container without caching (from scratch) - docker build --no-cache -t $(APP_NAME) . - -build-alt: ## build the container for various machine architectures (broadwell, haswell, knl) - @echo 'building for architecture: $(ALT_NAME)' - docker build -t $(APP_NAME)_$(ALT_NAME) -f Dockerfile.$(ALT_NAME) . - -build-alt-nc: ## build the container for various machine architectures (broadwell, haswell, knl) - @echo 'build-alt-nc: building for architecture: $(ALT_NAME)' - docker build --no-cache -t $(APP_NAME)_$(ALT_NAME) -f Dockerfile.$(ALT_NAME) . - -# ========================================================================== -# -run: ## Run container on port configured in `config.env` - docker run -i -t --rm --env-file=./config.env -p=$(PORT):$(PORT) --name="$(APP_NAME)" $(REPO)/$(APP_NAME):$(TAG_VERSION) - -up: build run ## Run container on port configured in `config.env` (Alias to run) - -stop: ## Stop and remove a running container - docker stop $(APP_NAME); docker rm $(APP_NAME) - -# ========================================================================== -# -tag: tag-latest tag-version #tag-version ## Generate container tags for the `{version}` and `latest` tags - -tag-latest: ## Generate container `{version}` tag - @echo 'create tag latest' - #docker tag $(APP_NAME) $(REPO)/$(APP_NAME):latest - -tag-version: ## Generate container `latest` tag - @echo 'creating tag $(APP_NAME):$(VERSION)' - docker tag $(APP_NAME):latest $(APP_NAME):$(VERSION) - -tag-alt: tag-alt-latest # tag-alt-version ## Generate container tags for the `{version}` ans `latest` tags - -tag-alt-latest: ## Generate container `{version}` tag - @echo 'create tag latest' - #docker tag $(APP_NAME)_$(ALT_NAME) $(REPO)/$(APP_NAME)_$(ALT_NAME):latest - -tag-alt-version: ## Generate container `{version}` tag - @echo 'create tag latest' - docker tag $(APP_NAME)_$(ALT_NAME) $(REG_NAME)/$(REPO)/$(APP_NAME)_$(ALT_NAME):$(VERSION) - -# ========================================================================== -# -login: ## Auto login to AWS-ECR unsing aws-cli - docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY} - echo "Login COMPLETE" - -release: build-nc publish ## Make a release by building and publishing the `{version}` ans `latest` tagged containers to ECR - @echo "Cleaning up" - #docker rmi $(APP_NAME):latest - -staging: build-nc publish-staging ## Develop build, do not publish latest - @echo "Cleaning up" - #docker rmi $(APP_NAME):latest - -develop: build-nc publish-dev ## Develop build, do not publish latest - @echo "Cleaning up" - #docker rmi $(APP_NAME):latest - -release-cached: build publish ## Make a release by building and publishing the `{version}` ans `latest` tagged containers to ECR -staging-cached: build login publish-staging ## staging release -develop-cached: build login publish-dev ## develop release - -publish: login publish-latest publish-version #publish-version ## Publish the `{version}` ans `latest` tagged containers to ECR - @echo "Publishing done" - - -publish-latest: ## Publish the `latest` taged container to ECR - @echo 'publish latest to $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME)' - docker tag $(APP_NAME):latest $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):latest - docker push $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):latest - #docker rmi $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):latest - -publish-staging: ## Publish the `unstable` taged container to ECR - @echo 'publish unstable to $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME)' - docker tag $(APP_NAME):latest $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):testing - docker push $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):testing - -publish-dev: ## Publish the `unstable` taged container to ECR - @echo 'publish unstable to $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME)' - docker tag $(APP_NAME):latest $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):unstable - docker push $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):unstable - -publish-version: tag-version ## Publish the `{version}` taged container to ECR - @echo 'publish latest to $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):$(VERSION)' - docker tag $(APP_NAME):latest $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):$(VERSION) - docker push $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):$(VERSION) - #docker rmi $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):$(VERSION) - -push: login ## push after login @echo 'push latest to $(REG_NAME)/$(REPO)/$(APP_NAME):latest' - docker tag $(APP_NAME):latest $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):latest - docker push $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):latest - -# ========================================================================== -# -release-alt: build-alt publish-alt ## Make a release by building and publishing the `{version}` ans `latest` tagged containers to ECR - -publish-alt: login publish-alt-latest #publish-alt-version ## Publish the `{version}` ans `latest` tagged containers to ECR - -push-alt: login tag-alt-latest ## push after login - #docker push $(REG_NAME)/$(REPO)/$(APP_NAME)_$(ALT_NAME):latest - docker push $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME)_$(ALT_NAME):latest - -publish-alt-latest: #tag-alt-latest ## Publish the `latest` taged container to ECR - #docker push $(REG_NAME)/$(REPO)/$(APP_NAME)_$(ALT_NAME):latest - docker tag $(APP_NAME)_$(ALT_NAME):latest $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME)_$(ALT_NAME):latest - docker push $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME)_$(ALT_NAME):latest - docker rmi $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME)_$(ALT_NAME):latest - -publish-alt-version: tag-alt-version ## Publish the `latest` taged container to ECR - #docker push $(REG_NAME)/$(REPO)/$(APP_NAME)_$(ALT_NAME):$(VERSION) - docker push $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME)_$(ALT_NAME):$(VERSION) - -# ========================================================================== -# - -login-dockerhub: ## login to hub.docker.com - @echo 'docker hub login :' - docker login - -push-dockerhub: build #publish-version ## Publish the `{version}` ans `latest` tagged containers to ECR - @echo '$(DH_ORG)/$(APP_NAME):$(TAG_VERSION)' - docker push $(DH_ORG)/$(APP_NAME):latest - #docker push $(DH_ORG)/$(APP_NAME):$(VERSION) - -publish-dockerhub: build tag #publish-version ## Publish the `{version}` ans `latest` tagged containers to ECR - @echo '$(DH_ORG)/$(APP_NAME):$(TAG_VERSION)' - docker push $(DH_ORG)/$(APP_NAME):latest - #docker push $(DH_ORG)/$(APP_NAME):$(VERSION) - -# ========================================================================== -# -clean-tags: - docker rmi $(REPO)/$(APP_NAME):latest || true - docker rmi $(GL_GROUP)/$(APP_NAME):latest || true - docker rmi $(GL_REG_GROUP)/$(APP_NAME):latest || true - docker rmi $(REG_NAME)/$(REPO)/$(APP_NAME):latest || true - docker rmi $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):latest || true - docker rmi $(REPO)/$(APP_NAME)_$(ALT_NAME):latest || true - docker rmi $(GL_GROUP)/$(APP_NAME)_$(ALT_NAME):latest || true - docker rmi $(GL_REG_GROUP)/$(APP_NAME)_$(ALT_NAME):latest || true - docker rmi $(REG_NAME)/$(REPO)/$(APP_NAME)_$(ALT_NAME):latest || true - docker rmi $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME)_$(ALT_NAME):latest || true - -clean: - docker rmi $(REPO_NAME)/$(APP_NAME) || true - docker rmi $(REPO_NAME)/$(APP_NAME):$(TAG_VERSION) || true - docker rmi $(REPO_NAME)/$(APP_NAME):$(VERSION) || true - docker rmi $(REPO)/$(APP_NAME) || true - docker rmi $(REPO)/$(APP_NAME):$(TAG_VERSION) || true - docker rmi $(REPO)/$(APP_NAME):$(VERSION) || true - docker rmi $(REG_NAME)/$(REPO)/$(APP_NAME):latest || true - docker rmi $(REG_NAME)/$(REPO)/$(APP_NAME):$(TAG_VERSION) || true - docker rmi $(REG_NAME)/$(REPO)/$(APP_NAME) || true - docker rmi $(DH_ORG)/$(APP_NAME) || true - docker rmi $(DH_ORG)/$(APP_NAME):$(TAG_VERSION) || true - docker rmi $(DH_ORG)/$(APP_NAME):$(VERSION) || true - docker rmi $(GL_REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):latest || true - docker rmi $(GL_REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):$(VERSION) || true - docker rmi $(GL_REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME) || true - docker rmi $(GL_REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME)_$(ALT_NAME):latest || true - docker rmi $(GL_REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME)_$(ALT_NAME):$(VERSION) || true - docker rmi $(GL_REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME)_$(ALT_NAME) || true - docker rmi $(GL_REG_GROUP)/$(APP_NAME) || true - docker rmi $(GL_REG_GROUP)/$(APP_NAME):$(VERSION) || true - docker rmi $(GL_REG_GROUP)/$(APP_NAME)_$(ALT_NAME) || true - docker rmi $(GL_REG_GROUP)/$(APP_NAME)_$(ALT_NAME):$(VERSION) || true - docker rmi $(GL_REG_NAME)/$(REG_USER)/$(APP_NAME) || true - docker rmi $(GL_REG_NAME)/$(REG_USER)/$(APP_NAME):$(VERSION) || true - #docker rmi $(APP_NAME) || true - -version: ## Output the current version - @echo $(VERSION) - -# ========================================================================== -# -info: ## Output the current version - @echo 'VERSION = $(VERSION) ' - @echo 'REG_USER = $(REG_USER) ' - @echo 'REG_NAME = $(REG_NAME) ' - @echo 'ALT_NAME = $(ALT_NAME) ' - @echo 'APP_NAME = $(APP_NAME) ' - @echo 'REPO_NAME = $(REPO_NAME) ' - @echo 'DH_ORG = $(DH_ORG) ' - @echo 'GL_GROUP = $(GL_GROUP) ' - @echo 'GL_REG_GROUP = $(GL_REG_GROUP)' - @echo 'GL_REG_NAME = $(GL_REG_NAME) ' - @echo 'REPO = $(REPO) ' - @echo 'TAG_VERSION = $(TAG_VERSION) ' - -ls: ## list all docker images - docker images diff --git a/containers/release/Makefile b/containers/release/Makefile new file mode 120000 index 0000000000000000000000000000000000000000..d0b0e8e0086f68062b2b427755eb137285993ed3 --- /dev/null +++ b/containers/release/Makefile @@ -0,0 +1 @@ +../Makefile \ No newline at end of file diff --git a/containers/release/config.env b/containers/release/config.env index da3c4f905c37876319551989888a6e065a482cd6..470b70c5c2a8ad722670eb69a679cee1d134d0e7 100644 --- a/containers/release/config.env +++ b/containers/release/config.env @@ -1,22 +1,11 @@ -REG_TOKEN ?= ${CI_IMAGE_BUILD_PAT} -REG_USER ?= whit REG_HOST ?= eicweb.phy.anl.gov -REG_NAME ?= eicweb.phy.anl.gov:4567 REG_PORT ?= 4567 +REG_NAME ?= $(REG_HOST):$(REG_PORT) REG_URL ?= https://$(REG_HOST) -# name of alternate build: -# Dockerfile.$(ALT_NAME) --> $(APP_NAME)_${ALT_NAME} -ALT_NAME ?= broadwell - APP_NAME = eic -REPO_NAME = eic - -DH_ORG = eic +REG_NAME = eic GL_GROUP = eic_container GL_REG_GROUP = containers/eic_container GL_REG_NAME = $(REG_NAME) - -REPO = $(REG_USER) -TAG_VERSION = latest diff --git a/containers/release/version-stable.sh b/containers/release/version-stable.sh new file mode 120000 index 0000000000000000000000000000000000000000..316bfa2e94a84a782afedb0b59897a2683399c30 --- /dev/null +++ b/containers/release/version-stable.sh @@ -0,0 +1 @@ +../version-stable.sh \ No newline at end of file diff --git a/containers/release/version.sh b/containers/release/version.sh deleted file mode 100644 index 279e0acd2a1b6dcd6bd0c7132ec7af650a504541..0000000000000000000000000000000000000000 --- a/containers/release/version.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -head -n1 ../../VERSION diff --git a/containers/release/version.sh b/containers/release/version.sh new file mode 120000 index 0000000000000000000000000000000000000000..fed96f12f725dccafa569bcab873f17b769004e6 --- /dev/null +++ b/containers/release/version.sh @@ -0,0 +1 @@ +../version.sh \ No newline at end of file diff --git a/containers/version-stable.sh b/containers/version-stable.sh new file mode 100644 index 0000000000000000000000000000000000000000..106797da2c4a570ad5a231e6f7b4f56dc618d055 --- /dev/null +++ b/containers/version-stable.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +## print the stable version tag for this version to the console + +version=head -n1 ../../VERSION +echo "${VERSION%.*}-stable" diff --git a/containers/version.sh b/containers/version.sh new file mode 100644 index 0000000000000000000000000000000000000000..cfc89a3ebf0b6fa8cc644d58b94399ab84e08346 --- /dev/null +++ b/containers/version.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +## print the full version number to the console + +head -n1 ../../VERSION