Commit b3a4590d authored by David Mendez's avatar David Mendez

Start to create step to deploy to prod hh

parent 95241fb9
Pipeline #93469 failed
......@@ -37,7 +37,6 @@ stages:
- test_staging
- deploy_to_prod_hx
- test_prod_hx
# - prepare_config_hh
# - deploy_to_prod_hh
# - test_prod_hh
# - functional_tests_prod_public
......@@ -271,52 +270,54 @@ functional_tests_prod_hx:
- sleep 30 # Give some time for the deployment to take effect.
- functional_tests/run_functional_tests.py ${SERVER_URL_PROD_HX}
### ----------------------------------------------------------------------------------------------------------------------
### Deployment to prod hh
### ----------------------------------------------------------------------------------------------------------------------
#prepare_config_prod_hh:
# stage: prepare_config_hh
# image:
# name: alpine/git
# entrypoint: ["/bin/sh", "-c"]
# only:
# - master
# except:
# - schedules
# script:
# - rm -rf ${CONFIGS_FOLDER} || true
# - mkdir -p ${CONFIGS_FOLDER}
# - git clone https://${CONFIG_DEPLOY_GITLAB_USERNAME}:${CONFIG_DEPLOY_GITLAB_TOKEN}@${CONFIGURATIONS_REPO} ${CONFIGS_FOLDER}
# - ls ${CONFIGS_FOLDER}
# artifacts:
# paths:
# - ${CONFIG_PROD_HH_FILE_PATH}
# - ${CONFIG_GUNICORN_PROD_HH_FILE_PATH}
# - ${INGRESS_PROD_HH_FILE_PATH}
# - ${AUTOSCALER_PROD_HH_FILE_PATH}
#
#deploy_to_prod_hh:
# stage: deploy_to_prod_hh
# image:
# name: lachlanevenson/k8s-kubectl:latest
# entrypoint: ["/bin/sh", "-c"]
# only:
# - master
# except:
# - schedules
# environment:
# name: prod_hh
# script:
# - set -x
# - echo "$KUBE_CA_PEM_HH" > "$(pwd)/kube.ca.pem"
# - kubectl config set-cluster ${KUBE_CLUS_NAME_HH} --server="${KUBE_URL_HH}" --certificate-authority="$(pwd)/kube.ca.pem"
# - kubectl config set-credentials ${KUBE_USER_HH} --token="${KUBE_TOKEN_HH}"
# - kubectl config set-context ${CHEMBL_NS_PROD} --cluster=${KUBE_CLUS_NAME_HH} --user=${KUBE_USER_HH}
# - kubectl config use-context ${CHEMBL_NS_PROD}
# - echo ${CHEMBL_NS_PROD} ${KUBE_URL_HH} ${KUBE_CLUS_NAME_HH} ${KUBE_USER_HH}
# - kubectl get pods -n ${CHEMBL_NS_PROD}
# - kubectl create secret generic ${RUN_CONFIG_SECRET_NAME_PROD_HH} --from-file=RUN_CONFIG.yml=${CONFIG_PROD_HH_FILE_PATH} -o yaml -n ${CHEMBL_NS_PROD} --dry-run=client | kubectl replace -f -
# - kubectl create secret generic ${GUNICORN_CONFIG_SECRET_NAME_PROD_HH} --from-file=GUNICORN_CONFIG.py=${CONFIG_GUNICORN_PROD_HH_FILE_PATH} -o yaml -n ${CHEMBL_NS_PROD} --dry-run=client | kubectl replace -f -
## ----------------------------------------------------------------------------------------------------------------------
## Deployment to prod hh
## ----------------------------------------------------------------------------------------------------------------------
prepare_config_prod_hh:
stage: prepare_config_hh
image:
name: alpine/git
entrypoint: ["/bin/sh", "-c"]
only:
- master
except:
- schedules
script:
- rm -rf ${CONFIGS_FOLDER} || true
- mkdir -p ${CONFIGS_FOLDER}
- git clone https://${CONFIG_DEPLOY_GITLAB_USERNAME}:${CONFIG_DEPLOY_GITLAB_TOKEN}@${CONFIGURATIONS_REPO} ${CONFIGS_FOLDER}
- ls ${CONFIGS_FOLDER}
artifacts:
paths:
- ${CONFIG_PROD_HH_FILE_PATH}
- ${CONFIG_GUNICORN_PROD_HH_FILE_PATH}
- ${INGRESS_PROD_HH_FILE_PATH}
- ${AUTOSCALER_PROD_HH_FILE_PATH}
deploy_to_prod_hh:
stage: deploy_to_prod_hh
image:
name: lachlanevenson/k8s-kubectl:latest
entrypoint: ["/bin/sh", "-c"]
only:
- master
except:
- schedules
environment:
name: prod_hh
script:
- set -x
- echo "$KUBE_CA_PEM_HH" > "$(pwd)/kube.ca.pem"
- kubectl config set-cluster ${KUBE_CLUS_NAME_HH} --server="${KUBE_URL_HH}" --certificate-authority="$(pwd)/kube.ca.pem"
- kubectl config set-credentials ${KUBE_USER_HH} --token="${KUBE_TOKEN_HH}"
- kubectl config set-context ${CHEMBL_NS_PROD} --cluster=${KUBE_CLUS_NAME_HH} --user=${KUBE_USER_HH}
- kubectl config use-context ${CHEMBL_NS_PROD}
- echo ${CHEMBL_NS_PROD} ${KUBE_URL_HH} ${KUBE_CLUS_NAME_HH} ${KUBE_USER_HH}
- kubectl get pods -n ${CHEMBL_NS_PROD}
- kubectl create secret generic ${RUN_CONFIG_SECRET_NAME_PROD_HH} --from-file=RUN_CONFIG.yml=${CONFIG_PROD_HH_FILE_PATH} -o yaml -n ${CHEMBL_NS_PROD} --dry-run=client | kubectl apply -f -
- kubectl create secret generic ${GUNICORN_CONFIG_SECRET_NAME_PROD_HH} --from-file=GUNICORN_CONFIG.py=${CONFIG_GUNICORN_PROD_HH_FILE_PATH} -o yaml -n ${CHEMBL_NS_PROD} --dry-run=client | kubectl apply -f -
# - cat ${CONFIG_PROD_HH_FILE_PATH}
# - cat ${CONFIG_GUNICORN_PROD_HH_FILE_PATH}
# - sed -i "s~<NAMESPACE>~${CHEMBL_NS_PROD}~" k8s-deployment.yaml
......
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