Skip to content

Commit

Permalink
Update automation scripts (#8)
Browse files Browse the repository at this point in the history
* Update automation scripts to 20220305083544-02c220f-snapshot
  • Loading branch information
dehe1 authored May 24, 2022
1 parent 5e110eb commit a630fe6
Show file tree
Hide file tree
Showing 85 changed files with 957 additions and 504 deletions.
4 changes: 2 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
build/automation/* linguist-vendored
data/* linguist-vendored
build/automation/** linguist-vendored
data/** linguist-vendored
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/.github @nhsd-exeter/maintainers
/build/automation/lib @nhsd-exeter/maintainers
/build/automation/init.mk @nhsd-exeter/maintainers
/.gitignore @nhsd-exeter/maintainers
/project.code-workspace @nhsd-exeter/maintainers
2 changes: 1 addition & 1 deletion .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: "Check code format and quality"
on:
push:
branches: [master]
branches: [main]
pull_request:
types: [opened, synchronize, reopened]
jobs:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ jobs:
- name: Check pull request title
if: github.event_name == 'pull_request'
run: |
[ $(make git-check-if-commit-msg-is-correct BUILD_BRANCH="${{ github.head_ref }}" BUILD_COMMIT_MESSAGE="${{ github.event.pull_request.title }}") = true ] && \
exit 0 || make show-configuration | grep GIT_COMMIT_MESSAGE_ && printf "\nPlease, for more details see the 'build/automation/test/git.test.mk' file.\n" && exit 1
[ $(make git-check-if-pull-request-title-is-correct BUILD_BRANCH="${{ github.head_ref }}" PULL_REQUEST_TITLE="${{ github.event.pull_request.title }}") = true ] && \
exit 0 || make show-configuration | grep -E 'GIT_COMMIT_MESSAGE_|GIT_PULL_REQUEST_' && printf "\nPlease, for more details see the 'build/automation/test/git.test.mk' file.\n" && exit 1
- name: Get commit message
if: github.event_name == 'pull_request'
run: |
Expand Down
16 changes: 16 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"recommendations": [
"ban.spellright",
"davidanson.vscode-markdownlint",
"editorconfig.editorconfig",
"johnpapa.vscode-peacock",
"streetsidesoftware.code-spell-checker",
"vscode-icons-team.vscode-icons",
"yzhang.dictionary-completion",
"yzhang.markdown-all-in-one"
],
"unwantedRecommendations": [
"googlecloudtools.cloudcode",
"ms-azuretools.vscode-azurefunctions"
]
}
2 changes: 1 addition & 1 deletion build/automation/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20210729083603-3571d8e
20220305083544-02c220f-snapshot
2 changes: 2 additions & 0 deletions build/automation/etc/git-secrets/nhsd-rules-banned.regexp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
[a-z]{2}-[a-z-]*-[1,2,3]\.rds\.amazonaws\.com
rds\.[a-z]{2}-[a-z-]*-[1,2,3]\.amazonaws\.com
dynamodb\.[a-z]{2}-[a-z-]*-[1,2,3]\.amazonaws\.com
arn:aws:.*:.*:[0-9]{12}
[0-9]{12}\.dkr\.ecr\.[a-z-]*-[1,2,3]\.amazonaws\.com
[a-z]{2}-[a-z-]*-[1,2,3]\.es\.amazonaws\.com
[a-z]*[1-3]\.cache\.amazonaws\.com
hooks\.slack\.com/services/T[a-zA-Z0-9]*/B[a-zA-Z0-9]*/[a-zA-Z0-9]*
Expand Down
64 changes: 37 additions & 27 deletions build/automation/init.mk
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ devops-copy: ### Copy the DevOps automation toolchain scripts from this codebase
cp -fv build/automation/lib/project/template/.github/CODEOWNERS $(DIR)/.github
cp -fv build/automation/lib/project/template/.gitattributes $(DIR)
)
mkdir -p $(DIR)/.vscode
cp -fv build/automation/lib/project/template/.vscode/extensions.json $(DIR)/.vscode
cp -fv build/automation/tmp/.gitignore $(DIR)/build/automation/tmp/.gitignore
cp -fv LICENSE.md $(DIR)/build/automation/LICENSE.md
[ -f $(DIR)/docker/docker-compose.yml ] && rm -fv $(DIR)/docker/.gitkeep
Expand Down Expand Up @@ -151,7 +153,7 @@ devops-copy: ### Copy the DevOps automation toolchain scripts from this codebase
}
sync && version

