Skip to content
This repository has been archived by the owner on May 6, 2021. It is now read-only.

Commit

Permalink
reDeploy the whole shebang on every merge,
Browse files Browse the repository at this point in the history
So we can have the latest installed on every merge.

This closes openshiftio/openshift.io#4602 and closes #127
  • Loading branch information
chmouel committed Nov 30, 2018
1 parent d0d4e99 commit 3e24b6f
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .cico/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ source .cico/setup.sh
setup

deploy

deploy_devcluster build
23 changes: 23 additions & 0 deletions .cico/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ function setup() {
ghprbGhRepository \
ghprbPullId \
GIT_COMMIT \
FABRIC8_DEVCLUSTER_TOKEN \
DEVSHIFT_TAG_LEN \
QUAY_USERNAME \
QUAY_PASSWORD \
Expand Down Expand Up @@ -116,6 +117,28 @@ function do_coverage() {
bash <(curl -s https://codecov.io/bash) -K -X search -f tmp/coverage.out -t 533b56c6-9fec-4ff2-9756-6aea46d46f2b
}

function download_latest_oc() {
pushd /bin >/dev/null && \
curl -s -L $(curl -L -s "https://api.github.com/repos/openshift/origin/releases/latest"|python -c "import sys, json;x=json.load(sys.stdin);print([ r['browser_download_url'] for r in x['assets'] if 'openshift-origin-client-tools' in r['name'] and 'linux-64bit' in r['name']][0])") -o /tmp/oc.tgz && \
tar xz -f/tmp/oc.tgz --wildcards "*/oc" --strip-components=1 && \
popd >/dev/null
}

function deploy_devcluster() {
project="${1}"

download_latest_oc || { yum install centos-release-openshift-origin && yum install origin-clients ;}

oc login --insecure-skip-tls-verify=true https://devtools-dev.ext.devshift.net:8443 --token=${FABRIC8_DEVCLUSTER_TOKEN}

exist=$(oc get project -o go-template='{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}'|grep "^${project}$" || true)
if [[ -z ${exist} ]];then
oc new-project ${project}
fi
oc project ${project}
bash ./openshift/deploy-openshift-dev.sh
}

function do_test() {
make test-unit
}
2 changes: 1 addition & 1 deletion openshift/deploy-openshift-dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function waitForDC() {
local max=60 # 2mn
local cnt=0

while [[ $(oc get dc/${DC} -o json | jq '.status.availableReplicas') < 1 ]];do
while [[ $(oc get dc/${DC} -o json|python -c "import sys, json;x=json.load(sys.stdin);print x['status']['availableReplicas']") < 1 ]];do
[[ ${cnt} > ${max} ]] && {
echo "Timing out while waiting for DC/${DC}";
exit 1
Expand Down

0 comments on commit 3e24b6f

Please sign in to comment.