Commit 8675116a authored by Renato Figueiro Maia's avatar Renato Figueiro Maia
Browse files

Evitar executar etapa de implantação no Kubernetes.

[SOMA-9564][SOMA-9011]
parent d1bcdcf0
Pipeline #93523 passed with stages
in 4 minutes and 19 seconds
......@@ -32,7 +32,7 @@ stages:
- version
- test
- release
- deploy
# - deploy
#-------------------------
# Versioning Jobs
......@@ -207,51 +207,51 @@ package_helm:
# -----------------------
# Deploy Stage
# -----------------------
.helm_upgrade:
stage: deploy
<<: *helm_kubectl_image_template
script:
- cat ${CI_KUBE_CONFIG_FILE} > .kube/kube-config.yaml
- export KUBERNETES_CONTEXT="K8S-CONTEXT-PACKAGE-${CI_COMMIT_SHORT_SHA}"
- kubectl config set-cluster "$CI_KUBERNETES_CLUSTER" --insecure-skip-tls-verify=true --server="$CI_KUBERNETES_URL"
- kubectl config set-context "$KUBERNETES_CONTEXT" --cluster="$CI_KUBERNETES_CLUSTER" --user="$CI_KUBERNETES_USER_NAME"
- kubectl config set-credentials "$CI_KUBERNETES_USER_NAME" --token="$CI_KUBERNETES_USER_TOKEN"
- kubectl config use-context "$KUBERNETES_CONTEXT"
- export CHART_NAME="$(grep -E "^name:" kubernetes/posix/helm/Chart.yaml | cut -d":" -f2 | sed -e 's/^[ \t]*//')"
- export CHART_VERSION="$(grep -E "^version:" kubernetes/posix/helm/Chart.yaml | cut -d":" -f2 | sed -e 's/^[ \t]*//')"
- export RELEASE_NAME="${CHART_NAME}-${RELEASE_NAME_SUFFIX}"
- helm repo add soma-charts-nexus ${CI_HELM_REGISTRY_URL} --username ${CI_REGISTRY_USER} --password ${CI_REGISTRY_PASSWORD}
- helm repo list | grep soma-charts-nexus
- helm upgrade --install --namespace ${NAMESPACE} ${RELEASE_NAME} soma-charts-nexus/${CHART_NAME} --version=${CHART_VERSION} --values kubernetes/posix/helm/demo/${FILES_NAME} --set-string podAnnotations.commit=${CI_COMMIT_SHA} --dry-run >> ${ARTIFACT_NAME}
- helm upgrade --install --namespace ${NAMESPACE} ${RELEASE_NAME} soma-charts-nexus/${CHART_NAME} --version=${CHART_VERSION} --values kubernetes/posix/helm/demo/${FILES_NAME} --set-string podAnnotations.commit=${CI_COMMIT_SHA}
# .helm_upgrade:
# stage: deploy
# <<: *helm_kubectl_image_template
# script:
# - cat ${CI_KUBE_CONFIG_FILE} > .kube/kube-config.yaml
# - export KUBERNETES_CONTEXT="K8S-CONTEXT-PACKAGE-${CI_COMMIT_SHORT_SHA}"
# - kubectl config set-cluster "$CI_KUBERNETES_CLUSTER" --insecure-skip-tls-verify=true --server="$CI_KUBERNETES_URL"
# - kubectl config set-context "$KUBERNETES_CONTEXT" --cluster="$CI_KUBERNETES_CLUSTER" --user="$CI_KUBERNETES_USER_NAME"
# - kubectl config set-credentials "$CI_KUBERNETES_USER_NAME" --token="$CI_KUBERNETES_USER_TOKEN"
# - kubectl config use-context "$KUBERNETES_CONTEXT"
# - export CHART_NAME="$(grep -E "^name:" kubernetes/posix/helm/Chart.yaml | cut -d":" -f2 | sed -e 's/^[ \t]*//')"
# - export CHART_VERSION="$(grep -E "^version:" kubernetes/posix/helm/Chart.yaml | cut -d":" -f2 | sed -e 's/^[ \t]*//')"
# - export RELEASE_NAME="${CHART_NAME}-${RELEASE_NAME_SUFFIX}"
# - helm repo add soma-charts-nexus ${CI_HELM_REGISTRY_URL} --username ${CI_REGISTRY_USER} --password ${CI_REGISTRY_PASSWORD}
# - helm repo list | grep soma-charts-nexus
# - helm upgrade --install --namespace ${NAMESPACE} ${RELEASE_NAME} soma-charts-nexus/${CHART_NAME} --version=${CHART_VERSION} --values kubernetes/posix/helm/demo/${FILES_NAME} --set-string podAnnotations.commit=${CI_COMMIT_SHA} --dry-run >> ${ARTIFACT_NAME}
# - helm upgrade --install --namespace ${NAMESPACE} ${RELEASE_NAME} soma-charts-nexus/${CHART_NAME} --version=${CHART_VERSION} --values kubernetes/posix/helm/demo/${FILES_NAME} --set-string podAnnotations.commit=${CI_COMMIT_SHA}
deploy_snapshot:
extends: .helm_upgrade
before_script:
- export NAMESPACE=soma-dev
- export RELEASE_NAME_SUFFIX=snapshot
- export FILES_NAME="dev-values.yaml"
- export ARTIFACT_NAME="helm-dev.log"
artifacts:
paths:
- helm-dev.log
expire_in: 1 month
only:
- master
# deploy_snapshot:
# extends: .helm_upgrade
# before_script:
# - export NAMESPACE=soma-dev
# - export RELEASE_NAME_SUFFIX=snapshot
# - export FILES_NAME="dev-values.yaml"
# - export ARTIFACT_NAME="helm-dev.log"
# artifacts:
# paths:
# - helm-dev.log
# expire_in: 1 month
# only:
# - master
deploy_latest:
extends: .helm_upgrade
before_script:
- export NAMESPACE=soma-hml
- export RELEASE_NAME_SUFFIX=latest
- export FILES_NAME="hml-values.yaml"
- export ARTIFACT_NAME="helm-hml.log"
artifacts:
paths:
- helm-hml.log
expire_in: 1 month
only:
- tags
# deploy_latest:
# extends: .helm_upgrade
# before_script:
# - export NAMESPACE=soma-hml
# - export RELEASE_NAME_SUFFIX=latest
# - export FILES_NAME="hml-values.yaml"
# - export ARTIFACT_NAME="helm-hml.log"
# artifacts:
# paths:
# - helm-hml.log
# expire_in: 1 month
# only:
# - tags
#-------------------------
# Clean Cache Job
......
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