Commit 78e0db99 authored by David Mendez's avatar David Mendez
Browse files

CI: finish to add stage to deploy to prod_hh

parent 0c3c5e60
......@@ -203,8 +203,6 @@ deploy_to_prod_hx:
- kubectl create secret generic ${GUNICORN_CONFIG_SECRET_NAME_PROD_HX} --from-file=GUNICORN_CONFIG.py=${CONFIG_GUNICORN_PROD_HX_FILE_PATH} -o yaml -n ${CHEMBL_NS_PROD} --dry-run=client | kubectl replace -f -
- sed -i "s~<NAMESPACE>~${CHEMBL_NS_PROD}~" k8s-deployment.yaml
- sed -i "s~<NUM_REPLICAS>~${NUM_REPLICAS_PROD_HX}~" k8s-deployment.yaml
- sed -i "s~<UID>~${CBL_ADM_UID}~" k8s-deployment.yaml
- sed -i "s~<GID>~${CBL_PUB_GID}~" k8s-deployment.yaml
- sed -i "s~<SERVER_IMAGE_TAG>~${SERVER_IMAGE_TAG}~" k8s-deployment.yaml
- sed -i "s~<RUN_CONFIG_SECRET_NAME>~${RUN_CONFIG_SECRET_NAME_PROD_HX}~" k8s-deployment.yaml
- sed -i "s~<GUNICORN_CONFIG_SECRET_NAME>~${GUNICORN_CONFIG_SECRET_NAME_PROD_HX}~" k8s-deployment.yaml
......@@ -263,68 +261,43 @@ deploy_to_prod_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 -
- exit 0
- 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 -
- cat ${CONFIG_PROD_HH_FILE_PATH}
- cat ${CONFIG_GUNICORN_PROD_HH_FILE_PATH}
- sed -i "s~<NAMESPACE>~${CHEMBL_NS_PROD}~" k8s-deployment.yaml
- sed -i "s~<NUM_REPLICAS>~${NUM_REPLICAS_PROD_HH}~" k8s-deployment.yaml
- sed -i "s~<UID>~${CBL_ADM_UID}~" k8s-deployment.yaml
- sed -i "s~<GID>~${CBL_PUB_GID}~" k8s-deployment.yaml
- sed -i "s~<SERVER_IMAGE_TAG>~${SERVER_IMAGE_TAG}~" k8s-deployment.yaml
- sed -i "s~<STATUS_DAEMON_IMAGE_TAG>~${STATUS_DAEMON_IMAGE_TAG}~" k8s-deployment.yaml
- sed -i "s~<NFS_MOUNT_PATH>~${NFS_MOUNT_PATH_PROD_HH}~" k8s-deployment.yaml
- sed -i "s~<NFS_FQDN>~${NFS_FQDN_HH}~" k8s-deployment.yaml
- sed -i "s~<NFS_PATH>~${NFS_PATH_HH}~" k8s-deployment.yaml
- sed -i "s~<ID_RSA_SECRET_NAME>~${ID_RSA_SECRET_NAME_PROD_HH}~" k8s-deployment.yaml
- sed -i "s~<RUN_CONFIG_SECRET_NAME>~${RUN_CONFIG_SECRET_NAME_PROD_HH}~" k8s-deployment.yaml
- sed -i "s~<GUNICORN_CONFIG_SECRET_NAME>~${GUNICORN_CONFIG_SECRET_NAME_PROD_HH}~" k8s-deployment.yaml
- cat k8s-deployment.yaml
- kubectl apply -n ${CHEMBL_NS_PROD} -f k8s-deployment.yaml
- kubectl get pods -n ${CHEMBL_NS_PROD}
#
#functional_tests_prod_hh:
# stage: test_prod_hh
# image:
# name: $SERVER_IMAGE_TAG
# entrypoint: [""]
# only:
# - master
# except:
# - schedules
# script:
# - set -x
# - sleep 30 # Give some time for the deployment to take effect.
# - functional_tests/run_functional_tests.py ${SERVER_URL_PROD_HH} ${DJ_SERVER_ADMIN_USERNAME_PROD_HH} ${DJ_SERVER_ADMIN_PASSWORD_PROD_HH}
#
## ----------------------------------------------------------------------------------------------------------------------
## Test prod public url
## ----------------------------------------------------------------------------------------------------------------------
#functional_tests_prod_public:
# stage: functional_tests_prod_public
# image:
# name: $SERVER_IMAGE_TAG
# entrypoint: [""]
# only:
# - master
# except:
# - schedules
# script:
# - set -x
# - sleep 30 # Give some time for the deployment to take effect.
# - functional_tests/run_functional_tests.py ${SERVER_URL_PROD_PUBLIC} ${DJ_SERVER_ADMIN_USERNAME_PROD_HX} ${DJ_SERVER_ADMIN_PASSWORD_PROD_PUBLIC}
#
## ----------------------------------------------------------------------------------------------------------------------
## Schedules
## ----------------------------------------------------------------------------------------------------------------------
#delete_expired_jobs:
# stage: schedules
# image: 'python:3.7'
# only:
# - schedules
# script:
# - set -x
# - pip install requests
# - admin_tasks/delete_expired_jobs.py ${SERVER_URL_STAGING} ${DJ_SERVER_ADMIN_USERNAME_STAGING} ${DJ_SERVER_ADMIN_PASSWORD_STAGING}
# - admin_tasks/delete_expired_jobs.py ${SERVER_URL_PROD_PUBLIC} ${DJ_SERVER_ADMIN_USERNAME_PROD_HX} ${DJ_SERVER_ADMIN_PASSWORD_PROD_PUBLIC}
\ No newline at end of file
functional_tests_prod_hh:
stage: test_prod_hh
image:
name: $SERVER_IMAGE_TAG
entrypoint: [""]
only:
- master
script:
- set -x
- exit 0
- sleep 30 # Give some time for the deployment to take effect.
- functional_tests/run_functional_tests.py ${SERVER_URL_PROD_HH} ${DJ_SERVER_ADMIN_USERNAME_PROD_HH} ${DJ_SERVER_ADMIN_PASSWORD_PROD_HH}
# ----------------------------------------------------------------------------------------------------------------------
# Test prod public url
# ----------------------------------------------------------------------------------------------------------------------
functional_tests_prod_public:
stage: functional_tests_prod_public
image:
name: $SERVER_IMAGE_TAG
entrypoint: [""]
only:
- master
script:
- set -x
- exit 0
- sleep 30 # Give some time for the deployment to take effect.
- functional_tests/run_functional_tests.py ${SERVER_URL_PROD_PUBLIC} ${DJ_SERVER_ADMIN_USERNAME_PROD_HX} ${DJ_SERVER_ADMIN_PASSWORD_PROD_PUBLIC}
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