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:
DOCKER_DRIVER: overlay
CONFIGS_FOLDER: run_config
# 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
# 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:
- build
......@@ -17,7 +23,7 @@ stages:
- prepare_config
- deploy
build-dev:
build:
image:
name: docker/compose:1.25.5
entrypoint: ["/bin/sh", "-c"]
......@@ -76,7 +82,7 @@ prepare_config_staging:
artifacts:
paths:
- ${CONFIG_STAGING_FILE_PATH}
- ${ENV_STAGING_FILE_PATH}
- ${INGRESS_STAGING_FILE_PATH}
......@@ -94,7 +100,7 @@ deploy-dev-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 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}
- echo ${KUBE_NAMESPACE_DEV} ${KUBE_URL_HH} ${KUBE_CLUS_NAME_HX} ${KUBE_USER_HX}
- kubectl get pods -n ${KUBE_NAMESPACE_DEV}
......@@ -109,7 +115,28 @@ deploy-dev-hx:
- 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:
# 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