Skip to content

Commit

Permalink
chore: update jenkins building container as first step
Browse files Browse the repository at this point in the history
  • Loading branch information
jskelin committed Oct 15, 2024
1 parent dcb1f86 commit 7805260
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .ci/jenkins/tools/tools.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* @license
* Copyright 2024 Dynatrace LLC
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

void installGo(String version) {
sh(label: "", script: "set -eux && export DEBIAN_FRONTEND=noninteractive")
sh(label: "install necessary tools", script: "apt-get update && apt-get install -y --no-install-recommends g++ gcc libc6-dev make pkg-config")
sh(label: "remove old go version", script: "rm -rf /usr/local/go")
sh(label: "download go binaries", script: "curl --silent --show-error --location \"https://go.dev/dl/go${version}.linux-amd64.tar.gz\" | tar -xz -C /usr/local")
sh(label: "set PATH", script: 'GOROOT=$(/usr/local/go/bin/go env GOROOT) && GOPATH=$(/usr/local/go/bin/go env GOPATH) && PATH="$PATH:$GOROOT/bin:$GOPATH/bin"')
sh(label: "install gotestsum", script: "go install gotest.tools/gotestsum@latest")
}

return this
5 changes: 5 additions & 0 deletions .ci/releasePipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ pipeline {
steps {
script {
Context ctx
stage("setup container") {
tools = load(".ci/jenkins/tools/tools.groovy")
tools.installGo("1.23.2")
}

stage("Pre-build steps") {
ctx = new Context(newGithubRelease())
createEmptyDirectory(dir: Release.BINARIES)
Expand Down

0 comments on commit 7805260

Please sign in to comment.