From 08e9cfbadec19985ff7e67dfb25f1a8ca3e59ab8 Mon Sep 17 00:00:00 2001 From: David Hoese <david.hoese@ssec.wisc.edu> Date: Thu, 2 Jul 2020 14:15:59 -0500 Subject: [PATCH] Add custom build image for getting helm charts --- .gitlab-ci.yml | 36 +++++++++++++++++++++++++++++++----- cichart/Dockerfile | 6 ++++++ 2 files changed, 37 insertions(+), 5 deletions(-) create mode 100644 cichart/Dockerfile diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 474730e..fb65b24 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,19 +6,45 @@ stages: - deploy_wms - deploy_wmts +variables: + DOCKER_TLS_CERTDIR: "" + DOCKER_HOST: "tcp://localhost:2375" + DOCKER_DRIVER: overlay2 + HELM_EXPERIMENTAL_OCI: "1" + CICHART_IMAGE: "$CI_REGISTRY_IMAGE/cichart:latest" + +build ci: + stage: .pre + image: docker:19.03.1 + services: + - docker:19.03.1-dind + before_script: + - docker info + - docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY} + - alias helm='docker run -t --rm -e HELM_EXPERIMENTAL_OCI="$HELM_EXPERIMENTAL_OCI" -v $(pwd):/apps -w /apps -v ~/.kube:/root/.kube -v ~/.helm:/root/.helm -v ~/.config/helm:/root/.config/helm -v ~/.cache/helm:/root/.cache/helm alpine/helm:3.2.3' + - helm registry login -u ${CI_REGISTRY_USER} -p ${CI_JOB_TOKEN} ${CI_REGISTRY} + - export + script: + - docker login --username $CI_REGISTRY_USER --password $CI_REGISTRY_PASSWORD $CI_REGISTRY + - cd ci + - docker build --tag $CICHART_IMAGE . + - docker push $CICHART_IMAGE + rules: + - changes: + - cichart/Dockerfile + when: always + - if: $BUILD_CI_IMAGE + when: always + .get_chart_tmpl: stage: get_chart - image: docker:19.03.1 + image: $CICHART_IMAGE services: - docker:19.03.1-dind tags: - docker variables: - DOCKER_TLS_CERTDIR: "" - DOCKER_HOST: "tcp://localhost:2375" - DOCKER_DRIVER: overlay2 - HELM_EXPERIMENTAL_OCI: "1" SUBCOMP_REPOS_BASE: "https://gitlab.ssec.wisc.edu/cspp_geo/geosphere" # required: SUBCOMP_REPOS: "" diff --git a/cichart/Dockerfile b/cichart/Dockerfile new file mode 100644 index 0000000..5533d9e --- /dev/null +++ b/cichart/Dockerfile @@ -0,0 +1,6 @@ +# Custom docker-based build image with git and other utilities added +FROM docker:19.03.1 + +RUN apk update && apk upgrade && \ + apk add findutils bash curl jq git && \ + rm -rf /var/cache/apk/* -- GitLab