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
# DOCKER_DRIVER: overlay
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:
stage: deploy
......@@ -18,7 +18,7 @@ development:
stable:
stage: deploy
script:
- docker build -t "$CI_REGISTRY_IMAGE:$(CI_BUILD_REF_NAME)" .
- docker push "$CI_REGISTRY_IMAGE:$(CI_BUILD_REF_NAME)"
- docker build -t "$CI_REGISTRY_IMAGE:$(CI_COMMIT_REF_NAME)" .
- docker push "$CI_REGISTRY_IMAGE:$(CI_COMMIT_REF_NAME)"
only:
- tags
......@@ -80,9 +80,9 @@ else
echo ""
fi
if [[ -n "$CI_BUILD_TOKEN" ]]; then
if [[ -n "$CI_JOB_TOKEN" ]]; then
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 ""
fi
......
......@@ -29,7 +29,7 @@ export CONTAINER_HTTP_PORT="${CONTAINER_HTTP_PORT:-$CONTAINER_HTTP_PORT}"
if [[ -z "$CI_ENVIRONMENT_URL" ]]; then
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")"
echo "CI_ENVIRONMENT_URL: $CI_ENVIRONMENT_URL"
fi
......@@ -62,7 +62,7 @@ metadata:
labels:
app: $CI_ENVIRONMENT_SLUG
pipeline_id: "$CI_PIPELINE_ID"
build_id: "$CI_BUILD_ID"
build_id: "$CI_JOB_ID"
spec:
replicas: 1
revisionHistoryLimit: ${DEPLOYMENT_HISTORY_LIMIT:-3}
......@@ -80,8 +80,8 @@ spec:
env:
- name: CI_PIPELINE_ID
value: "$CI_PIPELINE_ID"
- name: CI_BUILD_ID
value: "$CI_BUILD_ID"
- name: CI_JOB_ID
value: "$CI_JOB_ID"
ports:
- name: web
containerPort: $CONTAINER_HTTP_PORT
......@@ -106,7 +106,7 @@ metadata:
labels:
app: $CI_ENVIRONMENT_SLUG
pipeline_id: "$CI_PIPELINE_ID"
build_id: "$CI_BUILD_ID"
build_id: "$CI_JOB_ID"
spec:
ports:
- name: web
......@@ -123,7 +123,7 @@ metadata:
labels:
app: $CI_ENVIRONMENT_SLUG
pipeline_id: "$CI_PIPELINE_ID"
build_id: "$CI_BUILD_ID"
build_id: "$CI_JOB_ID"
annotations:
kubernetes.io/ingress.class: "nginx"
$INGRESS_SSL_ANNOTATION
......
......@@ -2,8 +2,8 @@ set -eo pipefail
[[ "$TRACE" ]] && set -x
export CI_CONTAINER_NAME="ci_job_build_$CI_BUILD_ID"
export CI_REGISTRY_TAG="${CI_REGISTRY_TAG:-$CI_BUILD_REF_NAME}"
export CI_CONTAINER_NAME="ci_job_build_$CI_JOB_ID"
export CI_REGISTRY_TAG="${CI_REGISTRY_TAG:-$CI_COMMIT_REF_NAME}"
create_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