devops-update devops-synchronise: ### Update/upgrade the DevOps automation toolchain scripts used by this project - optional: LATEST=true, NO_COMMIT=true
devops-update devops-synchronise: ### Update/upgrade the DevOps automation toolchain scripts used by this project - optional: SELECT_BY_TAG=true, PERFORM_COMMIT=true
function _print() {
(
set +x
Expand Down Expand Up @@ -181,7 +183,7 @@ devops-update devops-synchronise: ### Update/upgrade the DevOps automation toolc
git submodule add --force \
https://github.com/$(DEVOPS_PROJECT_ORG)/$(DEVOPS_PROJECT_NAME).git \
$$(echo $(abspath $(TMP_DIR)/$(DEVOPS_PROJECT_NAME)) | sed "s;$(PROJECT_DIR);;g")
if [[ ! "$(LATEST)" =~ ^(true|yes|y|on|1|TRUE|YES|Y|ON)$$ ]]; then
if [[ "$(SELECT_BY_TAG)" =~ ^(true|yes|y|on|1|TRUE|YES|Y|ON)$$ ]]; then
tag=$$(make _devops-synchronise-select-tag-to-install)
cd $(TMP_DIR)/$(DEVOPS_PROJECT_NAME)
git checkout $$tag
Expand Down Expand Up @@ -225,6 +227,8 @@ devops-update devops-synchronise: ### Update/upgrade the DevOps automation toolc
cp -fv build/automation/lib/project/template/.github/CODEOWNERS $(PARENT_PROJECT_DIR)/.github
cp -fv build/automation/lib/project/template/.gitattributes $(PARENT_PROJECT_DIR)
)
mkdir -p $(PARENT_PROJECT_DIR)/.vscode
cp -fv build/automation/lib/project/template/.vscode/extensions.json $(PARENT_PROJECT_DIR)/.vscode/extensions.json
cp -fv build/automation/tmp/.gitignore $(PARENT_PROJECT_DIR)/build/automation/tmp/.gitignore
cp -fv LICENSE.md $(PARENT_PROJECT_DIR)/build/automation/LICENSE.md
[ -f $(PARENT_PROJECT_DIR)/docker/docker-compose.yml ] && rm -fv $(PARENT_PROJECT_DIR)/docker/.gitkeep
Expand Down Expand Up @@ -283,7 +287,11 @@ devops-update devops-synchronise: ### Update/upgrade the DevOps automation toolc
version=$$(make get-variable NAME=DEVOPS_PROJECT_VERSION)
if [ 0 -lt $$(git status -s | wc -l) ]; then
git add .
[ "$(NO_COMMIT)" != true ] && git commit -S -m "Update automation scripts to $$version" || echo "Please, check and commit the changes with the following message: \"Update automation scripts to $$version\""
if [[ "$(PERFORM_COMMIT)" =~ ^(true|yes|y|on|1|TRUE|YES|Y|ON)$$ ]]; then
git commit -S -m "Update automation scripts to $$version"
else
echo "Please, check and commit the changes with the following message: \"Update automation scripts to $$version\""
fi
fi
}
if [ -z "$(__DEVOPS_SYNCHRONISE)" ]; then
Expand All @@ -304,7 +312,7 @@ _devops-project-update-variables: ### Set up project variables - mandatory: DIR=
pns=$$(cat $$file | grep "PROJECT_NAME_SHORT = " | sed "s/PROJECT_NAME_SHORT = //")
pdn=$$(cat $$file | grep "PROJECT_DISPLAY_NAME = " | sed "s/PROJECT_DISPLAY_NAME = //")
if [[ ! "$(ALWAYS_ASK)" =~ ^(true|yes|y|on|1|TRUE|YES|Y|ON)$$ ]]; then
if [ "$$pg" != 'uec/tools' ] && [ "$$pgs" != 'uec-tools' ] && [ "$$pn" != 'make-devops' ] && [ "$$pns" != 'mdo' ] && [ "$$pdn" != 'Make DevOps' ]; then
if [ "$$pg" != '[uec/dos-api]' ] && [ "$$pgs" != '[uec-dos-api]' ] && [ "$$pn" != '[project-name]' ] && [ "$$pns" != '[pns]' ] && [ "$$pdn" != '[Project Name]' ]; then
exit 0
fi
fi
Expand Down Expand Up @@ -546,7 +554,11 @@ DEVOPS_PROJECT_ORG := nhsd-exeter
DEVOPS_PROJECT_NAME := make-devops
DEVOPS_PROJECT_DIR := $(abspath $(lastword $(MAKEFILE_LIST))/..)
ifeq (true, $(shell [ ! -f $(PROJECT_DIR)/build/automation/VERSION ] && echo true))
DEVOPS_PROJECT_VERSION := $(or $(shell git tag --points-at HEAD 2> /dev/null | sed "s/v//g" ||:), $(shell echo $$(git show -s --format=%cd --date=format:%Y%m%d%H%M%S 2> /dev/null ||:)-$$(git rev-parse --short HEAD 2> /dev/null ||:)))
ifeq (true, $(shell [ -n "$$(git tag --points-at HEAD 2> /dev/null)" ] && echo true))
DEVOPS_PROJECT_VERSION := $(shell echo $$(git show -s --format=%cd --date=format:%Y%m%d%H%M%S 2> /dev/null ||:)-$$(git rev-parse --short HEAD 2> /dev/null ||:)-$(shell git tag --points-at HEAD 2> /dev/null | sed "s/v//g" ||:))
else
DEVOPS_PROJECT_VERSION := $(shell echo $$(git show -s --format=%cd --date=format:%Y%m%d%H%M%S 2> /dev/null ||:)-$$(git rev-parse --short HEAD 2> /dev/null ||:)-snapshot)
endif
else
DEVOPS_PROJECT_VERSION := $(shell cat $(PROJECT_DIR)/build/automation/VERSION)
endif
Expand All @@ -567,33 +579,34 @@ VAR_DIR := $(abspath $(DEVOPS_PROJECT_DIR)/var)
VAR_DIR_REL := $(shell echo $(VAR_DIR) | sed "s;$(PROJECT_DIR);;g")

