From a4cd5d7ee76ec9908662f5b6921106103091c17a Mon Sep 17 00:00:00 2001 From: Sarah Roberts Date: Thu, 21 Dec 2023 11:18:08 -0700 Subject: [PATCH] removed the Jenkinsfile and the Dockerfile --- Dockerfile | 21 ------------- Jenkinsfile | 86 ----------------------------------------------------- 2 files changed, 107 deletions(-) delete mode 100644 Dockerfile delete mode 100644 Jenkinsfile diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 3cafd9d..0000000 --- a/Dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -FROM golang:1.21-alpine - -RUN apk add --no-cache git wget - -COPY . /go/src/github.com/cyverse-de/condor-launcher -WORKDIR /go/src/github.com/cyverse-de/condor-launcher -RUN go install github.com/cyverse-de/condor-launcher - -ENTRYPOINT ["condor-launcher"] -CMD ["--help"] - -ARG git_commit=unknown -ARG version="2.20.0" -ARG descriptive_version=unknown - -LABEL org.cyverse.git-ref="$git_commit" -LABEL org.cyverse.version="$version" -LABEL org.cyverse.descriptive-version="$descriptive_version" -LABEL org.label-schema.vcs-ref="$git_commit" -LABEL org.label-schema.vcs-url="https://github.com/cyverse-de/condor-launcher" -LABEL org.label-schema.version="$descriptive_version" diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index 4257c8b..0000000 --- a/Jenkinsfile +++ /dev/null @@ -1,86 +0,0 @@ -#!groovy -node('docker') { - slackJobDescription = "job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})" - try { - stage "Build" - checkout scm - - service = readProperties file: 'service.properties' - - git_commit = sh(returnStdout: true, script: "git rev-parse HEAD").trim() - echo git_commit - - descriptive_version = sh(returnStdout: true, script: 'git describe --long --tags --dirty --always').trim() - echo descriptive_version - - dockerRepo = "test-${env.BUILD_TAG}" - - sh "docker build --rm --build-arg git_commit=${git_commit} --build-arg descriptive_version=${descriptive_version} -t ${dockerRepo} ." - - image_sha = sh(returnStdout: true, script: "docker inspect -f '{{ .Config.Image }}' ${dockerRepo}").trim() - echo image_sha - - writeFile(file: "${dockerRepo}.docker-image-sha", text: "${image_sha}") - fingerprint "${dockerRepo}.docker-image-sha" - - - dockerTestRunner = "test-${env.BUILD_TAG}" - dockerTestCleanup = "test-cleanup-${env.BUILD_TAG}" - dockerPusher = "push-${env.BUILD_TAG}" - try { - stage "Test" - try { - sh "docker run --rm --name ${dockerTestRunner} --entrypoint 'sh' ${dockerRepo} -c \"go test -v github.com/cyverse-de/${service.repo} | tee /dev/stderr | go-junit-report\" > test-results.xml" - } finally { - junit 'test-results.xml' - - sh "docker run --rm --name ${dockerTestCleanup} -v \$(pwd):/build -w /build alpine rm -r test-results.xml" - } - - - milestone 100 - stage "Docker Push" - dockerPushRepo = "${service.dockerUser}/${service.repo}:${env.BRANCH_NAME}" - lock("docker-push-${dockerPushRepo}") { - milestone 101 - sh "docker tag ${dockerRepo} ${dockerPushRepo}" - withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'jenkins-docker-credentials', passwordVariable: 'DOCKER_PASSWORD', usernameVariable: 'DOCKER_USERNAME']]) { - sh """docker run -e DOCKER_USERNAME -e DOCKER_PASSWORD \\ - -v /var/run/docker.sock:/var/run/docker.sock \\ - --rm --name ${dockerPusher} \\ - docker:\$(docker version --format '{{ .Server.Version }}') \\ - sh -e -c \\ - 'docker login -u \"\$DOCKER_USERNAME\" -p \"\$DOCKER_PASSWORD\" && \\ - docker push ${dockerPushRepo} && \\ - docker rmi ${dockerPushRepo} && \\ - docker logout'""" - } - } - } finally { - sh returnStatus: true, script: "docker kill ${dockerTestRunner}" - sh returnStatus: true, script: "docker rm ${dockerTestRunner}" - - sh returnStatus: true, script: "docker kill ${dockerTestCleanup}" - sh returnStatus: true, script: "docker rm ${dockerTestCleanup}" - - sh returnStatus: true, script: "docker kill ${dockerPusher}" - sh returnStatus: true, script: "docker rm ${dockerPusher}" - - sh returnStatus: true, script: "docker rmi ${dockerRepo}" - - step([$class: 'hudson.plugins.jira.JiraIssueUpdater', - issueSelector: [$class: 'hudson.plugins.jira.selector.DefaultIssueSelector'], - scm: scm, - labels: [ "${service.repo}-${descriptive_version}" ]]) - } - } catch (InterruptedException e) { - currentBuild.result = "ABORTED" - slackSend color: 'warning', message: "ABORTED: ${slackJobDescription}" - throw e - } catch (e) { - currentBuild.result = "FAILED" - sh "echo ${e}" - slackSend color: 'danger', message: "FAILED: ${slackJobDescription}" - throw e - } -}