diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index 0ad66bf..0000000 --- a/Jenkinsfile +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/env groovy -@Library('github.com/msrb/cicd-pipeline-helpers') - -def commitId -node('docker') { - - - def image = docker.image('bayesian/coreapi-pgbouncer') - - stage('Checkout') { - checkout scm - commitId = sh(returnStdout: true, script: 'git rev-parse --short HEAD').trim() - dir('openshift') { - stash name: 'template', includes: 'template.yaml' - } - } - - stage('Build') { - docker.build(image.id, '--pull --no-cache .') - } - - stage('Test') { - dockerCleanup() - dir('tests') { - timeout(5) { - sh './run_integration_tests.sh' - } - } - } - - if (env.BRANCH_NAME == 'master') { - stage('Push Images') { - docker.withRegistry('https://push.registry.devshift.net/', 'devshift-registry') { - image.push('latest') - image.push(commitId) - } - } - } -} - -if (env.BRANCH_NAME == 'master') { - node('oc') { - - def dc = 'bayesian-pgbouncer' - lock('f8a_staging') { - - stage('Deploy - Stage') { - unstash 'template' - sh "oc --context=rh-idev process -v IMAGE_TAG=${commitId} -f template.yaml | oc --context=rh-idev apply -f -" - } - - stage('End-to-End Tests') { - def result - try { - timeout(10) { - sleep 5 - sh "oc logs -f dc/${dc}" - def e2e = build job: 'fabric8-analytics-common-master', wait: true, propagate: false, parameters: [booleanParam(name: 'runOnOpenShift', value: true)] - result = e2e.result - } - } catch (err) { - error "Error: ${err}" - } finally { - if (!result?.equals('SUCCESS')) { - sh "oc rollback ${dc}" - error 'End-to-End tests failed.' - } else { - echo 'End-to-End tests passed.' - } - } - } - } - } -} diff --git a/Makefile b/Makefile index 6cf1ff6..3d6efb8 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ REGISTRY?=registry.devshift.net -REPOSITORY?=bayesian/coreapi-pgbouncer +REPOSITORY?=fabric8-analytics/coreapi-pgbouncer DEFAULT_TAG=latest .PHONY: all docker-build fast-docker-build test get-image-name get-image-repository diff --git a/openshift/template.yaml b/openshift/template.yaml index 7ce1e10..8236412 100644 --- a/openshift/template.yaml +++ b/openshift/template.yaml @@ -107,7 +107,7 @@ parameters: displayName: Docker image required: true name: DOCKER_IMAGE - value: "bayesian/coreapi-pgbouncer" + value: "fabric8-analytics/coreapi-pgbouncer" - description: Image tag displayName: Image tag diff --git a/tests/run_integration_tests.sh b/tests/run_integration_tests.sh index 9cf9e46..b9eedfe 100755 --- a/tests/run_integration_tests.sh +++ b/tests/run_integration_tests.sh @@ -2,7 +2,7 @@ # Check that we can connect to Postgres through PgBouncer container. -pgbouncer_image=${IMAGE_NAME:-registry.devshift.net/bayesian/coreapi-pgbouncer:latest} +pgbouncer_image=${IMAGE_NAME:-registry.devshift.net/fabric8-analytics/coreapi-pgbouncer:latest} postgres_image='registry.centos.org/sclo/postgresql-94-centos7:latest' here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" postgres_env="${here}/postgres.env"