Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- deploy-qa:
- needs: ["build"]
- stage: qa
- image:
- name: dtzar/helm-kubectl:latest
- entrypoint: [""]
- before_script:
- - wget https://github.com/mikefarah/yq/releases/download/v4.2.0/yq_linux_amd64.tar.gz -O - | tar xz && mv yq_linux_amd64 /usr/bin/yq
- script:
- - export COMMIT_DATE=$(git log -1 --format=%cd --date=format:'%Y%m%d%H%M%S')
- - export IMAGE_NAME=${CI_REPOSITORY}:${IMAGE_TAG}-${COMMIT_DATE}
- - chmod +x ./scripts/update-values.sh
- - ./scripts/update-values.sh
- - kubectl config use-context $KUBECTL_CONTEXT
- - kubectl create namespace ${CI_COMMIT_REF_SLUG} --dry-run=client -o yaml | kubectl apply -f - || true
- - kubectl create secret docker-registry gitlabregistry -n ${CI_COMMIT_REF_SLUG} --docker-server $CI_REGISTRY --docker-username $CI_REGISTRY_USER --docker-password $CI_REGISTRY_PASSWORD --docker-email $CI_REGISTRY_EMAIL --dry-run=client -o yaml | kubectl apply -f - || true
- - helm upgrade --install -n ${CI_COMMIT_REF_SLUG} ${RELEASE_NAME} ./deploy/k8s --values ./deploy/k8s/values.yaml
- environment:
- name: qa/$CI_COMMIT_REF_SLUG
- url: https://${CI_COMMIT_REF_SLUG}.${DEV_DOMAIN}
- on_stop: finish-qa
- rules:
- - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"'
- when: always
- - when: never
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement