Newer
Older
.get_chart_tmpl:
extends: .helm_based_job
stage: get chart
variables:
SUBCOMP_REPOS_BASE: "https://gitlab.ssec.wisc.edu/cspp_geo/geosphere"
# required:
SUBCOMP_REPOS: ""
SUBCOMP_CHART_DIR: ""
SUBCOMP_BRANCH: "master"
script:
- repos_url="${SUBCOMP_REPOS_BASE}/${SUBCOMP_REPOS}"
- git clone --depth 1 --branch ${SUBCOMP_BRANCH} $repos_url
- cd ${SUBCOMP_REPOS}
# most recent docker image should be tagged with most recent SHA
- docker_tag=$(git rev-parse --short=8 HEAD)
- echo $docker_tag
- cd chart
# make the docker tag available in later stages
- echo export docker_tag=$docker_tag >${SUBCOMP_CHART_DIR}/cibuild.env
- |-
sed -i "s/^appVersion: .*\$/appVersion: ${docker_tag}/g" ${SUBCOMP_CHART_DIR}/Chart.yaml
# debug:
- helm template ${SUBCOMP_CHART_DIR} ${SUBCOMP_CHART_DIR}
artifacts:
paths:
- ${SUBCOMP_REPOS}/chart/${SUBCOMP_CHART_DIR}
when: on_success
expire_in: 30 minutes