APPLICATION_DIR := $(abspath $(or $(APPLICATION_DIR), $(PROJECT_DIR)/application))
APPLICATION_DIR_REL = $(shell echo $(APPLICATION_DIR) | sed "s;$(PROJECT_DIR);;g")
APPLICATION_DIR_REL := $(shell echo $(APPLICATION_DIR) | sed "s;$(PROJECT_DIR);;g")
APPLICATION_TEST_DIR := $(abspath $(or $(APPLICATION_TEST_DIR), $(PROJECT_DIR)/test))
APPLICATION_TEST_DIR_REL = $(shell echo $(APPLICATION_TEST_DIR) | sed "s;$(PROJECT_DIR);;g")
CONFIG_DIR := $(abspath $(or $(CONFIG_DIR), $(PROJECT_DIR)/config))
CONFIG_DIR_REL = $(shell echo $(CONFIG_DIR) | sed "s;$(PROJECT_DIR);;g")
CONFIG_DIR_REL := $(shell echo $(CONFIG_DIR) | sed "s;$(PROJECT_DIR);;g")
DATA_DIR := $(abspath $(or $(DATA_DIR), $(PROJECT_DIR)/data))
DATA_DIR_REL = $(shell echo $(DATA_DIR) | sed "s;$(PROJECT_DIR);;g")
DATA_DIR_REL := $(shell echo $(DATA_DIR) | sed "s;$(PROJECT_DIR);;g")
DEPLOYMENT_DIR := $(abspath $(or $(DEPLOYMENT_DIR), $(PROJECT_DIR)/deployment))
DEPLOYMENT_DIR_REL = $(shell echo $(DEPLOYMENT_DIR) | sed "s;$(PROJECT_DIR);;g")
GITHOOKS_DIR := $(abspath $(ETC_DIR)/githooks)
GITHOOKS_DIR_REL = $(shell echo $(GITHOOKS_DIR) | sed "s;$(PROJECT_DIR);;g")
GITHOOKS_DIR_REL := $(shell echo $(GITHOOKS_DIR) | sed "s;$(PROJECT_DIR);;g")
DOCUMENTATION_DIR := $(abspath $(or $(DOCUMENTATION_DIR), $(PROJECT_DIR)/documentation))
DOCUMENTATION_DIR_REL = $(shell echo $(DOCUMENTATION_DIR) | sed "s;$(PROJECT_DIR);;g")
DOCUMENTATION_DIR_REL := $(shell echo $(DOCUMENTATION_DIR) | sed "s;$(PROJECT_DIR);;g")
INFRASTRUCTURE_DIR := $(abspath $(or $(INFRASTRUCTURE_DIR), $(PROJECT_DIR)/infrastructure))
INFRASTRUCTURE_DIR_REL = $(shell echo $(INFRASTRUCTURE_DIR) | sed "s;$(PROJECT_DIR);;g")
INFRASTRUCTURE_DIR_REL := $(shell echo $(INFRASTRUCTURE_DIR) | sed "s;$(PROJECT_DIR);;g")
JQ_DIR_REL := $(shell echo $(abspath $(LIB_DIR)/jq) | sed "s;$(PROJECT_DIR);;g")

