Skip to content
Snippets Groups Projects
Commit f2faf558 authored by Konstantinos Samaras-Tsakiris's avatar Konstantinos Samaras-Tsakiris
Browse files

Merge branch 'ci-test-improvements' into 'master'

CDD CI improvements

Closes webservices/webframeworks-planning#891

See merge request !99
parents 9f76ba11 1ad43c0c
Branches
Tags
1 merge request!99CDD CI improvements
Pipeline #3750646 passed
......@@ -102,12 +102,6 @@ test-clonesite-provision:
deprovision-test-resources:
stage: deprovision
# Manual if variable present
needs:
- environment
- build-sitebuilder
- test-newsite-provision
- test-clonesite-provision
image: gitlab-registry.cern.ch/paas-tools/openshift-client:4
script:
- ./.gitlab/ci/scripts/deprovision-test-resources.sh
......@@ -22,16 +22,15 @@
# Wait for clone pod to spawn
sleep 60s
max_attempts="16"
max_attempts="20"
attempt_num="0"
while [[ $(oc get drupalsite/$SITENAME -n $NAMESPACE -o json | jq -r '.status.conditions[] | select(.type=="Ready") | .status') != "True" ]]
do
if (( $attempt_num == $max_attempts ))
then
echo $(date -u +"%Y-%m-%dT%H:%M:%SZ")"-Sitename: ${SITENAME}, Timed out (10minutes) waiting for DrupalSite to be ready!"
echo $(date -u +"%Y-%m-%dT%H:%M:%SZ")"-Sitename: ${SITENAME}, Timed out (20minutes) waiting for DrupalSite to be ready!"
exit 0
else
#echo $(date -u +"%Y-%m-%dT%H:%M:%SZ")-"Sitename: ${SITENAME}, >> Waiting 10s for Drupalsite to be ready "
(( attempt_num++ ))
sleep 60s
fi
......@@ -40,7 +39,7 @@
# Warm up the website
curl --max-time 60 --silent --fail --insecure -IL "https://${FQDN}/" > /dev/null
curl --max-time 60 --silent --fail --insecure -IL "https://${FQDN}/user/login" > /dev/null
# Give another minute for SSO etc. to be properly running
# Give another 10 minutes for SSO etc. to be properly running
sleep 600
# Check if the base URL works
......
......@@ -5,11 +5,15 @@
# Ensure oc access
oc login -u ${SA_USER} -p ${SA_PASSWORD} --server=https://api.drupal.okd.cern.ch
# $NAMESPACE is defined on .gitlab-ci.yaml
# Create/ValidateProject
oc new-project $NAMESPACE --description="Project created by CI on Cern-drupal-distribution"
# NAMESPACE is provided by .gitlab-ci.yml, the namespace/project is expected to exist at this point
oc get project ${NAMESPACE} > /dev/null
if [[ "$?" != "0" ]]; then
echo "‼️ Project ${NAMESPACE} doesn't exist! Aborting...."
exit 1
fi
export CLONE_FROM=$(oc get drupalsite -l ci=true --no-headers -o custom-columns=name:.metadata.name)
export CLONE_FROM=$(oc get drupalsite -l ci-clone-source=true --no-headers -o custom-columns=name:.metadata.name)
# Validate we only get one website to clone from
if [[ $(echo $CLONE_FROM | wc -w ) != "1" ]]; then
echo "Error, expected 1 website to clone from, got $CLONE_FROM"
......@@ -38,5 +42,4 @@
fi
echo "✅ Website provisioned as expected!"
# We do not delete site, this is a step made after web tests
# Don't delete Project, as it might be used on othe CIs at the same time, just delete resources!
delete_site
......@@ -5,9 +5,12 @@
# Ensure oc access
oc login -u ${SA_USER} -p ${SA_PASSWORD} --server=https://api.drupal.okd.cern.ch
# $NAMESPACE is defined on .gitlab-ci.yaml
# Create/ValidateProject
oc new-project $NAMESPACE --description="Project created by CI on Cern-drupal-distribution"
# NAMESPACE is provided by .gitlab-ci.yml, the namespace/project is expected to exist at this point
oc get project ${NAMESPACE} > /dev/null
if [[ "$?" != "0" ]]; then
echo "‼️ Project ${NAMESPACE} doesn't exist! Aborting...."
exit 1
fi
# Variables to create new DrupalSite
get_tag
......@@ -41,4 +44,4 @@
echo "✅ Website provisioned as expected!"
delete_site
# Don't delete Project, as it might be used on othe CIs at the same time, just delete resources!
# Don't delete Project, as it might be used on other CIs at the same time, just delete resources!
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment