Commit 83fba8b1 authored by sathyaseelan's avatar sathyaseelan

Include APP-DEPROVISION stage to gitlab ci

Signed-off-by: 's avatarsathyaseelan <sathyaseelan.n@cloudbyte.com>
parent da1859a0
......@@ -8,6 +8,7 @@ stages:
- STATEFUL-APP-DEPLOY
- APP-FUNC-TEST
- APP-CHAOS-TEST
- APP-DEPROVISION
- CLUSTER-CLEANUP
variables:
......@@ -40,6 +41,18 @@ openebs-packet-deploy:
paths:
- openebs-packet/
openebs-sc-deploy:
image: atulabhi/kops:v8
stage: PROVIDER-INFRA-SETUP
dependencies:
- packet-cluster
script:
- chmod 775 ./script/provider/setup-sc
- ./script/provider/setup-sc
artifacts:
paths:
- openebs-packet/
## Define a job template for app deployers
.app_deploy_template:
......@@ -156,6 +169,12 @@ jenkins-cstor-run/load/check:
script:
- ./script/apps/jenkins/deployer/jenkins-app-deploy-cstor
# PROMETHEUS-CSTOR
prometheus-cstor-run/load/check:
extends: .app_deploy_template
script:
- ./script/apps/prometheus/deployer/prometheus-app-deploy-cstor
## Define job template for func test jobs
.func_test_template:
......@@ -191,6 +210,12 @@ volume-memory-consumption-{memcheck-jiva}:
script:
- ./script/apps/memleak/tests/jiva/memory-consumption
volume-memory-consumption-{memcheck-cstor}:
extends: .func_test_template #dependencies: prometheus-cstor
script:
- chmod 775 ./script/apps/prometheus/functional/cstor/memcheck/memory-consumption
- ./script/apps/prometheus/functional/cstor/memcheck/memory-consumption
k8s-snapshot-clone-creation-{percona-jiva}:
extends: .func_test_template
script:
......@@ -241,6 +266,11 @@ app-kill-{jenkins-cstor}:
script:
- ./script/apps/jenkins/chaos/cstor/application-pod-failure
app-kill-{mongo-jiva-xfs}:
extends: .chaos_test_template #dependencies: mongo-jiva
script:
- ./script/apps/mongo/chaos/jiva/application-pod-failure
tgt-kill-{percona-cstor}:
extends: .chaos_test_template #dependencies: percona-cstor
script:
......@@ -251,6 +281,51 @@ tgt-disconnect-{mongo-cstor}:
script:
- ./script/apps/mongo/chaos/cstor/volume-target-network-delay
.app_deprovision_template:
image: atulabhi/kops:v8
stage: APP-DEPROVISION
dependencies:
- openebs-packet-deploy
artifacts:
paths:
- openebs-packet/
## PERCONA-JIVA
percona-jiva-deprovision:
extends: .app_deprovision_template
script:
- ./script/apps/percona/deprovision/percona-app-deprovision-jiva
## PROMETHEUS-CSTOR
prometheus-cstor-deprovision:
extends: .app_deprovision_template
script:
- ./script/apps/prometheus/deprovision/prometheus-app-deprovision-cstor
## MONGODB-JIVA
mongodb-jiva-deprovision:
extends: .app_deprovision_template
script:
- ./script/apps/mongo/deprovision/mongo-app-deprovision-jiva
## POSTGRES-JIVA
postgres-jiva-deprovision:
extends: .app_deprovision_template
script:
- ./script/apps/postgres/deprovision/postgres-app-deprovision-jiva
## JENKINS-JIVA
jenkins-jiva-deprovision:
extends: .app_deprovision_template
script:
- ./script/apps/jenkins/deprovision/jenkins-app-deprovision-jiva
## CASSANDRA-JIVA
cassandra-jiva-deprovision:
extends: .app_deprovision_template
script:
- ./script/apps/cassandra/deprovision/cassandra-app-deprovision-jiva
cleanup-packet:
when: always
image: chandankumar4/packet:v4
......
#!/bin/bash
set -x
#################
## ENVIRONMENT ##
#################
## https://github.com/openebs/litmus/blob/master/apps/cassandra/deployers/test_vars.yml
run_id="deprovision";test_name=$(${utils_path}/generate_test_name testcase=cassandra-deployment metadata=${run_id})
###################
## DEPENDENCIES ##
###################
${utils_path}/setup_dependencies litmus-test
## Clone the litmus repo, navigate to litmus root
git clone https://github.com/openebs/litmus.git
cd litmus
############################
## LITMUS PRECONDITIONING ##
############################
## TODO: Better way/logic to replace job ENV (SC, PVC, LABEL, NS) based on run instance intent (CLI)
## TODO: Add logic to add ENV for run_instance_metadata/RunID
: << EOF
------------------------------------------------------------------------------------
| specAttribute | kind | jiva | cStor-sparse |
------------------------------------------------------------------------------------
| litmusJobLabel | jobSpec | cassandra-deployment | cassandra-deployment-cstor |
| providerStorageClass | env | openebs-standard | openebs-cstor-sparse |
| appNamespace | env | app-cass-ns | cassandra-cstor |
| runID | env(add) | deprovision | cstor
------------------------------------------------------------------------------------
EOF
cp apps/cassandra/deployers/run_litmus_test.yml run_test.yml
sed -i -e 's/app: cassandra-deployment-litmus/app: cassandra-deprovision-litmus/g' \
-e 's/value: provision/value: deprovision/g' run_test.yml
sed -i '/command:/i \
- name: RUN_ID\
value: '"$run_id"'\
' run_test.yml
#################
## RUNNER MAIN ##
#################
echo "Running the litmus test.."
${utils_path}/litmus_job_runner label='app:cassandra-deprovision-litmus' job=run_test.yml
${utils_path}/task_delimiter;
echo "Dumping state of cluster post job run"; echo ""
${utils_path}/dump_cluster_state;
${utils_path}/task_delimiter;
#################
## GET RESULT ##
#################
## Check the test status & result from the litmus result custom resource
${utils_path}/get_litmus_result ${test_name}
#!/bin/bash
set -x
#################
## ENVIRONMENT ##
#################
## https://github.com/openebs/litmus/blob/master/apps/jenkins/deployers/test_vars.yml
run_id="deprovision";test_name=$(${utils_path}/generate_test_name testcase=jenkins-deployment metadata=${run_id})
###################
## DEPENDENCIES ##
###################
${utils_path}/setup_dependencies litmus-test
## Clone the litmus repo, navigate to litmus root
git clone https://github.com/openebs/litmus.git
cd litmus
############################
## LITMUS PRECONDITIONING ##
############################
## TODO: Better way/logic to replace job ENV (SC, PVC, LABEL, NS) based on run instance intent (CLI)
## TODO: Add logic to add ENV for run_instance_metadata/RunID
: << EOF
------------------------------------------------------------------------------------
| specAttribute | kind | jiva | cStor-sparse |
------------------------------------------------------------------------------------
| litmusJobLabel | jobSpec | jenkins-deployment | jenkins-deployment-cstor |
| providerStorageClass | env | openebs-standard | openebs-cstor-sparse |
| appNamespace | env | app-jenkins-ns | jenkins-cstor |
| runID | env(add) | deprovision | cstor-deprovision
------------------------------------------------------------------------------------
EOF
cp apps/jenkins/deployers/run_litmus_test.yml run_test.yml
sed -i -e 's/app: jenkins-deployment-litmus/app: jenkins-deprovision/g' \
-e 's/value: provision/value: deprovision/g' run_test.yml
sed -i '/command:/i \
- name: RUN_ID\
value: '"$run_id"'\
' run_test.yml
#################
## RUNNER MAIN ##
#################
echo "Running the litmus test.."
${utils_path}/litmus_job_runner label='app:jenkins-deprovision' job=run_test.yml
${utils_path}/task_delimiter;
echo "Dumping state of cluster post job run"; echo ""
${utils_path}/dump_cluster_state;
${utils_path}/task_delimiter;
#################
## GET RESULT ##
#################
## Check the test status & result from the litmus result custom resource
${utils_path}/get_litmus_result ${test_name}
#!/bin/bash
set -x
#################
## ENVIRONMENT ##
#################
## https://github.com/openebs/litmus/blob/master/apps/percona/chaos/openebs_target_failure/test_vars.yml
run_id="cstor";test_name=$(${utils_path}/generate_test_name testcase=application-pod-failure metadata=${run_id})
###################
## DEPENDENCIES ##
###################
${utils_path}/setup_dependencies litmus-test
## Clone the litmus repo, navigate to litmus root
git clone https://github.com/openebs/litmus.git
cd litmus
############################
## LITMUS PRECONDITIONING ##
############################
## TODO: Add logic to replace job ENV (SC, PVC, LABEL, NS) based on run instance intent
## TODO: Add logic to add ENV for run_instance_metadata/RunID
: << EOF
----------------------------------------------------------------------------------------
| specAttribute | kind | jiva | cStor-sparse |
---------------------------------------------------------------------------------------- |
| litmusJobLabel | jobSpec | openebs-target-failure | application-pod-failure-cstor |
| appNamespace | env | app-jenkins-ns | jenkins-cstor |
| runID | env(add) | - | cstor |
----------------------------------------------------------------------------------------
EOF
cp apps/jenkins/chaos/app_pod_failure/run_litmus_test.yml run_test.yml
sed -i -e 's/name: application-pod-failure/name: application-pod-failure-cstor/g' \
-e 's/value: app-jenkins-ns/value: jenkins-cstor/g' run_test.yml
sed -i '/command:/i \
- name: RUN_ID\
value: '"$run_id"'\
' run_test.yml
#################
## RUNNER MAIN ##
#################
echo "Running the litmus test.."
${utils_path}/litmus_job_runner label='name:application-pod-failure-cstor' job=run_test.yml
${utils_path}/task_delimiter;
echo "Dumping state of cluster post job run"; echo ""
${utils_path}/dump_cluster_state;
${utils_path}/task_delimiter;
#################
## GET RESULT ##
#################
## Check the test status & result from the litmus result custom resource
${utils_path}/get_litmus_result ${test_name}
#!/bin/bash
set -x
#################
## ENVIRONMENT ##
#################
## https://github.com/openebs/litmus/blob/master/apps/percona/chaos/openebs-replica-network-delay/test_vars.yml
test_name=$(${utils_path}/generate_test_name testcase=openebs-replica-network-delay metadata="")
###################
## DEPENDENCIES ##
###################
${utils_path}/setup_dependencies litmus-test
## Clone the litmus repo, navigate to litmus root
git clone https://github.com/openebs/litmus.git
cd litmus
############################
## LITMUS PRECONDITIONING ##
############################
: << EOF
----------------------------------------------------------------------------------
| specAttribute | kind | percona | jenkins |
----------------------------------------------------------------------------------|
| appLabel | env | name=percona | app=jenkins-app |
| pvcName | env | percona-mysql-claim | jenkins-claim |
| appNamespace | env | app-percona-ns | app-jenkins-ns |
----------------------------------------------------------------------------------
EOF
cp apps/percona/chaos/openebs_replica_network_delay/run_litmus_test.yml run_test.yml
sed -i -e 's/''name=percona''/''app=jenkins-app''/g' \
-e 's/value: app-percona-ns/value: app-jenkins-ns/g' \
-e 's/value: percona-mysql-claim/value: jenkins-claim/g' run_test.yml
#################
## RUNNER MAIN ##
#################
echo "Running the litmus test.."
${utils_path}/litmus_job_runner label='name:openebs-replica-network' job=run_test.yml
${utils_path}/task_delimiter;
echo "Dumping state of cluster post job run"; echo ""
${utils_path}/dump_cluster_state;
${utils_path}/task_delimiter;
#################
## GET RESULT ##
#################
## Check the test status & result from the litmus result custom resource
${utils_path}/get_litmus_result ${test_name}
#!/bin/bash
set -x
#################
## ENVIRONMENT ##
#################
## https://github.com/openebs/litmus/blob/master/apps/percona/deployers/test_vars.yml
run_id="cstor";test_name=$(${utils_path}/generate_test_name testcase=jenkins-deployment metadata=${run_id})
###################
## DEPENDENCIES ##
###################
${utils_path}/setup_dependencies litmus-test
## Clone the litmus repo, navigate to litmus root
git clone https://github.com/openebs/litmus.git
cd litmus
############################
## LITMUS PRECONDITIONING ##
############################
## TODO: Better way/logic to replace job ENV (SC, PVC, LABEL, NS) based on run instance intent (CLI)
## TODO: Add logic to add ENV for run_instance_metadata/RunID
: << EOF
------------------------------------------------------------------------------------
| specAttribute | kind | jiva | cStor-sparse |
------------------------------------------------------------------------------------
| litmusJobLabel | jobSpec | percona-deployment | percona-deployment-cstor |
| providerStorageClass | env | openebs-standard | openebs-cstor-sparse |
| appNamespace | env | app-percona-ns | percona-cstor |
| runID | env(add) | - | cstor
------------------------------------------------------------------------------------
EOF
cp apps/jenkins/deployers/run_litmus_test.yml run_test.yml
sed -i -e 's/app: jenkins-deployment-litmus/app: jenkins-deployment-cstor/g' \
-e 's/value: openebs-standard/value: openebs-cstor-sparse/g' \
-e 's/value: app-jenkins-ns/value: jenkins-cstor/g' run_test.yml
sed -i '/command:/i \
- name: RUN_ID\
value: '"$run_id"'\
' run_test.yml
#################
## RUNNER MAIN ##
#################
echo "Running the litmus test.."
${utils_path}/litmus_job_runner label='app:jenkins-deployment-cstor' job=run_test.yml
${utils_path}/task_delimiter;
echo "Dumping state of cluster post job run"; echo ""
${utils_path}/dump_cluster_state;
${utils_path}/task_delimiter;
#################
## GET RESULT ##
#################
## Check the test status & result from the litmus result custom resource
${utils_path}/get_litmus_result ${test_name}
#!/bin/bash
set -x
#################
## ENVIRONMENT ##
#################
## https://github.com/openebs/litmus/blob/master/apps/jenkins/deployers/test_vars.yml
test_name=$(${utils_path}/generate_test_name testcase=jenkins-deployment metadata="")
###################
## DEPENDENCIES ##
###################
${utils_path}/setup_dependencies litmus-test
## Clone the litmus repo, navigate to litmus root
git clone https://github.com/openebs/litmus.git
cd litmus
############################
## LITMUS PRECONDITIONING ##
############################
cp apps/jenkins/deployers/run_litmus_test.yml run_test.yml
#################
## RUNNER MAIN ##
#################
echo "Running the litmus test.."
${utils_path}/litmus_job_runner label='app:jenkins-deployment-litmus' job=run_test.yml
${utils_path}/task_delimiter;
echo "Dumping state of cluster post job run"; echo ""
${utils_path}/dump_cluster_state;
${utils_path}/task_delimiter;
#################
## GET RESULT ##
#################
## Check the test status & result from the litmus result custom resource
${utils_path}/get_litmus_result ${test_name}
#!/bin/bash
set -x
#################
## ENVIRONMENT ##
#################
## https://github.com/openebs/litmus/blob/master/apps/percona/chaos/openebs_target_failure/test_vars.yml
run_id="cstor";test_name=$(${utils_path}/generate_test_name testcase=application-pod-failure metadata=${run_id})
###################
## DEPENDENCIES ##
###################
${utils_path}/setup_dependencies litmus-test
## Clone the litmus repo, navigate to litmus root
git clone https://github.com/openebs/litmus.git
cd litmus
############################
## LITMUS PRECONDITIONING ##
############################
## TODO: Add logic to replace job ENV (SC, PVC, LABEL, NS) based on run instance intent
## TODO: Add logic to add ENV for run_instance_metadata/RunID
: << EOF
----------------------------------------------------------------------------------------
| specAttribute | kind | jiva | cStor-sparse |
---------------------------------------------------------------------------------------- |
| litmusJobLabel | jobSpec | openebs-target-failure | application-pod-failure-cstor |
| appNamespace | env | app-jenkins-ns | jenkins-cstor |
| runID | env(add) | - | cstor |
----------------------------------------------------------------------------------------
EOF
cp apps/jenkins/chaos/app_pod_failure/run_litmus_test.yml run_test.yml
sed -i -e 's/name: application-pod-failure/name: application-pod-failure-cstor/g' \
-e 's/value: app-jenkins-ns/value: jenkins-cstor/g' run_test.yml
sed -i '/command:/i \
- name: RUN_ID\
value: '"$run_id"'\
' run_test.yml
#################
## RUNNER MAIN ##
#################
echo "Running the litmus test.."
${utils_path}/litmus_job_runner label='name:application-pod-failure-cstor' job=run_test.yml
${utils_path}/task_delimiter;
echo "Dumping state of cluster post job run"; echo ""
${utils_path}/dump_cluster_state;
${utils_path}/task_delimiter;
#################
## GET RESULT ##
#################
## Check the test status & result from the litmus result custom resource
${utils_path}/get_litmus_result ${test_name}
#!/bin/bash
set -x
#################
## ENVIRONMENT ##
#################
## https://github.com/openebs/litmus/blob/master/apps/percona/chaos/openebs-replica-network-delay/test_vars.yml
test_name=$(${utils_path}/generate_test_name testcase=openebs-replica-network-delay metadata="")
###################
## DEPENDENCIES ##
###################
${utils_path}/setup_dependencies litmus-test
## Clone the litmus repo, navigate to litmus root
git clone https://github.com/openebs/litmus.git
cd litmus
############################
## LITMUS PRECONDITIONING ##
############################
: << EOF
----------------------------------------------------------------------------------
| specAttribute | kind | percona | jenkins |
----------------------------------------------------------------------------------|
| appLabel | env | name=percona | app=jenkins-app |
| pvcName | env | percona-mysql-claim | jenkins-claim |
| appNamespace | env | app-percona-ns | app-jenkins-ns |
----------------------------------------------------------------------------------
EOF
cp apps/percona/chaos/openebs_replica_network_delay/run_litmus_test.yml run_test.yml
sed -i -e 's/''name=percona''/''app=jenkins-app''/g' \
-e 's/value: app-percona-ns/value: app-jenkins-ns/g' \
-e 's/value: percona-mysql-claim/value: jenkins-claim/g' run_test.yml
#################
## RUNNER MAIN ##
#################
echo "Running the litmus test.."
${utils_path}/litmus_job_runner label='name:openebs-replica-network' job=run_test.yml
${utils_path}/task_delimiter;
echo "Dumping state of cluster post job run"; echo ""
${utils_path}/dump_cluster_state;
${utils_path}/task_delimiter;
#################
## GET RESULT ##
#################
## Check the test status & result from the litmus result custom resource
${utils_path}/get_litmus_result ${test_name}
#!/bin/bash
set -x
#################
## ENVIRONMENT ##
#################
## https://github.com/openebs/litmus/blob/master/apps/percona/deployers/test_vars.yml
run_id="cstor";test_name=$(${utils_path}/generate_test_name testcase=jenkins-deployment metadata=${run_id})
###################
## DEPENDENCIES ##
###################
${utils_path}/setup_dependencies litmus-test
## Clone the litmus repo, navigate to litmus root
git clone https://github.com/openebs/litmus.git
cd litmus
############################
## LITMUS PRECONDITIONING ##
############################
## TODO: Better way/logic to replace job ENV (SC, PVC, LABEL, NS) based on run instance intent (CLI)
## TODO: Add logic to add ENV for run_instance_metadata/RunID
: << EOF
------------------------------------------------------------------------------------
| specAttribute | kind | jiva | cStor-sparse |
------------------------------------------------------------------------------------
| litmusJobLabel | jobSpec | percona-deployment | percona-deployment-cstor |
| providerStorageClass | env | openebs-standard | openebs-cstor-sparse |
| appNamespace | env | app-percona-ns | percona-cstor |
| runID | env(add) | - | cstor
------------------------------------------------------------------------------------
EOF
cp apps/jenkins/deployers/run_litmus_test.yml run_test.yml
sed -i -e 's/app: jenkins-deployment-litmus/app: jenkins-deployment-cstor/g' \
-e 's/value: openebs-standard/value: openebs-cstor-sparse/g' \
-e 's/value: app-jenkins-ns/value: jenkins-cstor/g' run_test.yml
sed -i '/command:/i \
- name: RUN_ID\
value: '"$run_id"'\
' run_test.yml
#################
## RUNNER MAIN ##
#################
echo "Running the litmus test.."
${utils_path}/litmus_job_runner label='app:jenkins-deployment-cstor' job=run_test.yml
${utils_path}/task_delimiter;
echo "Dumping state of cluster post job run"; echo ""
${utils_path}/dump_cluster_state;
${utils_path}/task_delimiter;
#################
## GET RESULT ##
#################
## Check the test status & result from the litmus result custom resource
${utils_path}/get_litmus_result ${test_name}
#!/bin/bash
set -x
#################
## ENVIRONMENT ##
#################
## https://github.com/openebs/litmus/blob/master/apps/jenkins/deployers/test_vars.yml
test_name=$(${utils_path}/generate_test_name testcase=jenkins-deployment metadata="")
###################
## DEPENDENCIES ##
###################
${utils_path}/setup_dependencies litmus-test
## Clone the litmus repo, navigate to litmus root
git clone https://github.com/openebs/litmus.git
cd litmus
############################
## LITMUS PRECONDITIONING ##
############################
cp apps/jenkins/deployers/run_litmus_test.yml run_test.yml