GIT_BRANCH_PATTERN_MAIN := ^(master|develop)$$
GIT_BRANCH_PATTERN_PREFIX := ^(task|spike|automation|test|bugfix|hotfix|fix|release|migration)
GIT_BRANCH_PATTERN_MAIN := ^(main|master|develop)$$
GIT_BRANCH_PATTERN_PREFIX := ^(task|spike|automation|test|bugfix|hotfix|fix|release|migration|refactor)
GIT_BRANCH_PATTERN_SUFFIX := ([A-Z]{2,5}-([0-9]{1,5}|X{1,5})_[A-Z][a-z]+_[A-Za-z0-9]+_[A-Za-z0-9_]+)$$
GIT_BRANCH_PATTERN_ADDITIONAL := ^(task/Update_(automation_scripts|dependencies|documentation|tests|versions)|task/Refactor|devops/[A-Z][a-z]+_[A-Za-z0-9_]+_[A-Za-z0-9_]+)$$
GIT_BRANCH_PATTERN_ADDITIONAL := ^(task/Update_(automation_scripts|dependencies|documentation|tests|versions)|task/Refactor|task/Refactor_[A-Za-z0-9_]+_[A-Za-z0-9_]+|refactor/[A-Z][a-z]+_[A-Za-z0-9_]+_[A-Za-z0-9_]+|devops/[A-Z][a-z]+_[A-Za-z0-9_]+_[A-Za-z0-9_]+|alignment/[A-Z][a-z]+_[A-Za-z0-9_]+_[A-Za-z0-9_]+)$$
GIT_BRANCH_PATTERN := $(GIT_BRANCH_PATTERN_MAIN)|$(GIT_BRANCH_PATTERN_PREFIX)/$(GIT_BRANCH_PATTERN_SUFFIX)|$(GIT_BRANCH_PATTERN_ADDITIONAL)
GIT_BRANCH_MAX_LENGTH := 72
GIT_TAG_PATTERN := [0-9]{12,14}-[a-z]{3,10}
GIT_COMMIT_MESSAGE_PATTERN_MAIN := ^(([A-Z]{2,5}-([0-9]{1,5}|X{1,5}) [A-Z][a-z]+ [[:print:]]+ [[:print:]]+[^!?,.:;=-]|Update (automation scripts|dependencies|documentation|tests|versions))([[:print:]][^!?,.:;=-])*)$$|^((Update|Refactor|Automate|Test|Fix|Release|Migrate) [[:print:]]+ [[:print:]]+[^!?,.:;=-])$$
GIT_COMMIT_MESSAGE_PATTERN_ADDITIONAL := ^([A-Z]{2,5}-([0-9]{1,5}|X{1,5}) [A-Z][a-z]+ [[:print:]]+ [[:print:]]+[^!?,.:;=-]|[A-Z][a-z]+ [[:print:]]+ [[:print:]]+[^!?,.:;=-])$$|([A-Z][[:print:]]+ \[ci:[[:blank:]]?[,a-z0-9-]+\])
GIT_COMMIT_MESSAGE_MAX_LENGTH := 72
GIT_PULL_REQUEST_TITLE_MAX_LENGTH := $(shell echo $$(( $(GIT_COMMIT_MESSAGE_MAX_LENGTH) + 12 )))

