Commit 845576bf authored by David Mendez's avatar David Mendez
Browse files

Revert "Try a DAG for the CI"

This reverts commit b5c5adda.
parent b5c5adda
...@@ -35,18 +35,15 @@ stages: ...@@ -35,18 +35,15 @@ stages:
- build - build
- prepare_config_tests - prepare_config_tests
- test_and_qa - test_and_qa
- prepare_config_staging
- deploy_to_staging - deploy_to_staging
- deploy_to_prod_hx - test_staging
# - prepare_config_staging
# - deploy_to_staging
# - test_staging
# - prepare_config_hx # - prepare_config_hx
# - deploy_to_prod_hx # - deploy_to_prod_hx
# - test_prod_hx # - test_prod_hx
# - prepare_config_hh - prepare_config_hh
# - deploy_to_prod_hh
# - test_prod_hh
- deploy_to_prod_hh - deploy_to_prod_hh
- test_prod_hh
- functional_tests_prod_public - functional_tests_prod_public
- schedules - schedules
...@@ -138,7 +135,7 @@ unit_tests: ...@@ -138,7 +135,7 @@ unit_tests:
# Deployment to staging # Deployment to staging
# ---------------------------------------------------------------------------------------------------------------------- # ----------------------------------------------------------------------------------------------------------------------
prepare_config_staging: prepare_config_staging:
stage: deploy_to_staging stage: prepare_config_staging
image: image:
name: alpine/git name: alpine/git
entrypoint: ["/bin/sh", "-c"] entrypoint: ["/bin/sh", "-c"]
...@@ -160,7 +157,6 @@ prepare_config_staging: ...@@ -160,7 +157,6 @@ prepare_config_staging:
deploy_to_staging: deploy_to_staging:
stage: deploy_to_staging stage: deploy_to_staging
needs: ['prepare_config_staging']
image: image:
name: lachlanevenson/k8s-kubectl:latest name: lachlanevenson/k8s-kubectl:latest
entrypoint: ["/bin/sh", "-c"] entrypoint: ["/bin/sh", "-c"]
...@@ -212,8 +208,7 @@ deploy_to_staging: ...@@ -212,8 +208,7 @@ deploy_to_staging:
# Test staging # Test staging
# ---------------------------------------------------------------------------------------------------------------------- # ----------------------------------------------------------------------------------------------------------------------
functional_tests: functional_tests:
stage: deploy_to_staging stage: test_staging
needs: ['deploy_to_staging']
image: image:
name: $SERVER_IMAGE_TAG name: $SERVER_IMAGE_TAG
entrypoint: [""] entrypoint: [""]
...@@ -232,89 +227,87 @@ functional_tests: ...@@ -232,89 +227,87 @@ functional_tests:
# ---------------------------------------------------------------------------------------------------------------------- # ----------------------------------------------------------------------------------------------------------------------
# Deployment to prod hx # Deployment to prod hx
# ---------------------------------------------------------------------------------------------------------------------- # ----------------------------------------------------------------------------------------------------------------------
prepare_config_prod_hx: #prepare_config_prod_hx:
stage: deploy_to_prod_hx # stage: prepare_config_hx
image: # image:
name: alpine/git # name: alpine/git
entrypoint: ["/bin/sh", "-c"] # entrypoint: ["/bin/sh", "-c"]
only: # only:
- master # - master
except: # except:
- schedules # - schedules
script: # script:
- rm -rf ${CONFIGS_FOLDER} || true # - rm -rf ${CONFIGS_FOLDER} || true
- mkdir -p ${CONFIGS_FOLDER} # - mkdir -p ${CONFIGS_FOLDER}
- git clone https://${CONFIG_DEPLOY_GITLAB_USERNAME}:${CONFIG_DEPLOY_GITLAB_TOKEN}@${CONFIGURATIONS_REPO} ${CONFIGS_FOLDER} # - git clone https://${CONFIG_DEPLOY_GITLAB_USERNAME}:${CONFIG_DEPLOY_GITLAB_TOKEN}@${CONFIGURATIONS_REPO} ${CONFIGS_FOLDER}
artifacts: # artifacts:
paths: # paths:
- ${CONFIG_PROD_HX_FILE_PATH} # - ${CONFIG_PROD_HX_FILE_PATH}
- ${CONFIG_GUNICORN_PROD_HX_FILE_PATH} # - ${CONFIG_GUNICORN_PROD_HX_FILE_PATH}
- ${INGRESS_PROD_HX_FILE_PATH} # - ${INGRESS_PROD_HX_FILE_PATH}
- ${AUTOSCALER_PROD_HX_FILE_PATH} # - ${AUTOSCALER_PROD_HX_FILE_PATH}
#
deploy_to_prod_hx: #deploy_to_prod_hx:
stage: deploy_to_prod_hx # stage: deploy_to_prod_hx
needs: ['prepare_config_prod_hx'] # image:
image: # name: lachlanevenson/k8s-kubectl:latest
name: lachlanevenson/k8s-kubectl:latest # entrypoint: ["/bin/sh", "-c"]
entrypoint: ["/bin/sh", "-c"] # only:
only: # - master
- master # except:
except: # - schedules
- schedules # environment:
environment: # name: prod_hx
name: prod_hx # script:
script: # - set -x
- set -x # - echo "$KUBE_CA_PEM_HX" > "$(pwd)/kube.ca.pem"
- echo "$KUBE_CA_PEM_HX" > "$(pwd)/kube.ca.pem" # - kubectl config set-cluster ${KUBE_CLUS_NAME_HX} --server="${KUBE_URL_HX}" --certificate-authority="$(pwd)/kube.ca.pem"
- kubectl config set-cluster ${KUBE_CLUS_NAME_HX} --server="${KUBE_URL_HX}" --certificate-authority="$(pwd)/kube.ca.pem" # - 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 ${CHEMBL_NS_PROD} --cluster=${KUBE_CLUS_NAME_HX} --user=${KUBE_USER_HX}
- kubectl config set-context ${CHEMBL_NS_PROD} --cluster=${KUBE_CLUS_NAME_HX} --user=${KUBE_USER_HX} # - kubectl config use-context ${CHEMBL_NS_PROD}
- kubectl config use-context ${CHEMBL_NS_PROD} # - echo ${CHEMBL_NS_PROD} ${KUBE_URL_HX} ${KUBE_CLUS_NAME_HX} ${KUBE_USER_HX}
- echo ${CHEMBL_NS_PROD} ${KUBE_URL_HX} ${KUBE_CLUS_NAME_HX} ${KUBE_USER_HX} # - kubectl get pods -n ${CHEMBL_NS_PROD}
- kubectl get pods -n ${CHEMBL_NS_PROD} # - kubectl create secret generic ${ID_RSA_SECRET_NAME_PROD_HX} --from-file=ID_RSA_LSF=${ID_RSA_LSF_HX} -o yaml -n ${CHEMBL_NS_PROD} --dry-run | kubectl replace -f -
- kubectl create secret generic ${ID_RSA_SECRET_NAME_PROD_HX} --from-file=ID_RSA_LSF=${ID_RSA_LSF_HX} -o yaml -n ${CHEMBL_NS_PROD} --dry-run | kubectl replace -f - # - kubectl create secret generic ${RUN_CONFIG_SECRET_NAME_PROD_HX} --from-file=RUN_CONFIG.yml=${CONFIG_PROD_HX_FILE_PATH} -o yaml -n ${CHEMBL_NS_PROD} --dry-run | kubectl replace -f -
- kubectl create secret generic ${RUN_CONFIG_SECRET_NAME_PROD_HX} --from-file=RUN_CONFIG.yml=${CONFIG_PROD_HX_FILE_PATH} -o yaml -n ${CHEMBL_NS_PROD} --dry-run | kubectl replace -f - # - 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 | kubectl replace -f -
- 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 | kubectl replace -f - # - cat ${CONFIG_PROD_HX_FILE_PATH}
- cat ${CONFIG_PROD_HX_FILE_PATH} # - cat ${CONFIG_GUNICORN_PROD_HX_FILE_PATH}
- cat ${CONFIG_GUNICORN_PROD_HX_FILE_PATH} # - sed -i "s~<NAMESPACE>~${CHEMBL_NS_PROD}~" k8s-deployment.yaml
- 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~<NUM_REPLICAS>~${NUM_REPLICAS_PROD_HX}~" k8s-deployment.yaml # - sed -i "s~<CPU_LIMIT>~${CPU_LIMIT_PROD_HX}~" k8s-deployment.yaml
- sed -i "s~<CPU_LIMIT>~${CPU_LIMIT_PROD_HX}~" k8s-deployment.yaml # - sed -i "s~<CPU_REQUESTED>~${CPU_REQUESTED_PROD_HX}~" k8s-deployment.yaml
- sed -i "s~<CPU_REQUESTED>~${CPU_REQUESTED_PROD_HX}~" k8s-deployment.yaml # - sed -i "s~<UID>~${CBL_ADM_UID}~" 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~<GID>~${CBL_PUB_GID}~" k8s-deployment.yaml # - sed -i "s~<SERVER_IMAGE_TAG>~${SERVER_IMAGE_TAG}~" 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~<STATUS_DAEMON_IMAGE_TAG>~${STATUS_DAEMON_IMAGE_TAG}~" k8s-deployment.yaml # - sed -i "s~<NFS_MOUNT_PATH>~${NFS_MOUNT_PATH_PROD_HX}~" k8s-deployment.yaml
- sed -i "s~<NFS_MOUNT_PATH>~${NFS_MOUNT_PATH_PROD_HX}~" k8s-deployment.yaml # - sed -i "s~<NFS_FQDN>~${NFS_FQDN_HX}~" k8s-deployment.yaml
- sed -i "s~<NFS_FQDN>~${NFS_FQDN_HX}~" k8s-deployment.yaml # - sed -i "s~<NFS_PATH>~${NFS_PATH_HX}~" k8s-deployment.yaml
- sed -i "s~<NFS_PATH>~${NFS_PATH_HX}~" k8s-deployment.yaml # - sed -i "s~<ID_RSA_SECRET_NAME>~${ID_RSA_SECRET_NAME_PROD_HX}~" k8s-deployment.yaml
- sed -i "s~<ID_RSA_SECRET_NAME>~${ID_RSA_SECRET_NAME_PROD_HX}~" k8s-deployment.yaml # - sed -i "s~<RUN_CONFIG_SECRET_NAME>~${RUN_CONFIG_SECRET_NAME_PROD_HX}~" 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
- sed -i "s~<GUNICORN_CONFIG_SECRET_NAME>~${GUNICORN_CONFIG_SECRET_NAME_PROD_HX}~" k8s-deployment.yaml # - cat k8s-deployment.yaml
- cat k8s-deployment.yaml # - kubectl apply -n ${CHEMBL_NS_PROD} -f k8s-deployment.yaml
- kubectl apply -n ${CHEMBL_NS_PROD} -f k8s-deployment.yaml # - kubectl get pods -n ${CHEMBL_NS_PROD}
- kubectl get pods -n ${CHEMBL_NS_PROD} # - cat ${INGRESS_PROD_HX_FILE_PATH}
- cat ${INGRESS_PROD_HX_FILE_PATH} # - kubectl apply -n ${CHEMBL_NS_PROD} -f ${INGRESS_PROD_HX_FILE_PATH}
- kubectl apply -n ${CHEMBL_NS_PROD} -f ${INGRESS_PROD_HX_FILE_PATH} # - kubectl describe ingress -n ${CHEMBL_NS_PROD}
- kubectl describe ingress -n ${CHEMBL_NS_PROD} # - cat ${AUTOSCALER_PROD_HX_FILE_PATH}
- cat ${AUTOSCALER_PROD_HX_FILE_PATH} # - kubectl apply -n ${CHEMBL_NS_PROD} -f ${AUTOSCALER_PROD_HX_FILE_PATH}
- kubectl apply -n ${CHEMBL_NS_PROD} -f ${AUTOSCALER_PROD_HX_FILE_PATH} #
#functional_tests_prod_hx:
functional_tests_prod_hx: # stage: test_prod_hx
stage: deploy_to_prod_hx # image:
needs: ['deploy_to_prod_hx'] # name: $SERVER_IMAGE_TAG
image: # entrypoint: [""]
name: $SERVER_IMAGE_TAG # only:
entrypoint: [""] # - master
only: # except:
- master # - schedules
except: # script:
- schedules # - set -x
script: # - sleep 30 # Give some time for the deployment to take effect.
- set -x # - functional_tests/run_functional_tests.py ${SERVER_URL_PROD_HX} ${DJ_SERVER_ADMIN_USERNAME_PROD_HX} ${DJ_SERVER_ADMIN_PASSWORD_PROD_HX}
- sleep 30 # Give some time for the deployment to take effect.
- functional_tests/run_functional_tests.py ${SERVER_URL_PROD_HX} ${DJ_SERVER_ADMIN_USERNAME_PROD_HX} ${DJ_SERVER_ADMIN_PASSWORD_PROD_HX}
# ---------------------------------------------------------------------------------------------------------------------- # ----------------------------------------------------------------------------------------------------------------------
# Deployment to prod hh # Deployment to prod hh
...@@ -341,7 +334,6 @@ prepare_config_prod_hh: ...@@ -341,7 +334,6 @@ prepare_config_prod_hh:
deploy_to_prod_hh: deploy_to_prod_hh:
stage: deploy_to_prod_hh stage: deploy_to_prod_hh
needs: ['prepare_config_prod_hh']
image: image:
name: lachlanevenson/k8s-kubectl:latest name: lachlanevenson/k8s-kubectl:latest
entrypoint: ["/bin/sh", "-c"] entrypoint: ["/bin/sh", "-c"]
...@@ -390,7 +382,6 @@ deploy_to_prod_hh: ...@@ -390,7 +382,6 @@ deploy_to_prod_hh:
functional_tests_prod_hh: functional_tests_prod_hh:
stage: test_prod_hh stage: test_prod_hh
needs: ['deploy_to_prod_hh']
image: image:
name: $SERVER_IMAGE_TAG name: $SERVER_IMAGE_TAG
entrypoint: [""] entrypoint: [""]
......
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