Skip to content
This repository has been archived by the owner on Jun 14, 2023. It is now read-only.

Update docker-run-tools to work on Jenkins MoM #92

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion build/automation/lib/docker.mk
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,12 @@ docker-run-postgres: ### Run postgres container - mandatory: CMD; optional: DIR,
docker-run-tools: ### Run tools (Python) container - mandatory: CMD; optional: SH=true,DIR,ARGS=[Docker args],LIB_VOLUME_MOUNT=true,VARS_FILE=[Makefile vars file],IMAGE=[image name],CONTAINER=[container name]
make docker-config > /dev/null 2>&1
mkdir -p $(TMP_DIR)/.python/pip/{cache,packages}
mkdir -p $(HOME)/.aws
if [ $(HUDSON_URL) == $(JENKINS_MOM_URL) ]; then
mkdir -p $(HOME)/.aws
aws_access_dir=$$(echo "--volume $(HOME)/.aws:/tmp/.aws")
else
aws_access_dir=$$(echo "--volume /var/run/secrets/eks.amazonaws.com/serviceaccount/token:/var/run/secrets/eks.amazonaws.com/serviceaccount/token")
fi
lib_volume_mount=$$(([ $(BUILD_ID) -eq 0 ] || [ "$(LIB_VOLUME_MOUNT)" == true ]) && echo "--volume $(TMP_DIR)/.python/pip/cache:/tmp/.cache/pip --volume $(TMP_DIR)/.python/pip/packages:/tmp/.packages" ||:)
image=$$([ -n "$(IMAGE)" ] && echo $(IMAGE) || echo $(DOCKER_LIBRARY_REGISTRY)/tools:$(DOCKER_LIBRARY_TOOLS_VERSION))
container=$$([ -n "$(CONTAINER)" ] && echo $(CONTAINER) || echo tools-$(BUILD_COMMIT_HASH)-$(BUILD_ID)-$$(date --date=$$(date -u +"%Y-%m-%dT%H:%M:%S%z") -u +"%Y%m%d%H%M%S" 2> /dev/null)-$$(make secret-random LENGTH=8))
Expand All @@ -713,6 +718,7 @@ docker-run-tools: ### Run tools (Python) container - mandatory: CMD; optional: S
--volume $(HOME)/bin:/tmp/bin \
--volume $(HOME)/etc:/tmp/etc \
--volume $(HOME)/usr:/tmp/usr \
$$aws_access_dir \
$$lib_volume_mount \
--network $(DOCKER_NETWORK) \
--workdir /project/$(shell echo $(abspath $(DIR)) | sed "s;$(PROJECT_DIR);;g") \
Expand All @@ -736,6 +742,7 @@ docker-run-tools: ### Run tools (Python) container - mandatory: CMD; optional: S
--volume $(HOME)/bin:/tmp/bin \
--volume $(HOME)/etc:/tmp/etc \
--volume $(HOME)/usr:/tmp/usr \
$$aws_access_dir \
$$lib_volume_mount \
--network $(DOCKER_NETWORK) \
--workdir /project/$(shell echo $(abspath $(DIR)) | sed "s;$(PROJECT_DIR);;g") \
Expand Down
2 changes: 2 additions & 0 deletions build/automation/var/project.mk
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ PROJECT_TAG = $(PROJECT_NAME)
SERVICE_TAG = $(PROJECT_GROUP_SHORT)
SERVICE_TAG_COMMON = texas

JENKINS_MOM_URL = https://$(PROJECT_GROUP_SHORT)-jenkins-ddc-jenkins-master.mgmt.texasplatform.uk/

PROJECT_TECH_STACK_LIST = shell,terraform