BUILD_DATE := $(or $(BUILD_DATE), $(shell date -u +"%Y-%m-%dT%H:%M:%S%z"))
BUILD_TIMESTAMP := $(shell date --date=$(BUILD_DATE) -u +"%Y%m%d%H%M%S" 2> /dev/null)
Expand All @@ -615,12 +628,15 @@ GOSS_PATH := $(BIN_DIR)/goss-linux-amd64
SETUP_COMPLETE_FLAG_FILE := $(TMP_DIR)/.make-devops-setup-complete

PROFILE := $(or $(PROFILE), local)
ENVIRONMENT := $(or $(ENVIRONMENT), $(or $(shell ([ $(PROFILE) = local ] && echo local) || (echo $(BUILD_BRANCH) | grep -Eoq '$(GIT_BRANCH_PATTERN_SUFFIX)' && (echo $(BUILD_BRANCH) | grep -Eo '[A-Za-z]{2,5}-[0-9]{1,5}' | tr '[:upper:]' '[:lower:]') || (echo $(BUILD_BRANCH) | grep -Eoq '^tags/$(GIT_TAG_PATTERN)' && echo $(PROFILE)) || ([ $(BUILD_BRANCH) = master ] && echo $(PROFILE)))), unknown))
ENVIRONMENT := $(or $(ENVIRONMENT), $(or $(shell ([ $(PROFILE) = local ] && echo local) || (echo $(BUILD_BRANCH) | grep -Eoq '$(GIT_BRANCH_PATTERN_SUFFIX)' && (echo $(BUILD_BRANCH) | grep -Eo '[A-Za-z]{2,5}-[0-9]{1,5}' | tr '[:upper:]' '[:lower:]') || (echo $(BUILD_BRANCH) | grep -Eoq '^tags/$(GIT_TAG_PATTERN)' && echo $(PROFILE)) || (([ $(BUILD_BRANCH) = main ] || [ $(BUILD_BRANCH) = master ]) && echo $(PROFILE)))), unknown))

PATH_HOMEBREW := /usr/local/opt/coreutils/libexec/gnubin:/usr/local/opt/findutils/libexec/gnubin:/usr/local/opt/gnu-sed/libexec/gnubin:/usr/local/opt/gnu-tar/libexec/gnubin:/usr/local/opt/grep/libexec/gnubin:/usr/local/opt/make/libexec/gnubin:/opt/homebrew/opt/coreutils/libexec/gnubin:/opt/homebrew/opt/findutils/libexec/gnubin:/opt/homebrew/opt/gnu-sed/libexec/gnubin:/opt/homebrew/opt/gnu-tar/libexec/gnubin:/opt/homebrew/opt/grep/libexec/gnubin:/opt/homebrew/opt/make/libexec/gnubin:/opt/homebrew/bin
PATH_DEVOPS := $(BIN_DIR)
PATH_HOMEBREW := /opt/homebrew/opt/coreutils/libexec/gnubin:/opt/homebrew/opt/findutils/libexec/gnubin:/opt/homebrew/opt/grep/libexec/gnubin:/opt/homebrew/opt/gnu-sed/libexec/gnubin:/opt/homebrew/opt/gnu-tar/libexec/gnubin:/opt/homebrew/opt/make/libexec/gnubin:/opt/homebrew/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/opt/findutils/libexec/gnubin:/usr/local/opt/grep/libexec/gnubin:/usr/local/opt/gnu-sed/libexec/gnubin:/usr/local/opt/gnu-tar/libexec/gnubin:/usr/local/opt/make/libexec/gnubin
PATH_DEVOPS := $(BIN_DIR):$(HOME)/.pyenv/bin:$(HOME)/.pyenv/shims
PATH_SYSTEM := /usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin

