Commit 1ad0c6ba authored by David Mendez's avatar David Mendez
Browse files

Fix naming of variables for deployment to staging

parent be32429f
...@@ -8,8 +8,14 @@ variables: ...@@ -8,8 +8,14 @@ variables:
DOCKER_DRIVER: overlay DOCKER_DRIVER: overlay
CONFIGS_FOLDER: run_config CONFIGS_FOLDER: run_config
# Config staging # Config staging
CONFIG_STAGING_FILE_PATH: ${CONFIGS_FOLDER}/staging/.env ENV_STAGING_FILE_PATH: ${CONFIGS_FOLDER}/staging/.env
INGRESS_STAGING_FILE_PATH: ${CONFIGS_FOLDER}/staging/ingress.yml INGRESS_STAGING_FILE_PATH: ${CONFIGS_FOLDER}/staging/ingress.yml
# Config prod hx
ENV_PROD_HX_FILE_PATH: ${CONFIGS_FOLDER}/prod_hx/.env
INGRESS_PROD_HX_FILE_PATH: ${CONFIGS_FOLDER}/prod_hx/ingress.yml
# Config prod hh
ENV_PROD_HH_FILE_PATH: ${CONFIGS_FOLDER}/prod_hh/.env
INGRESS_PROD_HH_FILE_PATH: ${CONFIGS_FOLDER}/prod_hh/ingress.yml
stages: stages:
- build - build
...@@ -17,7 +23,7 @@ stages: ...@@ -17,7 +23,7 @@ stages:
- prepare_config - prepare_config
- deploy - deploy
build-dev: build:
image: image:
name: docker/compose:1.25.5 name: docker/compose:1.25.5
entrypoint: ["/bin/sh", "-c"] entrypoint: ["/bin/sh", "-c"]
...@@ -76,7 +82,7 @@ prepare_config_staging: ...@@ -76,7 +82,7 @@ prepare_config_staging:
artifacts: artifacts:
paths: paths:
- ${CONFIG_STAGING_FILE_PATH} - ${ENV_STAGING_FILE_PATH}
- ${INGRESS_STAGING_FILE_PATH} - ${INGRESS_STAGING_FILE_PATH}
...@@ -94,7 +100,7 @@ deploy-dev-hx: ...@@ -94,7 +100,7 @@ deploy-dev-hx:
- kubectl config set-credentials ${KUBE_USER_HX} --token="${KUBE_TOKEN_HX}" - kubectl config set-credentials ${KUBE_USER_HX} --token="${KUBE_TOKEN_HX}"
- kubectl config set-context ${KUBE_NAMESPACE_DEV} --cluster=${KUBE_CLUS_NAME_HX} --user=${KUBE_USER_HX} - kubectl config set-context ${KUBE_NAMESPACE_DEV} --cluster=${KUBE_CLUS_NAME_HX} --user=${KUBE_USER_HX}
- kubectl config use-context ${KUBE_NAMESPACE_DEV} - kubectl config use-context ${KUBE_NAMESPACE_DEV}
- kubectl create secret generic ${RUN_CONFIG_SECRET_NAME_STAGING} --from-file=RUN_CONFIG.yml=${CONFIG_STAGING_FILE_PATH} -o yaml -n ${CHEMBL_NS_STAGING} --dry-run=client | kubectl apply -f - - kubectl create secret generic ${ENV_SECRET_NAME_STAGING} --from-file=.env=${ENV_STAGING_FILE_PATH} -o yaml -n ${CHEMBL_NS_STAGING} --dry-run=client | kubectl apply -f -
- cat ${CONFIG_STAGING_FILE_PATH} - cat ${CONFIG_STAGING_FILE_PATH}
- echo ${KUBE_NAMESPACE_DEV} ${KUBE_URL_HH} ${KUBE_CLUS_NAME_HX} ${KUBE_USER_HX} - echo ${KUBE_NAMESPACE_DEV} ${KUBE_URL_HH} ${KUBE_CLUS_NAME_HX} ${KUBE_USER_HX}
- kubectl get pods -n ${KUBE_NAMESPACE_DEV} - kubectl get pods -n ${KUBE_NAMESPACE_DEV}
...@@ -109,7 +115,28 @@ deploy-dev-hx: ...@@ -109,7 +115,28 @@ deploy-dev-hx:
- kubectl apply -n ${CHEMBL_NS_STAGING} -f ${INGRESS_STAGING_FILE_PATH} - kubectl apply -n ${CHEMBL_NS_STAGING} -f ${INGRESS_STAGING_FILE_PATH}
prepare_config_prod:
stage: prepare_config
image:
name: alpine/git
entrypoint: ["/bin/sh", "-c"]
only:
- master
script:
- set -x
- rm -rf ${CONFIGS_FOLDER} || true
- mkdir -p ${CONFIGS_FOLDER}
- git clone https://${CONFIG_DEPLOY_GITLAB_USERNAME}:${CONFIG_DEPLOY_GITLAB_TOKEN}@${CONFIGURATIONS_REPO} ${CONFIGS_FOLDER}
tags:
- docker
artifacts:
paths:
- ${ENV_PROD_HX_FILE_PATH}
- ${INGRESS_PROD_HX_FILE_PATH}
- ${ENV_PROD_HH_FILE_PATH}
- ${INGRESS_PROD_HH_FILE_PATH}
# deploy-dev-hh: # deploy-dev-hh:
# image: # image:
......
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