Skip to content

Commit

Permalink
R1 promotion updates (#137)
Browse files Browse the repository at this point in the history
* update comments for promoted deploys

* make run-tests.sh executable

Conflicts:
	prePromotion.sh

* Changes needed for stage promotion toolchain to publish image to
wh-common-rns

Conflicts:
	prePromotion.sh

* fix typo
  • Loading branch information
tabishop authored Jun 21, 2021
1 parent 157a5cd commit 7874590
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 2 deletions.
2 changes: 1 addition & 1 deletion chart/cohort/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ apiVersion: v1
appVersion: "1.0"
description: Quality Measure and Cohort Service
name: cohort
version: 0.1.0
version: 1.0.0
7 changes: 6 additions & 1 deletion pipeline.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#
# SPDX-License-Identifier: Apache-2.0
#
# If you are deploying from the wh-cohorting-deploy umbrella repo,
# you will need to update this value with the Insights id from your cluster
INSIGHTS:
ID: "9b253889-dee0-47f4-9ea0-402306239aaa"
CI:
Expand Down Expand Up @@ -36,12 +38,15 @@ CD:
# For a successful build to be promoted to Staging or Production, it is necessary to have an associated approved Service Now ticket.
# The SERVICENOW_SERVICENAME value should match the "Configuration item" as defined in the servicenow change request.
# See https://github.ibm.com/whc-toolchain/whc-commons/blob/2c9cfd2a3683dc5ba993d338f9fb0172165fb516/docs/launch/approval-gate.md
SERVICENOW_SERVICENAME: "wh-csp-core"
SERVICENOW_SERVICENAME: "offering-needs-to-change"
TILLERSERVICEACCOUNTDISABLE: "true"
HELM_TIMEOUT: "1800"
USESOURCE: "true"
USEHELMV3: "true"
# See note about FHIR_CLUSTER_NAMESPACE above
# These keys are used by our full FVT tests which require a fhir server with specific test data loaded
# If you are deploying from the wh-cohorting-deploy umbrella repo, the full fvt tests have been removed
# and the vault keys are not required when deploying from that repo
VAULT_KEYS_TO_INJECT: "FHIR_USER_PASSWORD,FHIR_TRUSTSTORE_PASSWD,FHIR_CLUSTER_NAMESPACE"
# added to allow mixed case branch names (toolchains fail on mixed case branch names without this set,
# could remove when we switch to using main branch
Expand Down
42 changes: 42 additions & 0 deletions prePromotion.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#Print commands and their arguments as they are executed.
set -x

function readd_tests(){
echo "./tests/run-tests.sh fvttest.xml" >>run-fvttests.sh
echo "./tests/run-tests.sh ivttest.xml" >>run-ivttests.sh
echo "./tests/run-tests.sh regtest.xml" >>run-regrtests.sh
}

if [ "$UMBRELLA_REPO_PATH" == "https://github.ibm.com/watson-health-cohorting/wh-cohorting-umbrella" ]; then
if [ -f ./application.version ]; then
APPLICATION_VERSION="$(cat application.version)"
else
echo "There is not an application.version file"
exit 1
fi

echo "Validating versions are updated in the appropriate files"
APP_NAME='cohort-services'
COMPONENTNAME='cohort'
PATH_TO_COMPONENT="${APP_NAME}/${COMPONENTNAME}"
CHART_VERSION=$(cat "$PATH_TO_COMPONENT/chart/cohort/Chart.yaml" | grep 'version:' | sed -E 's/^version: (.+)$/\1/g')
if [ "$APPLICATION_VERSION" != "$CHART_VERSION" ]; then
echo "The chart version '$CHART_VERSION' does not match the application version '$APPLICATION_VERSION' you are releasing. Please make sure you have updated the helm chart version and the application.version file to match."
exit 1
fi

echo "Removing all unnecessary files except for smoke tests"
rm -f README.md
# rm -f mkdocs.yml
echo "Make README for wh-cohorting-deploy"
echo "# wh-cohorting-deploy
This repo is to assist teams in deployment to both CDT and CSP. For more information on deployments, see [(https://github.com/Alvearie/quality-measure-and-cohort-service#readme) Github readme." >>README.md
cd ./$PATH_TO_COMPONENT/tests/
find . -not -name '*smoketest*' -not -name '*run-tests*' -not -name '*authenticate*' -not -path "./tests" -not -path "." >>remove_tests.txt
cat remove_tests.txt
xargs rm -rf <remove_tests.txt
readd_tests
chmod +x run-tests.sh
else
echo "This is not an Cohorting release for development. Moving on..."
fi
13 changes: 13 additions & 0 deletions tests/run-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# file used to create dummy tests for wh-cohorting-deploy umbrella repo so we don't run fvt tests during customer/staging/production deployments
# referenced from pre/postPromotion.sh scripts
output="<testcase classname=\"bash\" name=\"test1\" time=\"0\"/>"
date=`date`
header="<testsuite name=\"FVT tests\" tests=\"1\" failures=\"0\" errors=\"0\" skipped=\"0\" timestamp=\"${date}\" time=\"0\">"
footer="</testsuite>"

filename=$1
cat << EOF > $filename
$header
$output
$footer
EOF

0 comments on commit 7874590

Please sign in to comment.