BASH_VERSION := $(shell bash --version | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+' | head -1)
MAKE_VERSION := $(shell make --version | grep -Eo '[0-9]+\.[0-9]+(\.[0-9]+)?' | head -1)

# ==============================================================================
# `make` configuration

Expand Down Expand Up @@ -734,13 +750,12 @@ endif
# ==============================================================================
# Check if all the prerequisites are met

# ifeq (true, $(shell echo true))
# $(shell tput setaf 4; echo "Installation of the Xcode Command Line Tools has just been triggered automatically..."; tput sgr0)
# $(info Dupa!)
# endif
ifeq (true, $(shell $(PROJECT_DIR)/build/automation/lib/system.sh > $(PROJECT_DIR)/build/automation/tmp/.system.env && echo true))
include $(abspath $(PROJECT_DIR)/build/automation/tmp/.system.env)
endif

ifeq (true, $(shell [ ! -f $(SETUP_COMPLETE_FLAG_FILE) ] && echo true))
ifeq (true, $(shell [ "Darwin" = "$$(uname)" ] && echo true))
ifeq (true, $(shell [ $(SYSTEM_DIST) = "macos" ] && echo true))
# macOS: Xcode Command Line Tools
ifneq (0, $(shell xcode-select -p > /dev/null 2>&1; echo $$?))
$(info )
Expand All @@ -753,15 +768,10 @@ ifneq (0, $(shell which brew > /dev/null 2>&1 || test -x /opt/homebrew/bin/brew;
$(info )
$(info Run $(shell tput setaf 4; echo '/bin/bash -c "$$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"'; tput sgr0))
$(info )
$(info or alternatively $(shell tput setaf 4; echo '/usr/bin/ruby -e "$$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"'; tput sgr0))
$(info )
$(error $(shell tput setaf 202; echo "WARNING: Please, before proceeding install the brew package manager. Copy and paste in your terminal the above command and execute it. If it fails to install try setting your DNS server to 8.8.8.8. Then, run the \`curl\` installation command"; tput sgr0))
endif
# macOS: GNU Make
ifeq (true, $(shell [ ! -f /usr/local/opt/make/libexec/gnubin/make ] && [ ! -f /opt/homebrew/opt/make/libexec/gnubin/make ] && echo true))
$(shell brew install make || /opt/homebrew/bin/brew install make)
endif
ifeq (true, $(shell [ ! -f /usr/local/opt/make/libexec/gnubin/make ] && [ ! -f /opt/homebrew/opt/make/libexec/gnubin/make ] && echo true))
$(info )
$(info Run $(shell tput setaf 4; echo "brew install make"; tput sgr0))
$(info )
Expand Down
23 changes: 14 additions & 9 deletions build/automation/lib/docker.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ DOCKER_NETWORK = $(PROJECT_GROUP_SHORT)/$(PROJECT_NAME_SHORT)/$(BUILD_ID)
DOCKER_REGISTRY = $(AWS_ECR)/$(PROJECT_GROUP_SHORT)/$(PROJECT_NAME_SHORT)
DOCKER_LIBRARY_REGISTRY = nhsd

DOCKER_ALPINE_VERSION = 3.13.5
DOCKER_ALPINE_VERSION = 3.15.0
DOCKER_COMPOSER_VERSION = 2.0.13
DOCKER_CONFIG_LINT_VERSION = v1.6.0
DOCKER_DIND_VERSION = 20.10.6-dind
DOCKER_EDITORCONFIG_CHECKER_VERSION = 2.3.5
DOCKER_ELASTICSEARCH_VERSION = 7.13.0
DOCKER_DIND_VERSION = 20.10.12-dind
DOCKER_EDITORCONFIG_CHECKER_VERSION = 2.4.0
DOCKER_ELASTICSEARCH_VERSION = 7.17.0
DOCKER_GRADLE_VERSION = 7.0.2-jdk$(JAVA_VERSION)
DOCKER_LOCALSTACK_VERSION = $(LOCALSTACK_VERSION)
DOCKER_MAVEN_VERSION = 3.8.1-openjdk-$(JAVA_VERSION)-slim
DOCKER_NGINX_VERSION = 1.21.0-alpine
DOCKER_NGINX_VERSION = 1.21.6-alpine
DOCKER_NODE_VERSION = $(NODE_VERSION)-alpine
DOCKER_OPENJDK_VERSION = $(JAVA_VERSION)-alpine
DOCKER_POSTGRES_VERSION = $(POSTGRES_VERSION)-alpine
Expand Down Expand Up @@ -411,9 +411,9 @@ docker-run-composer: ### Run composer container - mandatory: CMD; optional: DIR,

docker-run-editorconfig: ### Run editorconfig container - optional: DIR=[working directory],EXCLUDE=[file pattern e.g. '\.txt$$'],ARGS=[Docker args],VARS_FILE=[Makefile vars file],IMAGE=[image name],CONTAINER=[container name]
if [ $(PROJECT_NAME) = $(DEVOPS_PROJECT_NAME) ]; then
exclude='$(shell [ -n "$(EXCLUDE)" ] && echo '$(EXCLUDE)|')markdown|linux-amd64$$|\.drawio|\.p12|\.so$$'
exclude='$(shell [ -n "$(EXCLUDE)" ] && echo '$(EXCLUDE)|')markdown|linux-amd64$$|\.drawio|\.p12|\.jks|\.so$$'
else
exclude='$(shell [ -n "$(EXCLUDE)" ] && echo '$(EXCLUDE)|')build/automation|markdown|linux-amd64$$|\.drawio|\.p12|\.so$$'
exclude='$(shell [ -n "$(EXCLUDE)" ] && echo '$(EXCLUDE)|')build/automation|markdown|linux-amd64$$|\.drawio|\.p12|\.jks|\.so$$'
fi
make docker-config > /dev/null 2>&1
image=$$([ -n "$(IMAGE)" ] && echo $(IMAGE) || echo mstruebing/editorconfig-checker:$(DOCKER_EDITORCONFIG_CHECKER_VERSION))
Expand Down Expand Up @@ -782,6 +782,11 @@ docker-compose-log: ### Log Docker Compose output - optional: DO_NOT_FOLLOW=true
docker-compose --file $$yml \
logs $$(echo $(DO_NOT_FOLLOW) | grep -E 'true|yes|y|on|1|TRUE|YES|Y|ON' > /dev/null 2>&1 && : || echo "--follow")

docker-compose-exec: ### Run Docker Compose exec command - mandatory: CMD; optional: YML=[docker-compose.yml, defaults to $(DOCKER_COMPOSE_YML)]
yml=$$(make _docker-get-docker-compose-yml YML=$(YML))
docker-compose --file $$yml \
exec $(CMD)

# ==============================================================================

_docker-get-dir:
Expand Down Expand Up @@ -840,8 +845,8 @@ docker-image-get-digest: ### Get image digest by matching tag pattern - mandato
REPO=$$(make _docker-get-reg)/$(NAME) \
TAG=$(or $(VERSION), $(TAG))

docker-image-find-and-version-as: ### Find image based on git commit hash and tag it - mandatory: VERSION|TAG=[new version/tag],NAME=[image name]; optional: COMMIT=[git commit hash, defaults to HEAD]
commit=$(or $(COMMIT), master)
docker-image-find-and-version-as: ### Find image based on git commit hash and tag it - mandatory: VERSION|TAG=[new version/tag],NAME=[image name]; optional: COMMIT=[git commit hash, defaults to main]
commit=$(or $(COMMIT), $$(make git-branch-get-main-name))
hash=$$(make git-commit-get-hash COMMIT=$$commit)
digest=$$(make docker-image-get-digest NAME=$(NAME) TAG=$$hash)
make docker-pull NAME=$(NAME) DIGEST=$$digest
Expand Down
5 changes: 2 additions & 3 deletions build/automation/lib/docker/compose/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: "3.7"
version: "3.9"

# TODO: What's the purpose of this file?

Expand Down Expand Up @@ -83,5 +83,4 @@ services:

networks:
default:
external:
name: $DOCKER_NETWORK
name: $DOCKER_NETWORK
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: "3.7"
version: "3.9"

services:
mockservice:
Expand All @@ -16,5 +16,4 @@ services:

networks:
default:
external:
name: $DOCKER_NETWORK
name: $DOCKER_NETWORK
2 changes: 1 addition & 1 deletion build/automation/lib/docker/image/elasticsearch/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM bitnami/elasticsearch:latest
ENV \
DEBIAN_FRONTEND="noninteractive" \
GOSU_VERSION="1.12" \
GOSU_VERSION="1.14" \
LANG="C.UTF-8" \
LC_ALL="C.UTF-8" \
SYSTEM_USER_GID="999" \
Expand Down
2 changes: 1 addition & 1 deletion build/automation/lib/docker/image/elasticsearch/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20210530
20220301
2 changes: 1 addition & 1 deletion build/automation/lib/docker/image/nginx/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ FROM nginx:latest as base

FROM base as builder
ENV \
GOSU_VERSION="1.12"
GOSU_VERSION="1.14"

RUN set -eux && \
\
Expand Down
2 changes: 1 addition & 1 deletion build/automation/lib/docker/image/nginx/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20210530
20220301
Loading

0 comments on commit a630fe6

Please sign in to comment.