Commit 933bf9e4 authored by Gerry Gunzenhauser's avatar Gerry Gunzenhauser

gitlab 9

parent 11413ffd
Pipeline #12872 failed with stage
in 5 seconds
...@@ -5,7 +5,7 @@ image: docker:latest ...@@ -5,7 +5,7 @@ image: docker:latest
# DOCKER_DRIVER: overlay # DOCKER_DRIVER: overlay
before_script: before_script:
- docker login -u gitlab-ci-token -p "$CI_BUILD_TOKEN" "$CI_REGISTRY" - docker login -u gitlab-ci-token -p "$CI_JOB_TOKEN" "$CI_REGISTRY"
development: development:
stage: deploy stage: deploy
...@@ -18,7 +18,7 @@ development: ...@@ -18,7 +18,7 @@ development:
stable: stable:
stage: deploy stage: deploy
script: script:
- docker build -t "$CI_REGISTRY_IMAGE:$(CI_BUILD_REF_NAME)" . - docker build -t "$CI_REGISTRY_IMAGE:$(CI_COMMIT_REF_NAME)" .
- docker push "$CI_REGISTRY_IMAGE:$(CI_BUILD_REF_NAME)" - docker push "$CI_REGISTRY_IMAGE:$(CI_COMMIT_REF_NAME)"
only: only:
- tags - tags
...@@ -80,9 +80,9 @@ else ...@@ -80,9 +80,9 @@ else
echo "" echo ""
fi fi
if [[ -n "$CI_BUILD_TOKEN" ]]; then if [[ -n "$CI_JOB_TOKEN" ]]; then
echo "Logging to GitLab Container Registry with CI credentials..." echo "Logging to GitLab Container Registry with CI credentials..."
docker login -u gitlab-ci-token -p "$CI_BUILD_TOKEN" "$CI_REGISTRY" docker login -u gitlab-ci-token -p "$CI_JOB_TOKEN" "$CI_REGISTRY"
echo "" echo ""
fi fi
......
...@@ -29,7 +29,7 @@ export CONTAINER_HTTP_PORT="${CONTAINER_HTTP_PORT:-$CONTAINER_HTTP_PORT}" ...@@ -29,7 +29,7 @@ export CONTAINER_HTTP_PORT="${CONTAINER_HTTP_PORT:-$CONTAINER_HTTP_PORT}"
if [[ -z "$CI_ENVIRONMENT_URL" ]]; then if [[ -z "$CI_ENVIRONMENT_URL" ]]; then
echo "Reading CI_ENVIRONMENT_URL from .gitlab-ci.yml..." echo "Reading CI_ENVIRONMENT_URL from .gitlab-ci.yml..."
CI_ENVIRONMENT_URL="$(ruby -ryaml -e 'puts YAML.load_file(".gitlab-ci.yml")[ENV["CI_BUILD_NAME"]]["environment"]["url"]')" CI_ENVIRONMENT_URL="$(ruby -ryaml -e 'puts YAML.load_file(".gitlab-ci.yml")[ENV["CI_JOB_NAME"]]["environment"]["url"]')"
CI_ENVIRONMENT_URL="$(eval echo "$CI_ENVIRONMENT_URL")" CI_ENVIRONMENT_URL="$(eval echo "$CI_ENVIRONMENT_URL")"
echo "CI_ENVIRONMENT_URL: $CI_ENVIRONMENT_URL" echo "CI_ENVIRONMENT_URL: $CI_ENVIRONMENT_URL"
fi fi
...@@ -62,7 +62,7 @@ metadata: ...@@ -62,7 +62,7 @@ metadata:
labels: labels:
app: $CI_ENVIRONMENT_SLUG app: $CI_ENVIRONMENT_SLUG
pipeline_id: "$CI_PIPELINE_ID" pipeline_id: "$CI_PIPELINE_ID"
build_id: "$CI_BUILD_ID" build_id: "$CI_JOB_ID"
spec: spec:
replicas: 1 replicas: 1
revisionHistoryLimit: ${DEPLOYMENT_HISTORY_LIMIT:-3} revisionHistoryLimit: ${DEPLOYMENT_HISTORY_LIMIT:-3}
...@@ -80,8 +80,8 @@ spec: ...@@ -80,8 +80,8 @@ spec:
env: env:
- name: CI_PIPELINE_ID - name: CI_PIPELINE_ID
value: "$CI_PIPELINE_ID" value: "$CI_PIPELINE_ID"
- name: CI_BUILD_ID - name: CI_JOB_ID
value: "$CI_BUILD_ID" value: "$CI_JOB_ID"
ports: ports:
- name: web - name: web
containerPort: $CONTAINER_HTTP_PORT containerPort: $CONTAINER_HTTP_PORT
...@@ -106,7 +106,7 @@ metadata: ...@@ -106,7 +106,7 @@ metadata:
labels: labels:
app: $CI_ENVIRONMENT_SLUG app: $CI_ENVIRONMENT_SLUG
pipeline_id: "$CI_PIPELINE_ID" pipeline_id: "$CI_PIPELINE_ID"
build_id: "$CI_BUILD_ID" build_id: "$CI_JOB_ID"
spec: spec:
ports: ports:
- name: web - name: web
...@@ -123,7 +123,7 @@ metadata: ...@@ -123,7 +123,7 @@ metadata:
labels: labels:
app: $CI_ENVIRONMENT_SLUG app: $CI_ENVIRONMENT_SLUG
pipeline_id: "$CI_PIPELINE_ID" pipeline_id: "$CI_PIPELINE_ID"
build_id: "$CI_BUILD_ID" build_id: "$CI_JOB_ID"
annotations: annotations:
kubernetes.io/ingress.class: "nginx" kubernetes.io/ingress.class: "nginx"
$INGRESS_SSL_ANNOTATION $INGRESS_SSL_ANNOTATION
......
...@@ -2,8 +2,8 @@ set -eo pipefail ...@@ -2,8 +2,8 @@ set -eo pipefail
[[ "$TRACE" ]] && set -x [[ "$TRACE" ]] && set -x
export CI_CONTAINER_NAME="ci_job_build_$CI_BUILD_ID" export CI_CONTAINER_NAME="ci_job_build_$CI_JOB_ID"
export CI_REGISTRY_TAG="${CI_REGISTRY_TAG:-$CI_BUILD_REF_NAME}" export CI_REGISTRY_TAG="${CI_REGISTRY_TAG:-$CI_COMMIT_REF_NAME}"
create_kubeconfig() { create_kubeconfig() {
echo "Generating kubeconfig..." echo "Generating kubeconfig..."
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment