diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100755 index 1f2c41c26fe..00000000000 --- a/Jenkinsfile +++ /dev/null @@ -1,116 +0,0 @@ -#!/usr/bin/env groovy - -commonCreds = [ - file(credentialsId: 'tectonic-pull', variable: 'PULL_SECRET_PATH'), - [ - $class: 'StringBinding', - credentialsId: 'github-coreosbot', - variable: 'GITHUB_CREDENTIALS' - ] -] - -credsLog = commonCreds.collect() -credsLog.push( - [ - $class: 'AmazonWebServicesCredentialsBinding', - credentialsId: 'TF-TECTONIC-JENKINS' - ] -) - -creds = commonCreds.collect() -creds.push( - [ - $class: 'AmazonWebServicesCredentialsBinding', - credentialsId: 'TF-TECTONIC-JENKINS-NO-SESSION' - ] -) - -tectonicSmokeTestEnvImage = 'quay.io/coreos/tectonic-smoke-test-env:v6.0' -tectonicBazelImage = 'quay.io/coreos/tectonic-builder:bazel-v0.3' -originalCommitId = 'UNKNOWN' - -pipeline { - agent { label 'worker && ec2' } - options { - // Individual steps have stricter timeouts. 360 minutes should be never reached. - timeout(time:6, unit:'HOURS') - timestamps() - buildDiscarder(logRotator(numToKeepStr:'20', artifactNumToKeepStr: '20')) - } - parameters { - booleanParam( - name: 'RUN_SMOKE_TESTS', - defaultValue: false, - description: 'Determine if smoke tests should be running. Usually overwitten by trigger job.' - ) - booleanParam( - name: 'NOTIFY_SLACK', - defaultValue: false, - description: 'Notify slack channel on failure.' - ) - string( - name: 'SLACK_CHANNEL', - defaultValue: '#team-installer', - description: 'Slack channel to notify on failure.' - ) - } - - stages { - stage("Smoke Tests") { - when { - anyOf { - branch "master" - expression { return params.RUN_SMOKE_TESTS.toBoolean() } - } - } - options { - timeout(time: 70, unit: 'MINUTES') - } - steps { - withDockerContainer(tectonicSmokeTestEnvImage) { - withCredentials(creds) { - ansiColor('xterm') { - sh """#!/bin/bash -e - export HOME=/home/jenkins - ./tests/run.sh - cp bazel-bin/tectonic-dev.tar.gz . - """ - // Produce an artifact which can be downloaded via web UI - stash name: 'tectonic-tarball', includes: 'tectonic-dev.tar.gz' - } - } - } - } - } - - } - post { - always { - forcefullyCleanWorkspace() - cleanWs notFailBuild: true - } - failure { - script { - if (params.NOTIFY_SLACK) { - slackSend color: 'danger', channel: params.SLACK_CHANNEL, message: "Job ${env.JOB_NAME}, build no. #${BUILD_NUMBER} failed! (<${env.BUILD_URL}|Open>)" - } - } - } - } -} - -def forcefullyCleanWorkspace() { - return withDockerContainer( - image: tectonicBazelImage, - args: '-u root' - ) { - ansiColor('xterm') { - sh """#!/bin/bash -e - if [ -d "\$WORKSPACE" ] - then - rm -rf \$WORKSPACE/* - fi - """ - } - } -} diff --git a/images/tectonic-builder/Dockerfile b/images/tectonic-builder/Dockerfile deleted file mode 100644 index 2501ed751f1..00000000000 --- a/images/tectonic-builder/Dockerfile +++ /dev/null @@ -1,46 +0,0 @@ -### -# Update the builder image manually by running: -# -# docker build -t quay.io/coreos/tectonic-builder: -f images/builder/Dockerfile . -# docker push quay.io/coreos/tectonic-builder: -### - -FROM golang:1.9.2-stretch - -### For golang testing stuff -RUN go get -u github.com/golang/lint/golint -RUN go get github.com/jstemmer/go-junit-report - -### Tools used by 'make structure-check' -RUN go get github.com/bronze1man/yaml2json - -### 'grafiti' for cluster cleanup -ENV GRAFITI_VERSION "v0.1.1" -RUN git clone -q https://github.com/coreos/grafiti.git ${GOPATH}/src/github.com/coreos/grafiti \ - && cd ${GOPATH}/src/github.com/coreos/grafiti \ - && git checkout -q tags/${GRAFITI_VERSION} \ - && make install - -# /go needs to be writable by jenkins user like it is in the upstream golang image -RUN chmod 777 -R /go - -### Install Shellcheck and Terraform -ENV SHELLCHECK_VERSION="v0.4.6" -ENV TERRAFORM_VERSION="0.11.1" -ENV HOME /opt/home -RUN mkdir -p ${HOME} && \ - chmod 777 -R ${HOME} && \ - apt-get update && \ - apt-get install --no-install-recommends -y -q \ - build-essential sudo curl wget git autoconf automake unzip libtool jq awscli gnupg1 \ - openvpn xauth - -# Install Terraform -ARG TERRAFORM_URL=https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip -RUN curl -L ${TERRAFORM_URL} | funzip > /usr/local/bin/terraform && chmod +x /usr/local/bin/terraform - -# Install Shellcheck -RUN cd /tmp && \ - wget --quiet https://storage.googleapis.com/shellcheck/shellcheck-${SHELLCHECK_VERSION}.linux.x86_64.tar.xz && \ - tar xJf shellcheck-${SHELLCHECK_VERSION}.linux.x86_64.tar.xz && \ - mv /tmp/shellcheck-${SHELLCHECK_VERSION}/shellcheck /usr/local/bin/shellcheck diff --git a/images/tectonic-builder/Dockerfile.bazel b/images/tectonic-builder/Dockerfile.bazel deleted file mode 100644 index d5510ab1da8..00000000000 --- a/images/tectonic-builder/Dockerfile.bazel +++ /dev/null @@ -1,28 +0,0 @@ -FROM openjdk:8 -ENV BAZEL_VERSION="0.12.0" - -RUN echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt testing jdk1.8" | \ - tee /etc/apt/sources.list.d/bazel.list && \ - curl https://bazel.build/bazel-release.pub.gpg | apt-key add - - -RUN apt-get update && apt-get install -y --no-install-recommends \ - bash-completion \ - g++ \ - zlib1g-dev \ - && curl -LO "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel_${BAZEL_VERSION}-linux-x86_64.deb" \ - && dpkg -i bazel_*.deb - -RUN apt --fix-broken install -y - -# Install Chrome for installer gui tests -# Use Chrome beta because v60 or higher is needed for headless mode -RUN wget --quiet -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \ - sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list' && \ - apt-get update && \ - apt-get install --no-install-recommends -y -q \ - google-chrome-beta ca-certificates xvfb xauth \ - && rm -rf /var/lib/apt/lists/* - -RUN useradd -ms /bin/bash bazel -USER bazel -WORKDIR /home/bazel diff --git a/images/tectonic-builder/README.md b/images/tectonic-builder/README.md deleted file mode 100644 index d2db4370f1a..00000000000 --- a/images/tectonic-builder/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# tectonic-builder - -[![Container Repository on Quay](https://quay.io/repository/coreos/tectonic-builder/status "Container Repository on Quay")](https://quay.io/repository/coreos/tectonic-builder) - -This container image contains the environment required to build and test the -[Tectonic Installer](../../installer) and aims at facilitating the implementation -of CI/CD pipelines. More particularly, this image is used in several Jenkins -jobs today for testing purposes. - -Example: - -```sh -docker build -t quay.io/coreos/tectonic-builder:v1.33 -f images/tectonic-builder/Dockerfile . -``` diff --git a/images/tectonic-smoke-test-env/Dockerfile b/images/tectonic-smoke-test-env/Dockerfile deleted file mode 100644 index 2959a0be2f9..00000000000 --- a/images/tectonic-smoke-test-env/Dockerfile +++ /dev/null @@ -1,24 +0,0 @@ -FROM debian:stretch - -ENV TERRAFORM_VERSION="0.11.1" - -RUN apt-get update && \ - apt-get install --no-install-recommends -y -q \ - curl make unzip jq awscli wget xvfb xauth ssh openvpn build-essential zlib1g-dev gnupg uuid-runtime && \ - apt-get clean - -# Install bazel -RUN echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" > /etc/apt/sources.list.d/bazel.list && \ - curl https://bazel.build/bazel-release.pub.gpg | apt-key add - && \ - apt-get update && \ - apt-get install --no-install-recommends -y -q openjdk-8-jdk bazel git python python-yaml && \ - apt-get clean - -# Install Terraform -RUN curl -L https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip | funzip > /usr/local/bin/terraform && chmod +x /usr/local/bin/terraform - -# Add user jenkins (uid: 1000), this is needed among others for `ssh` to not -# complain about missing user. -RUN useradd -u 1000 -ms /bin/bash jenkins -RUN mkdir -p /home/jenkins/.ssh && chown jenkins:jenkins /home/jenkins/.ssh -ENV HOME /home/jenkins diff --git a/tests/README.md b/tests/README.md index c132d835f9f..03f09f14169 100644 --- a/tests/README.md +++ b/tests/README.md @@ -51,11 +51,6 @@ In addition to our basic set of tests we have smoke tests which are running on A 3. Get the approval of another person. 4. Merge the PR. -## Nightly Runs - -We use Jenkins to run our tests and our `nightly` builds against the master branch. -Those jobs are executing smoke tests and building docker images. - ## Running smoke tests locally ### 1. Expose environment variables diff --git a/tests/jenkins-jobs/README.md b/tests/jenkins-jobs/README.md deleted file mode 100644 index 466ee188f60..00000000000 --- a/tests/jenkins-jobs/README.md +++ /dev/null @@ -1,49 +0,0 @@ -# Jenkins Jobs - -This folder contains Jenkins jobs which will be used to build, test and support the Tectonic Installer. - - -## tectonic-builder Jenkins Job - -This file (`tectonic_builder_docker_image.groovy`) creates a Jenkins job called `tectonic-builder-docker-image` to build the `tectonic-builder` docker image which is used to execute our tests. - -This job has 3 input parameters: - -* `TERRAFORM_UPSTREAM_URL`: If you need to build the image using the upstream `Terraform` -* `TECTONIC_BUILDER_VERSION`: The version of the `tectonic-builder` you are building. -* `DRY_RUN`: Just to build the image. - -If you don't set the `TERRAFORM_UPSTREAM_URL` it will build the image using the tectonic custom terraform version. - - -## OpenShift Installer Nightly Trigger - -This file (`openshift_installer_nightly_trigger.groovy`) creates a Jenkins job called `openshift-installer-nightly-trigger` in the `triggers` directory to run the tests against the `OpenShift Installer` in the `master` branch. -This job will run everyday around 3AM UTC time. - -Parameters: - -* No input parameters are required. - -## OpenShift Installer Public PR Trigger - -This file (`openshift_installer_public_pr_trigger.groovy`) creates a Jenkins job called `openshift-installer-pr-trigger` in the `triggers` directory to run the tests against the `OpenShift Installer` using the PR branch. - -Parameters: - -* No input parameters are required. - -## Tag/Clean AWS - -This file (`maintenance/grafiti_tag_clean_aws.groovy`) creates a Jenkins job called `tag_clean_aws_resources_grafiti` in the `maintenance` directory to tag and clean AWS resources across all AWS regions every 6 hours. - -Parameters: - -* `TAG_CLEAN`: Select if want to Tag or Clean the AWS resources. -* `START_HOUR`: Used only when tagging. Number of hours prior to now to start parsing logs from CloudTrail. Default 7. -* `END_HOUR`: Used only when tagging. Number of hours prior to now to stop parsing logs from CloudTrail. Default 0. -* `AWS_REGION`: Optional. Specific AWS region in which to tag resources. -* `DATE_VALUE_OVERRIDE`: Optional. YYYY-MM-DD formatted tag value of resources to delete. -* `GRAFITI_IMAGE`: Grafiti docker image to use in the job. -* `SCRIPT_DIR`: Folder which contains the grafiti scripts in the tectonic-installer repository. -IPT_DIR`: Folder which contains the grafiti scripts in the tectonic-installer repository. diff --git a/tests/jenkins-jobs/maintenance/tag_clean_aws_grafiti_job.groovy b/tests/jenkins-jobs/maintenance/tag_clean_aws_grafiti_job.groovy deleted file mode 100755 index fe147a1381b..00000000000 --- a/tests/jenkins-jobs/maintenance/tag_clean_aws_grafiti_job.groovy +++ /dev/null @@ -1,99 +0,0 @@ -#!/bin/env groovy​ - -folder("maintenance") - -job("maintenance/tag_clean_aws_resources_grafiti") { - description("Tag/Clean AWS resources with an \'expirationDate\' of today across all AWS regions every 6 hours.\nThis job is manage by tectonic-installer.\nChanges here will be reverted automatically") - logRotator(30, 100) - parameters { - choiceParam('TAG_CLEAN', ['clean-aws', 'tag-aws'], 'Select \'clean-aws\' to clean the AWS resources or \'tag-aws\' to tag the AWS resources') - stringParam('GRAFITI_VERSION', '64182b19f2c852ab8351ab56bf9533b3b99dfc63', 'Version of grafiti to run.') - stringParam('AWS_REGION', '', 'Optional. Specific AWS region to clean.') - stringParam('DATE_OVERRIDE', '', 'Optional. YYYY-MM-DD formatted tag value of resources to delete.') - stringParam('START_HOUR', '7', 'Used only when in Tag mode. Number of hours prior to now to start parsing logs from CloudTrail.') - stringParam('END_HOUR', '0', 'Used only when in Tag mode. Number of hours prior to now to stop parsing logs from CloudTrail.') - stringParam('SCRIPT_DIR', 'scripts', 'Folder which contains the scripts to run grafiti.') - } - - label('worker&&ec2') - - scm { - git { - remote { - url('https://github.com/coreos/tectonic-installer') - } - branch('origin/master') - } - } - - wrappers { - colorizeOutput() - timestamps() - credentialsBinding { - usernamePassword("QUAY_USERNAME", "QUAY_PASSWD", "quay-robot") - amazonWebServicesCredentialsBinding { - accessKeyVariable("AWS_ACCESS_KEY_ID") - secretKeyVariable("AWS_SECRET_ACCESS_KEY") - credentialsId("TF-TECTONIC-JENKINS-GRAFITI") - } - } - } - - triggers { - parameterizedCron { - parameterizedSpecification("""H H/6 * * * % TAG_CLEAN=tag-aws -H H/8 * * * % TAG_CLEAN=clean-aws - """.stripIndent()) - } - } - - steps { - systemGroovyCommand(""" -def currentBuild = Thread.currentThread().executable -def description = build.buildVariableResolver.resolve('TAG_CLEAN') -currentBuild.setDescription(description) - """) - - def cmd = """#!/bin/bash -ex -export DATE_OVERRIDE_FLAG="" -if [ -n "\$DATE_OVERRIDE" ]; then - export DATE_OVERRIDE_FLAG="--date-override \$DATE_OVERRIDE" -fi - -if [ "\$TAG_CLEAN" == "tag-aws" ]; then - # Tag all Route53 hosted zones - \$SCRIPT_DIR/maintenance/tag-route53-hosted-zones.sh --force \$DATE_OVERRIDE_FLAG -fi - -regions=( "us-east-2" "us-east-1" "us-west-1" "us-west-2" "ca-central-1" - "ap-south-1" "ap-northeast-2" "ap-southeast-1" "ap-southeast-2" - "ap-northeast-1" "eu-central-1" "eu-west-1" "eu-west-2" "sa-east-1" ) - -if [ -n "\$AWS_REGION" ]; then - regions=( "\$AWS_REGION" ) -fi - -for region in "\${regions[@]}"; do - \$SCRIPT_DIR/maintenance/\$TAG_CLEAN.sh \\ - --grafiti-version "\$GRAFITI_VERSION" \\ - --aws-region "\$region" \\ - --force \\ - \$DATE_OVERRIDE_FLAG -done - """.stripIndent() - shell(cmd) - } - - publishers { - wsCleanup() - slackNotifier { - authTokenCredentialId('tectonic-slack-token') - customMessage("Tectonic Tag/Clean AWS resources") - includeCustomMessage(true) - notifyBackToNormal(true) - notifyFailure(true) - room('#tectonic-installer-ci') - teamDomain('coreos') - } - } -} diff --git a/tests/jenkins-jobs/openshift_installer_nightly_trigger.groovy b/tests/jenkins-jobs/openshift_installer_nightly_trigger.groovy deleted file mode 100644 index d35cb315879..00000000000 --- a/tests/jenkins-jobs/openshift_installer_nightly_trigger.groovy +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/env groovy​ - -folder("triggers") - -job("triggers/openshift-installer-nightly-trigger") { - logRotator(10, 1000) - description('Tectonic Installer nightly builds against master. Changes here will be reverted automatically.') - - wrappers { - colorizeOutput() - timestamps() - } - - triggers { - cron('H 3 * * *') - } - - steps { - triggerBuilder { - configs { - blockableBuildTriggerConfig { - projects("openshift-installer/master") - block { - buildStepFailureThreshold("FAILURE") - unstableThreshold("UNSTABLE") - failureThreshold("FAILURE") - } - configs { - booleanParameters { - configs { - booleanParameterConfig { - name('NOTIFY_SLACK') - value(true) - } - } - } - } - } - } - } - } - - publishers { - wsCleanup() - } -} diff --git a/tests/jenkins-jobs/openshift_installer_public_pr_trigger.groovy b/tests/jenkins-jobs/openshift_installer_public_pr_trigger.groovy deleted file mode 100644 index 2181ef435f1..00000000000 --- a/tests/jenkins-jobs/openshift_installer_public_pr_trigger.groovy +++ /dev/null @@ -1,178 +0,0 @@ -#!/bin/env groovy​ - -folder("triggers") - -job("triggers/openshift-installer-pr-trigger") { - description('Tectonic Installer PR Trigger. Changes here will be reverted automatically.') - - concurrentBuild() - - logRotator(30, 100) - label("worker && ec2") - - parameters { - stringParam('ghprbPullId', '', 'PR number') - stringParam('GITHUB_REPO', 'openshift/installer', 'Github repository') - } - - properties { - githubProjectUrl('https://github.com/\${GITHUB_REPO}') - } - - wrappers { - colorizeOutput() - timestamps() - buildInDocker { - image('quay.io/coreos/tectonic-smoke-test-env:v5.6') - } - timeout { - absolute(30) - } - } - - triggers { - ghprbTrigger { - gitHubAuthId("") - adminlist("") - orgslist("coreos\ncoreos-inc") - whitelist("") - cron("H/5 * * * *") - triggerPhrase("ok to test") - onlyTriggerPhrase(false) - useGitHubHooks(true) - permitAll(false) - autoCloseFailedPullRequests(false) - displayBuildErrorsOnDownstreamBuilds(false) - commentFilePath("") - skipBuildPhrase(".*\\[skip\\W+ci\\].*") - blackListCommitAuthor("") - allowMembersOfWhitelistedOrgsAsAdmin(true) - msgSuccess("") - msgFailure("") - commitStatusContext("pr-trigger") - buildDescTemplate("#\$pullId: \$abbrTitle") - blackListLabels("") - whiteListLabels("") - includedRegions("") - excludedRegions("") - } - } - - steps { - shell """#!/bin/bash -ex - curl "https://api.github.com/repos/\${GITHUB_REPO}/labels?per_page=100" > repoLabels - repoLabels=\$(jq ".[] | .name" repoLabels) - repoLabels=\$(echo \$repoLabels | tr -d "\\"" | tr [a-z] [A-Z] | tr - _) - for label in \$repoLabels - do - echo \$label=false >> env_vars - done - - - curl "https://api.github.com/repos/\${GITHUB_REPO}/issues/\${ghprbPullId}" > pr - labels=\$(jq ".labels | .[] | .name" pr) - labels=\$(echo \$labels | tr -d "\\"" | tr [a-z] [A-Z] | tr - _) - for label in \$labels - do - echo \$label=true >> env_vars - done - """ - - downstreamParameterized { - trigger('openshift-installer/PR-\${ghprbPullId}') { - parameters { - propertiesFile("env_vars", true) - } - } - } - shell "sleep 10" - } - - publishers { - wsCleanup() - slackNotifier { - authTokenCredentialId('tectonic-slack-token') - customMessage("Tectonic Installer PR Trigger") - includeCustomMessage(true) - notifyBackToNormal(true) - notifyFailure(true) - notifyRepeatedFailure(true) - room('#tectonic-installer-ci') - teamDomain('coreos') - } - publishers { - groovyPostBuild(""" -import jenkins.model.Jenkins -import hudson.model.* -import org.jenkinsci.plugins.workflow.job.WorkflowRun -import org.jenkinsci.plugins.workflow.support.steps.StageStepExecution -import org.jenkinsci.plugins.workflow.job.WorkflowJob - -//Get the PR Number -def thr = Thread.currentThread() -def currentBuild = thr?.executable -def resolver = currentBuild.buildVariableResolver -def PRNum = resolver.resolve("ghprbPullId") - - -// sleep a bit to wait jenkins refresh the jobs -sleep(10000); - -def params = [ ]; - -// Get the PR Job -def job = Jenkins.instance.getItemByFullName("openshift-installer/PR-" + PRNum) -manager.listener.logger.println("Jobs: " + job); -manager.listener.logger.println("PR Num: " + PRNum); -// If job is in the queue wait for that -manager.listener.logger.println("Job is in queue?: " + job.isInQueue()); -while(job.isInQueue()) { - manager.listener.logger.println("Job in the queue, waiting...."); - sleep(1000); -} -manager.listener.logger.println(job.builds); -for (prBuild in job.builds) { -manager.listener.logger.println("Job Num: " + prBuild.getNumber().toInteger()); -manager.listener.logger.println("Job is building?: " + prBuild.isBuilding()); - if (prBuild.getNumber().toInteger() == 1 && prBuild.isBuilding()) { - manager.listener.logger.println("Build 1 is running, will try to kill..."); - - // giving some time to job run and after that kill - // we add this because we saw if kill right away sometime jenkins did not refresh - // the build parameters status. - sleep(60000); - - WorkflowRun run = (WorkflowRun) prBuild; - //terminate - run.doTerm(); - - while(prBuild.isBuilding()) { - manager.listener.logger.println("Trying to terminate the job...."); - run.doTerm(); - sleep(1000); - } - - manager.listener.logger.println("Job Killed"); - //release pipeline concurrency locks - StageStepExecution.exit(run); - - sleep(1000); - def parameters = currentBuild?.actions.find{ it instanceof ParametersAction }?.parameters - - def cause = new Cause.UpstreamCause(currentBuild) - def causeAction = new hudson.model.CauseAction(cause) - - def pr_trigger_job = Jenkins.instance.getItemByFullName("triggers/openshift-installer-pr-trigger") - def paramsAction = new ParametersAction(parameters) - manager.listener.logger.println(parameters); - - hudson.model.Hudson.instance.queue.schedule(pr_trigger_job, 0, causeAction, paramsAction) - break; - } -} -manager.listener.logger.println("Done"); -""" - ,Behavior.MarkFailed) - } - } -} diff --git a/tests/jenkins-jobs/tectonic_builder_docker_image.groovy b/tests/jenkins-jobs/tectonic_builder_docker_image.groovy deleted file mode 100644 index 04ea8fb6473..00000000000 --- a/tests/jenkins-jobs/tectonic_builder_docker_image.groovy +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/env groovy​ - -folder("builders") - -job("builders/tectonic-builder-docker-image") { - logRotator(-1, 10) - description('Build quay.io/coreos/tectonic-builder Docker image. Changes here will be reverted automatically.') - - label 'worker&&ec2' - - parameters { - stringParam('TERRAFORM_UPSTREAM_URL', '', 'upstream Terraform download url, defaults to upstream Terraform release') - stringParam('TECTONIC_BUILDER_TAG', '', 'Tectonic Builder Docker tag') - booleanParam('DRY_RUN', true, 'Just build the docker image') - stringParam('GITHUB_REPO', 'coreos/tectonic-installer', 'Github repository') - } - - wrappers { - colorizeOutput() - timestamps() - credentialsBinding { - usernamePassword("QUAY_USERNAME", "QUAY_PASSWD", "quay-robot") - } - } - - scm { - git { - remote { - url('https://github.com/\${GITHUB_REPO}') - } - branch('origin/master') - } - } - - - steps { - def cmd = """ - #!/bin/bash -e - - if [ -z "\${TERRAFORM_UPSTREAM_URL}" ] - then - export TECTONIC_BUILDER_IMAGE=quay.io/coreos/tectonic-builder:\${TECTONIC_BUILDER_TAG} - docker build -t \${TECTONIC_BUILDER_IMAGE} -f images/tectonic-builder/Dockerfile . - else - export TECTONIC_BUILDER_IMAGE=quay.io/coreos/tectonic-builder:\${TECTONIC_BUILDER_TAG}-upstream-terraform - docker build -t \${TECTONIC_BUILDER_IMAGE} --build-arg TERRAFORM_URL=\${TERRAFORM_UPSTREAM_URL} -f images/tectonic-builder/Dockerfile . - fi - - if \${DRY_RUN}; - then - echo "Just build the image" - else - echo "Pushing the Image to quay" - docker login quay.io -u \${QUAY_USERNAME} -p \${QUAY_PASSWD} - docker push \${TECTONIC_BUILDER_IMAGE} - fi - """.stripIndent() - shell(cmd) - } - - publishers { - wsCleanup() - slackNotifier { - authTokenCredentialId('tectonic-slack-token') - customMessage("Jenkins Builder: tectonic-builder - tag: \${TECTONIC_BUILDER_TAG}") - includeCustomMessage(true) - notifyBackToNormal(true) - notifyFailure(true) - notifyRepeatedFailure(true) - room('#tectonic-installer-ci') - teamDomain('coreos') - } - } -} diff --git a/tests/jenkins-jobs/tectonic_smoke_test_docker_image_job.groovy b/tests/jenkins-jobs/tectonic_smoke_test_docker_image_job.groovy deleted file mode 100644 index 984befa82dd..00000000000 --- a/tests/jenkins-jobs/tectonic_smoke_test_docker_image_job.groovy +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/env groovy​ - -folder("builders") - -job("builders/tectonic-smoke-env-docker-image") { - logRotator(-1, 10) - description('Build quay.io/coreos/tectonic-smoke-test-env Docker image. Changes here will be reverted automatically.') - - label 'worker&&ec2' - - parameters { - stringParam('TECTONIC_SMOKE_TAG', '', 'Tectonic Smoke Docker tag') - booleanParam('DRY_RUN', true, 'Just build the docker image') - stringParam('GITHUB_REPO', 'coreos/tectonic-installer', 'Github repository') - } - - wrappers { - colorizeOutput() - timestamps() - credentialsBinding { - usernamePassword("QUAY_USERNAME", "QUAY_PASSWD", "quay-robot") - } - } - - scm { - git { - remote { - url('https://github.com/\${GITHUB_REPO}') - } - branch('origin/master') - } - } - - - steps { - def cmd = """#!/bin/bash -ex -export TECTONIC_SMOKE_IMAGE=quay.io/coreos/tectonic-smoke-test-env:\${TECTONIC_SMOKE_TAG} -docker build -t \${TECTONIC_SMOKE_IMAGE} -f images/tectonic-smoke-test-env/Dockerfile --no-cache . - -if \${DRY_RUN}; -then - echo "Just build the image" -else - echo "Pushing the Image to quay" - docker login quay.io -u \${QUAY_USERNAME} -p \${QUAY_PASSWD} - docker push \${TECTONIC_SMOKE_IMAGE} -fi - """.stripIndent() - shell(cmd) - } - - publishers { - wsCleanup() - slackNotifier { - authTokenCredentialId('tectonic-slack-token') - customMessage("Jenkins Builder: tectonic-smoke-test-env - tag: \${TECTONIC_SMOKE_TAG}") - includeCustomMessage(true) - notifyBackToNormal(true) - notifyFailure(true) - notifyRepeatedFailure(true) - room('#tectonic-installer-ci') - teamDomain('coreos') - } - } -}