Skip to content
Snippets Groups Projects
Verified Commit 77191032 authored by David Hoese's avatar David Hoese
Browse files

Add kubernetes tag to CI runner tags

parent 148cb48f
No related branches found
No related tags found
No related merge requests found
...@@ -14,20 +14,34 @@ variables: ...@@ -14,20 +14,34 @@ variables:
HELM_EXPERIMENTAL_OCI: "1" HELM_EXPERIMENTAL_OCI: "1"
CICHART_IMAGE: "$CI_REGISTRY_IMAGE/cichart:latest" CICHART_IMAGE: "$CI_REGISTRY_IMAGE/cichart:latest"
build ci:
stage: .pre .docker_based_job:
image: docker:19.03.1 image: docker:19.03.1
tags: tags:
- docker - docker
- kubernetes
services: services:
- docker:19.03.1-dind - docker:19.03.1-dind
before_script: before_script:
- docker info - docker info
- docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY} - docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY}
.helm_based_job:
extends: .docker_based_job
image: $CICHART_IMAGE
before_script:
- docker info
- docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY}
- shopt -s expand_aliases
- 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' - 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} - helm registry login -u ${CI_REGISTRY_USER} -p ${CI_JOB_TOKEN} ${CI_REGISTRY}
build ci:
stage: .pre
extends: .docker_based_job
script: script:
- docker login --username $CI_REGISTRY_USER --password $CI_REGISTRY_PASSWORD $CI_REGISTRY
- cd cichart - cd cichart
- docker build --tag $CICHART_IMAGE . - docker build --tag $CICHART_IMAGE .
- docker push $CICHART_IMAGE - docker push $CICHART_IMAGE
...@@ -40,23 +54,13 @@ build ci: ...@@ -40,23 +54,13 @@ build ci:
.get_chart_tmpl: .get_chart_tmpl:
extends: .helm_based_job
stage: get chart stage: get chart
image: $CICHART_IMAGE
services:
- docker:19.03.1-dind
tags:
- docker
variables: variables:
SUBCOMP_REPOS_BASE: "https://gitlab.ssec.wisc.edu/cspp_geo/geosphere" SUBCOMP_REPOS_BASE: "https://gitlab.ssec.wisc.edu/cspp_geo/geosphere"
# required: # required:
SUBCOMP_REPOS: "" SUBCOMP_REPOS: ""
SUBCOMP_CHART_DIR: "" SUBCOMP_CHART_DIR: ""
before_script:
- docker info
- docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY}
- shopt -s expand_aliases
- 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}
script: script:
- repos_url="${SUBCOMP_REPOS_BASE}/${SUBCOMP_REPOS}" - repos_url="${SUBCOMP_REPOS_BASE}/${SUBCOMP_REPOS}"
- git clone --depth 1 $repos_url - git clone --depth 1 $repos_url
...@@ -93,18 +97,8 @@ get_chart_grb: ...@@ -93,18 +97,8 @@ get_chart_grb:
# TODO: Use "environment: " to define a job for production and one for development # TODO: Use "environment: " to define a job for production and one for development
# https://docs.gitlab.com/ee/ci/yaml/#environment # https://docs.gitlab.com/ee/ci/yaml/#environment
deploy_g16_grb: deploy_g16_grb:
extends: .helm_based_job
stage: deploy GRB stage: deploy GRB
image: $CICHART_IMAGE
services:
- docker:19.03.1-dind
tags:
- docker
before_script:
- docker info
- docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY}
- shopt -s expand_aliases
- 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}
script: script:
- if [ -n "$CI_COMMIT_TAG" ]; then - if [ -n "$CI_COMMIT_TAG" ]; then
ns="geosphere"; ns="geosphere";
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
stage: build image stage: build image
tags: tags:
- docker - docker
- kubernetes
before_script: before_script:
- docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY} - docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY}
script: script:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment