Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: gocd-contrib/gocd-oss-cookbooks
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.5.12
Choose a base ref
...
head repository: gocd-contrib/gocd-oss-cookbooks
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
253 changes: 198 additions & 55 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -5,87 +5,230 @@ on:
tags:
- 'v*'

env:
REGISTRY_IMAGE: gocddev/gocd-dev-build

jobs:
dind:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Verify a tag is present
run: if [ $(git tag --points-at HEAD --sort=version:refname | tail -n1 | wc -c) == 0 ]; then echo "Please set a tag pointing to the HEAD"; exit 1; fi

- name: Log into dockerhub
run: echo "${DOCKERHUB_TOKEN}" | docker login --username "${DOCKERHUB_USERNAME}" --password-stdin
env:
DOCKERHUB_USERNAME: "${{ secrets.DOCKERHUB_USERNAME }}"
DOCKERHUB_TOKEN: "${{ secrets.DOCKERHUB_TOKEN }}"

- name: Build the image
run: |
set -x
docker build -f Dockerfile.dind -t gocddev/gocd-dev-build:dind-"$(git tag --points-at HEAD --sort=version:refname | tail -n1)" .
- name: Publish the image
run: docker push gocddev/gocd-dev-build:dind-"$(git tag --points-at HEAD --sort=version:refname | tail -n1)"
centos-8:
runs-on: ubuntu-latest
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY_IMAGE }}
flavor: |
latest=false
prefix=dind-
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
id: build
uses: docker/build-push-action@v6
with:
context: .
file: dind.Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
pull: true

rhel-compat-build:
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
runner:
- ubuntu-latest
- ubuntu-24.04-arm
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Verify a tag is present
run: if [ $(git tag --points-at HEAD --sort=version:refname | tail -n1 | wc -c) == 0 ]; then echo "Please set a tag pointing to the HEAD"; exit 1; fi

- name: Log into dockerhub
run: echo "${DOCKERHUB_TOKEN}" | docker login --username "${DOCKERHUB_USERNAME}" --password-stdin
env:
DOCKERHUB_USERNAME: "${{ secrets.DOCKERHUB_USERNAME }}"
DOCKERHUB_TOKEN: "${{ secrets.DOCKERHUB_TOKEN }}"

- name: Build the image
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY_IMAGE }}
flavor: |
latest=false
prefix=rhelcompat-9-
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push by digest
id: build
uses: docker/build-push-action@v6
with:
context: .
file: rhel-compat.Dockerfile
labels: ${{ steps.meta.outputs.labels }}
outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
pull: true

- name: Export digest
run: |
mkdir -p /tmp/digests
digest="${{ steps.build.outputs.digest }}"
touch "/tmp/digests/${digest#sha256:}"
- name: Upload digest
uses: actions/upload-artifact@v4
with:
name: digests-${{ matrix.runner }}
path: /tmp/digests/*
if-no-files-found: error
retention-days: 1

rhel-compat-push:
runs-on: ubuntu-latest
needs:
- rhel-compat-build
steps:
- name: Download x64 digest
uses: actions/download-artifact@v4
with:
name: digests-ubuntu-latest
path: /tmp/digests
- name: Download arm64 digest
uses: actions/download-artifact@v4
with:
name: digests-ubuntu-24.04-arm
path: /tmp/digests

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY_IMAGE }}
flavor: |
latest=false
prefix=rhelcompat-9-
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Create manifest list and push
working-directory: /tmp/digests
run: |
set -x
docker build -f Dockerfile.centos -t gocddev/gocd-dev-build:centos-8-"$(git tag --points-at HEAD --sort=version:refname | tail -n1)" .
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
- name: Publish the image
run: docker push gocddev/gocd-dev-build:centos-8-"$(git tag --points-at HEAD --sort=version:refname | tail -n1)"
ubuntu-20-04:
ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Verify a tag is present
run: if [ $(git tag --points-at HEAD --sort=version:refname | tail -n1 | wc -c) == 0 ]; then echo "Please set a tag pointing to the HEAD"; exit 1; fi

- name: Log into dockerhub
run: echo "${DOCKERHUB_TOKEN}" | docker login --username "${DOCKERHUB_USERNAME}" --password-stdin
env:
DOCKERHUB_USERNAME: "${{ secrets.DOCKERHUB_USERNAME }}"
DOCKERHUB_TOKEN: "${{ secrets.DOCKERHUB_TOKEN }}"

- name: Build the image
run: |
set -x
docker build -f Dockerfile.ubuntu -t gocddev/gocd-dev-build:ubuntu-20-04-"$(git tag --points-at HEAD --sort=version:refname | tail -n1)" .
- name: Publish the image
run: docker push gocddev/gocd-dev-build:ubuntu-20-04-"$(git tag --points-at HEAD --sort=version:refname | tail -n1)"
windows-2019:
runs-on: windows-2019
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY_IMAGE }}
flavor: |
latest=false
prefix=ubuntu-24-04-
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
id: build
uses: docker/build-push-action@v6
with:
context: .
file: ubuntu.Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
pull: true

windows:
runs-on: windows-2022
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Verify a tag is present
run: if ($(git tag --points-at HEAD --sort=version:refname | tail -n1).length -eq 0) { echo "Please set a tag pointing to the HEAD"; exit 1; }

- name: Build the image
run: docker build -f Dockerfile.windowsservercore2019 -t gocddev/gocd-dev-build:windows2019-$(git tag --points-at HEAD --sort=version:refname | tail -n1) .
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY_IMAGE }}
flavor: |
latest=false
prefix=windows2022-
- name: Build and push
id: build
uses: mr-smithers-excellent/docker-build-push@v6
with:
dockerfile: windowsservercore.Dockerfile
image: ${{ env.REGISTRY_IMAGE }}
tags: ${{ steps.meta.outputs.version }}
registry: docker.io
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

windows-2025:
runs-on: windows-2025
steps:
- uses: actions/checkout@v4

- name: Log into dockerhub
run: (echo "$env:DOCKERHUB_TOKEN" | docker login --username "$env:DOCKERHUB_USERNAME" --password-stdin) -or (ls)
env:
DOCKERHUB_USERNAME: "${{ secrets.DOCKERHUB_USERNAME }}"
DOCKERHUB_TOKEN: "${{ secrets.DOCKERHUB_TOKEN }}"
- name: Verify a tag is present
run: if ($(git tag --points-at HEAD --sort=version:refname | tail -n1).length -eq 0) { echo "Please set a tag pointing to the HEAD"; exit 1; }

- name: Publish the image
run: docker push gocddev/gocd-dev-build:windows2019-$(git tag --points-at HEAD --sort=version:refname | tail -n1)
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY_IMAGE }}
flavor: |
latest=false
prefix=windows2025-
- name: Build and push
id: build
uses: mr-smithers-excellent/docker-build-push@v6
with:
dockerfile: windowsservercore-2025.Dockerfile
image: ${{ env.REGISTRY_IMAGE }}
tags: ${{ steps.meta.outputs.version }}
registry: docker.io
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
17 changes: 0 additions & 17 deletions Dockerfile.centos

This file was deleted.

7 changes: 0 additions & 7 deletions Dockerfile.dind

This file was deleted.

11 changes: 0 additions & 11 deletions Dockerfile.extensionsapp

This file was deleted.

17 changes: 0 additions & 17 deletions Dockerfile.ubuntu

This file was deleted.

3 changes: 1 addition & 2 deletions LICENSE-2.0.txt → LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
@@ -187,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright 2023 Thoughtworks, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# Images built:

- `gocddev/gocd-dev-build:dind-<github_tag>`
- `gocddev/gocd-dev-build:centos-8-<github_tag>`
- `gocddev/gocd-dev-build:ubuntu-20-04-<github_tag>`
- `gocddev/gocd-dev-build:windows2019-<github_tag>`
- `gocddev/gocd-dev-build:rhelcompat-9-<github_tag>`
- `gocddev/gocd-dev-build:ubuntu-24-04-<github_tag>`
- `gocddev/gocd-dev-build:windows2022-<github_tag>`

To build a new version of the images, push a new version tag to this repository.

# Build an image locally

- ```docker build . -t gocddev/gocd-dev-build:dind-SNAPSHOT -f Dockerfile.dind```
- ```docker build . -t gocddev/gocd-dev-build:centos-8-SNAPSHOT -f Dockerfile.centos```
- ```docker build . -t gocddev/gocd-dev-build:ubuntu-20-04-SNAPSHOT -f Dockerfile.ubuntu```
- ```docker build . -t gocddev/gocd-dev-build:windows2019-SNAPSHOT -f Dockerfile.windowsservercore2019```
- ```docker build . --pull -t gocddev/gocd-dev-build:dind-SNAPSHOT -f dind.Dockerfile```
- ```docker build . --pull -t gocddev/gocd-dev-build:rhelcompat-9-SNAPSHOT -f rhel-compat.Dockerfile```
- ```docker build . --pull -t gocddev/gocd-dev-build:ubuntu-24-04-SNAPSHOT -f ubuntu.Dockerfile```
- ```docker build . --pull -t gocddev/gocd-dev-build:windows2022-SNAPSHOT -f windowsservercore.Dockerfile```


# Publish
9 changes: 9 additions & 0 deletions dind.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM gocd/gocd-agent-docker-dind:v25.1.0
LABEL org.opencontainers.image.authors="GoCD Team <go-cd-dev@googlegroups.com>"

USER root
RUN apk upgrade --no-cache --ignore alpine-baselayout && \
apk add --no-cache ruby-rake ruby-dev build-base && \
gem install bundler json docker-api --no-document

USER go
10 changes: 0 additions & 10 deletions provision/bootstrap.sh

This file was deleted.

2 changes: 1 addition & 1 deletion provision/bundle-config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is managed by chef. Any changes will be lost.
# This file is managed by automation. Any changes will be lost.

---
BUNDLE_RETRY: "3"
2 changes: 1 addition & 1 deletion provision/gocd-sudoers
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is managed by chef, any changes will be lost
# This file is managed by automation, any changes will be lost

go ALL=(ALL) NOPASSWD:ALL

21 changes: 0 additions & 21 deletions provision/init-gradle-cache.ps1

This file was deleted.

23 changes: 5 additions & 18 deletions provision/init.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// This file is managed by chef. Any changes will be lost.
// This file is managed by automation. Any changes will be lost.
//

import org.gradle.util.GradleVersion
@@ -10,31 +10,18 @@ addListener new BuildAdapter() {
// As soon as the projects are loaded, we add our repository before any other repositories
gradle.rootProject {
buildscript.repositories {
maven { url "https://nexus.gocd.io/repository/internal" }
maven { url = "https://nexus.gocd.io/repository/internal" }
}
repositories {
maven { url "https://nexus.gocd.io/repository/internal" }
maven { url = "https://nexus.gocd.io/repository/internal" }
}
}
gradle.rootProject.allprojects {
buildscript.repositories {
maven { url "https://nexus.gocd.io/repository/internal" }
maven { url = "https://nexus.gocd.io/repository/internal" }
}
repositories {
maven { url "https://nexus.gocd.io/repository/internal" }
}
}
}
}

// if a build cache url is specified, use it
if (System.getenv().containsKey('GOCD_BUILD_CACHE_URL')) {
gradle.settingsEvaluated { settings ->
settings.buildCache {

remote(org.gradle.caching.http.HttpBuildCache) {
url = System.getenv().get('GOCD_BUILD_CACHE_URL')
push = true
maven { url = "https://nexus.gocd.io/repository/internal" }
}
}
}
74 changes: 0 additions & 74 deletions provision/install-packages.ps1

This file was deleted.

104 changes: 0 additions & 104 deletions provision/nodenv-installer

This file was deleted.

2 changes: 1 addition & 1 deletion provision/npmrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# This file is managed by chef. Any changes will be lost.
# This file is managed by automation. Any changes will be lost.

registry=https://nexus.gocd.io/repository/npmjs.org-proxy/
289 changes: 0 additions & 289 deletions provision/provision-centos.sh

This file was deleted.

5 changes: 5 additions & 0 deletions provision/provision-choco.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Write-Host "Installing packages..."
&"$PSScriptroot\provision-install-packages-choco.ps1"
Write-Host "Initializing Gradle cache for gocd..."
&"$PSScriptroot\provision-init-gradle-cache.ps1"
Write-Host "Completed provisioning (layer now exporting...)"
113 changes: 31 additions & 82 deletions provision/common.sh → provision/provision-common.sh
Original file line number Diff line number Diff line change
@@ -47,134 +47,79 @@ function setup_git_config() {
copy_to_home_dir gitconfig .gitconfig
}

# devtools

function install_rbenv() {
# in case this exists, remove it; the installer will try to symlink this into ~go/.rbenv/versions
try rm -rf /opt/rubies

cat <<-EOF > /etc/profile.d/rbenv.sh
export PATH="\$HOME/.rbenv/bin:\$PATH"
if command -v rbenv &> /dev/null; then
eval "\$(rbenv init -)"
fi
EOF
try su - "${PRIMARY_USER:-go}" -c "bash /usr/local/src/provision/rbenv-installer"
try su - "${PRIMARY_USER:-go}" -c "git -C \"\$(rbenv root)/plugins\" clone https://github.com/tpope/rbenv-aliases"

echo "Validating rbenv installation"
try su - "${PRIMARY_USER:-go}" -c "curl -fsSL https://raw.githubusercontent.com/rbenv/rbenv-installer/master/bin/rbenv-doctor | bash"
# Install multi-tool version manager mise: https://mise.jdx.dev/
function install_mise_tools() {
try su - "${PRIMARY_USER:-go}" -c "curl https://mise.run | sh"
try su - "${PRIMARY_USER:-go}" -c "mise -v && mise use --global ${*}"
try su - "${PRIMARY_USER:-go}" -c "echo \"export PATH=\"\$HOME/.local/share/mise/shims:\$PATH\"\" >> ~/.bash_profile"
}

function install_nodenv() {
# in case this exists, remove it; the installer will try to symlink this into ~go/.nodenv/versions; and yes,
# even though this is nodenv and not rbenv...
try rm -rf /opt/rubies

cat <<-EOF > /etc/profile.d/nodenv.sh
export PATH="\$HOME/.nodenv/bin:\$PATH"
if command -v nodenv &> /dev/null; then
eval "\$(nodenv init -)"
fi
EOF
try su - "${PRIMARY_USER:-go}" -c "bash /usr/local/src/provision/nodenv-installer"
try su - "${PRIMARY_USER:-go}" -c "git -C \"\$(nodenv root)/plugins\" clone https://github.com/nodenv/node-build-update-defs"
try su - "${PRIMARY_USER:-go}" -c "git -C \"\$(nodenv root)/plugins\" clone https://github.com/nodenv/nodenv-aliases"

echo "Validating nodenv installation"
try su - "${PRIMARY_USER:-go}" -c "curl -fsSL https://raw.githubusercontent.com/nodenv/nodenv-installer/master/bin/nodenv-doctor | bash"
}

function install_jabba() {
try su - ${PRIMARY_USER:-go} -c 'curl -sL https://github.com/shyiko/jabba/raw/master/install.sh | bash'
}

function major_minor() {
local version="$1"
printf "$(printf $version | cut -d. -f1).$(printf $version | cut -d. -f2)"
}

function install_global_ruby() {
local version="$1"
try su - "${PRIMARY_USER:-go}" -c "rbenv install $version && rbenv global $(major_minor $version) && echo \"Default ruby version: \$(ruby --version)\""
try su - "${PRIMARY_USER:-go}" -c "gem install rake bundler && rbenv rehash && rake --version && bundle --version"
}

function install_global_node() {
local version="$1"
try su - "${PRIMARY_USER:-go}" -c "nodenv install $version && nodenv global $(major_minor $version) && echo \"Default node version: \$(node --version)\""
function install_ruby_default_gems() {
try su - "${PRIMARY_USER:-go}" -c "gem install rake --no-document && rake --version"
}

function install_yarn() {
try su - "${PRIMARY_USER:-go}" -c "npm install -g yarn && nodenv rehash && yarn --version"
try su - "${PRIMARY_USER:-go}" -c "corepack enable && mise reshim && yarn --version"
}

function install_gauge() {
local version="$1"
try curl -sL -O https://github.com/getgauge/gauge/releases/download/v$version/gauge-$version-linux.x86_64.zip
try unzip -d /usr/bin gauge-$version-linux.x86_64.zip
try gauge -v
}
try bash -c "curl --silent --show-error --location https://downloads.gauge.org/stable | sh -s -- --location=/usr/bin"

function install_jdks() {
if [ $# -eq 0 ]; then
die "install_jdks() must be given at least 1 version argument"
fi

for version in $@; do
try su - ${PRIMARY_USER:-go} -c "jabba install openjdk@1.${version}"
for plugin in ruby html-report screenshot; do
try su - "$PRIMARY_USER" -c "gauge install ${plugin}"
done

try su - "$PRIMARY_USER" -c "gauge -v"
}

function default_jdk() {
try su - ${PRIMARY_USER:-go} -c "jabba use openjdk@1.$1"
function install_awscli() {
try curl --silent --fail --location "https://awscli.amazonaws.com/awscli-exe-linux-$(arch).zip" --output "/tmp/awscliv2.zip"
try unzip -q /tmp/awscliv2.zip
try ./aws/install
try rm -rf /aws /tmp/awscliv2.zip
}

function install_maven() {
local version="$1"
try mkdir -p /opt/local/
try curl --silent --fail --location http://archive.apache.org/dist/maven/maven-3/${version}/binaries/apache-maven-${version}-bin.zip --output /usr/local/src/apache-maven-${version}-bin.zip
try curl --silent --fail --location https://dlcdn.apache.org/maven/maven-3/${version}/binaries/apache-maven-${version}-bin.zip --output /usr/local/src/apache-maven-${version}-bin.zip
try unzip -q /usr/local/src/apache-maven-${version}-bin.zip -d /opt/local
try ln -sf /opt/local/apache-maven-${version}/bin/mvn /usr/local/bin/mvn
}

function install_ant() {
local version="$1"
try mkdir -p /opt/local/
try curl --silent --fail --location http://archive.apache.org/dist/ant/binaries/apache-ant-${version}-bin.zip --output /usr/local/src/apache-ant-${version}-bin.zip
try curl --silent --fail --location https://dlcdn.apache.org/ant/binaries/apache-ant-${version}-bin.zip --output /usr/local/src/apache-ant-${version}-bin.zip
try unzip -q /usr/local/src/apache-ant-${version}-bin.zip -d /opt/local
try ln -sf /opt/local/apache-ant-${version}/bin/ant /usr/local/bin/ant
}

function install_geckodriver() {
local URL="$(curl --silent --fail --location https://github-api-proxy.gocd.org/repos/mozilla/geckodriver/releases/latest | jq -r '.assets[] | select(.name | endswith("linux64.tar.gz")) | .browser_download_url')"
local arch="$(if [ "$(arch)" == "x86_64" ]; then echo "linux64"; else echo "linux-aarch64"; fi)"
local URL="$(curl --silent --fail --location https://github-api-proxy.gocd.org/repos/mozilla/geckodriver/releases/latest | jq -r ".assets[] | select(.name | endswith(\"$arch.tar.gz\")) | .browser_download_url")"
try curl --silent --fail --location "${URL}" --output /usr/local/src/geckodriver-latest.tar.gz
try tar -zxf /usr/local/src/geckodriver-latest.tar.gz -C /usr/local/bin
}

# startup services

function install_tini() {
local URL="$(curl --silent --fail --location https://github-api-proxy.gocd.org/repos/krallin/tini/releases/latest | jq -r '.assets[] | select(.name | endswith("-static-amd64")) | .browser_download_url' | grep -v muslc)"
local arch="$(if [ "$(arch)" == "x86_64" ]; then echo "amd64"; else echo "arm64"; fi)"
local URL="$(curl --silent --fail --location https://github-api-proxy.gocd.org/repos/krallin/tini/releases/latest | jq -r ".assets[] | select(.name | endswith(\"-static-$arch\")) | .browser_download_url" | grep -v muslc)"
try curl -fsSL --output /usr/bin/tini "$URL"
try chmod a+rx /usr/bin/tini
try tini --version
}

function add_golang_gocd_bootstrapper() {
local URL="$(curl -fsSL https://github-api-proxy.gocd.org/repos/ketan/gocd-golang-bootstrapper/releases/latest | jq -r '.assets[] | select(.name | endswith("linux.amd64")) | .browser_download_url')"
local arch="$(if [ "$(arch)" == "x86_64" ]; then echo "amd64"; else echo "arm64"; fi)"
local URL="$(curl -fsSL https://github-api-proxy.gocd.org/repos/gocd-contrib/gocd-golang-bootstrapper/releases/latest | jq -r ".assets[] | select(.name | endswith(\"linux.$arch\")) | .browser_download_url")"
try curl -fsSL --output /go/go-agent "${URL}"
try chown go:go /go/go-agent
try chmod a+rx /go/go-agent
}

function setup_entrypoint() {
try cp /usr/local/src/provision/with-java /usr/local/bin/with-java
try cp /usr/local/src/provision/bootstrap.sh /bootstrap.sh
try chmod a+rx /usr/local/bin/with-java
try chmod a+rx /bootstrap.sh
}

# helpers

function print_versions_summary() {
@@ -201,8 +146,12 @@ printf "yarn version:\n"
yarn --version | pr -to 2
printf "\n"
printf "aws version:\n"
aws --version | pr -to 2
printf "\n"
printf "Installed JDKs:\n"
jabba ls | pr -to 2
mise list java
printf "\n"
if type gauge &> /dev/null; then
21 changes: 21 additions & 0 deletions provision/provision-init-gradle-cache.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Running gradle task to install gradle

$ErrorActionPreference = "Stop"

Write-Host "Building gocd to install gradle and build gradle cache..."
git clone https://github.com/gocd/gocd --depth 1 C:\\gocd --quiet
cd C:\\gocd
yarn config set network-timeout 300000
./gradlew compileAll yarnInstall --no-build-cache --quiet
yarn config delete network-timeout

Write-Host "Cleaning up build artifacts..."
./gradlew clean --no-build-cache --quiet
Write-Host "Stopping Gradle daemons..."
./gradlew --stop
Write-Host "Cleaning up entire gocd clone..."
cd \
cmd.exe /c "rmdir /s /q C:\\gocd"

New-Item C:\\go -ItemType Directory | Out-Null
Write-Host "Cleaned."
76 changes: 76 additions & 0 deletions provision/provision-install-packages-choco.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
$JAVA_VERSION='21.0.5.11'
$NODEJS_VERSION='22.13.1'
$RUBY_VERSION='3.4.1.1'

$GOLANG_BOOTSTRAPPER_VERSION='2.24'
$P4D_VERSION='24.1'

# Copy over configs
New-Item "${env:USERPROFILE}\.gradle" -ItemType Directory | Out-Null
New-Item "${env:USERPROFILE}\.m2" -ItemType Directory | Out-Null
New-Item "${env:USERPROFILE}\.bundle" -ItemType Directory | Out-Null

Copy-Item "$PSScriptroot\bundle-config" "${env:USERPROFILE}\.bundle\config"
Copy-Item "$PSScriptroot\gitconfig-windows" "${env:USERPROFILE}\.gitconfig"
Copy-Item "$PSScriptroot\init.gradle" "${env:USERPROFILE}\.gradle\init.gradle"
Copy-Item "$PSScriptroot\npmrc" "${env:USERPROFILE}\.npmrc"
Copy-Item "$PSScriptroot\settings.xml" "${env:USERPROFILE}\.m2\settings.xml"

function PrefixToSystemAndCurrentPath {
param (
[Parameter(Mandatory=$true)]
[string]$PathPrefix
)
$newSystemPath = "$PathPrefix;" + [System.Environment]::GetEnvironmentVariable("Path", [EnvironmentVariableTarget]::Machine)
$env:Path = $newSystemPath + ";" + [System.Environment]::GetEnvironmentVariable("Path", [EnvironmentVariableTarget]::User)
[Environment]::SetEnvironmentVariable("Path", $newSystemPath, [EnvironmentVariableTarget]::Machine)
}

# install chocolatey
$chocolateyUseWindowsCompression = 'true'
$env:chocolateyUseWindowsCompression = 'true'
$ErrorActionPreference = "Stop"
$progressPreference = 'silentlyContinue'
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process -Force
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

$env:ChocolateyInstall = Convert-Path "$((Get-Command choco).path)\..\.."
Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
RefreshEnv

# install packages
choco install --no-progress -y nodejs --version="${NODEJS_VERSION}"
RefreshEnv
corepack enable
yarn --version

choco install --no-progress -y temurin --version="${JAVA_VERSION}"
choco install --no-progress -y git --params "/NoAutoCrlf"
choco install --no-progress -y nant ant hg sliksvn gnupg awscli
choco install --no-progress -y --ignore-checksums p4 # Ignore checksums due to package not using repeatable build links to downloads
choco install --no-progress -y windows-sdk-11-version-22h2-all --install-arguments='/features OptionId.SigningTools /ceip off'
choco install --no-progress -y --ignore-checksums googlechrome # Ignore checksums due to package not using repeatable build links to downloads

choco install --no-progress -y ruby --version="${RUBY_VERSION}"
# Install MSYS2 and dev toolchain for compiling certain native Ruby extensions, introduced for google-protobuf 3.25.0+
# Following pattern at https://community.chocolatey.org/packages/msys2#description
$msysInstallDir = "C:\tools\msys64"
choco install --no-progress -y msys2 --params "/NoUpdate /InstallDir:${msysInstallDir}"
RefreshEnv
PrefixToSystemAndCurrentPath("${msysInstallDir}\ucrt64\bin;${msysInstallDir}\usr\bin") # Manually add MSYS2 and tools to path to avoid having to do shell-specific "ridk enable" in builds.
ridk install 2 3 # Update packages and install development toolchain

# Remove chocolatey from temp location
Remove-Item C:\\Users\\ContainerAdministrator\\AppData\\Local\\Temp\\chocolatey -Force -Recurse | Out-Null

# install p4d / helix-core-server
New-Item "${env:ProgramFiles}\\Perforce\\bin\\" -ItemType Directory | Out-Null
Invoke-WebRequest https://cdist2.perforce.com/perforce/r$P4D_VERSION/bin.ntx64/p4d.exe -Outfile "${env:ProgramFiles}\\Perforce\\bin\\p4d.exe"
PrefixToSystemAndCurrentPath("${env:ProgramFiles}\\Perforce\\bin")

# install gocd bootstrapper
Invoke-WebRequest https://github.com/gocd-contrib/gocd-golang-bootstrapper/releases/download/${GOLANG_BOOTSTRAPPER_VERSION}/go-bootstrapper-${GOLANG_BOOTSTRAPPER_VERSION}.windows.amd64.exe -Outfile C:\\go-agent.exe

Add-LocalGroupMember -Group "Administrators" -Member "ContainerAdministrator"
70 changes: 70 additions & 0 deletions provision/provision-install-packages-winget.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
$JAVA_VERSION='21.0.5.11'
$NODEJS_VERSION='22.13.1'

$GOLANG_BOOTSTRAPPER_VERSION='2.24'
$P4_VERSION='24.1'
$ANT_VERSION='1.10.15'
$NANT_VERSION='0.92'

# Copy over configs
New-Item "${env:USERPROFILE}\.gradle" -ItemType Directory | Out-Null
New-Item "${env:USERPROFILE}\.m2" -ItemType Directory | Out-Null
New-Item "${env:USERPROFILE}\.bundle" -ItemType Directory | Out-Null

Copy-Item "$PSScriptroot\bundle-config" "${env:USERPROFILE}\.bundle\config"
Copy-Item "$PSScriptroot\gitconfig-windows" "${env:USERPROFILE}\.gitconfig"
Copy-Item "$PSScriptroot\init.gradle" "${env:USERPROFILE}\.gradle\init.gradle"
Copy-Item "$PSScriptroot\npmrc" "${env:USERPROFILE}\.npmrc"
Copy-Item "$PSScriptroot\settings.xml" "${env:USERPROFILE}\.m2\settings.xml"

function Winget-Install {
winget install --accept-source-agreements --accept-package-agreements --disable-interactivity @args
}

function PrefixToSystemAndCurrentPath {
param (
[Parameter(Mandatory=$true)]
[string]$PathPrefix
)
$newSystemPath = "$PathPrefix;" + [System.Environment]::GetEnvironmentVariable("Path", [EnvironmentVariableTarget]::Machine)
$env:Path = $newSystemPath + ";" + [System.Environment]::GetEnvironmentVariable("Path", [EnvironmentVariableTarget]::User)
[Environment]::SetEnvironmentVariable("Path", $newSystemPath, [EnvironmentVariableTarget]::Machine)
}

# install packages
Winget-Install OpenJS.NodeJS.LTS --version="${NODEJS_VERSION}"
corepack enable
yarn --version

Winget-Install EclipseAdoptium.Temurin.21.JDK --version="${JAVA_VERSION}"

Winget-Install Git.Git Mercurial.Mercurial Slik.Subversion GnuPG.GnuPG Amazon.AWSCLI Google.Chrome
git config --global core.autocrlf false

Winget-Install Microsoft.WindowsSDK --override='/features OptionId.SigningTools /ceip off'

Winget-Install RubyInstallerTeam.RubyWithDevKit.3.2
ridk install 2 3 # Update packages and install development toolchain

# install p4 client and p4d / helix-core-server
New-Item "${env:ProgramFiles}\\Perforce\\bin\\" -ItemType Directory | Out-Null
PrefixToSystemAndCurrentPath("${env:ProgramFiles}\\Perforce\\bin")
Invoke-WebRequest https://cdist2.perforce.com/perforce/r$P4_VERSION/bin.ntx64/p4.exe -Outfile "${env:ProgramFiles}\\Perforce\\bin\\p4.exe"
Invoke-WebRequest https://cdist2.perforce.com/perforce/r$P4_VERSION/bin.ntx64/p4d.exe -Outfile "${env:ProgramFiles}\\Perforce\\bin\\p4d.exe"

# Install ant
Invoke-WebRequest https://dlcdn.apache.org//ant/binaries/apache-ant-${ANT_VERSION}-bin.zip -Outfile "${env:TEMP}\\ant.zip"
Expand-Archive -Path "${env:TEMP}\\ant.zip" -DestinationPath "C:\\tools"
PrefixToSystemAndCurrentPath("C:\\tools\\apache-ant-${ANT_VERSION}\\bin")
Remove-Item "${env:TEMP}\\ant.zip" -Force

# Install nant
Invoke-WebRequest https://onboardcloud.dl.sourceforge.net/project/nant/nant/${NANT_VERSION}/nant-${NANT_VERSION}-bin.zip?viasf=1 -Outfile "${env:TEMP}\\nant.zip"
Expand-Archive -Path "${env:TEMP}\\nant.zip" -DestinationPath "C:\\tools"
PrefixToSystemAndCurrentPath("C:\\tools\\nant-${NANT_VERSION}\\bin")
Remove-Item "${env:TEMP}\\nant.zip" -Force

# install gocd bootstrapper
Invoke-WebRequest https://github.com/gocd-contrib/gocd-golang-bootstrapper/releases/download/${GOLANG_BOOTSTRAPPER_VERSION}/go-bootstrapper-${GOLANG_BOOTSTRAPPER_VERSION}.windows.amd64.exe -Outfile C:\\go-agent.exe

Add-LocalGroupMember -Group "Administrators" -Member "ContainerAdministrator"
259 changes: 259 additions & 0 deletions provision/provision-rhel-compat.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,259 @@
#!/bin/bash

PRIMARY_USER="go"
GRADLE_OPTIONS="--stacktrace --no-daemon"

for arg in $@; do
case $arg in
--contrib)
PRIMARY_USER="dojo"
SKIP_INTERNAL_CONFIG="yes"
shift
;;
*)
shift
;;
esac
done

NSIS_VERSION=3.10-1.el9 # https://nsis.sourceforge.io/Docs/AppendixF.html / https://github.com/gocd/nsis-rpm/tree/gh-pages/rpms
MAVEN_VERSION=3.9.9 # https://maven.apache.org/docs/history.html
ANT_VERSION=1.10.15 # https://ant.apache.org/bindownload.cgi
P4_VERSION=24.1 # https://cdist2.perforce.com/perforce/
P4D_VERSION=24.1

RHEL_COMPAT_MAJOR_VERSION=$(rpm -qa \*-release | grep -oiP "(oracle|redhat|centos|alma|rocky).*-release-\K[0-9]+")
# import functions
source "$(dirname $0)/provision-common.sh"

# Main entrypoint
function provision() {
step setup_external_repos
step upgrade_os_packages

# these are build prereqs for subsequent things; install
# these early during provision
step install_basic_utils
step install_native_build_packages

if [ "${SKIP_INTERNAL_CONFIG}" != "yes" ]; then
# setup gocd user to use internal mirrors for builds
step add_gocd_user
fi

# git, in particular, is used in subsequent provisioning so do this before things like `mise`
step install_scm_tools

step install_mise_tools \
"java@temurin-21.0.6+7.0.LTS" \
"ruby@3.3.7" \
"node@22.13.1"
step install_ruby_default_gems
step install_yarn

step install_maven "$MAVEN_VERSION"
step install_ant "$ANT_VERSION"

step install_gauge
step install_installer_tools
step install_awscli_mimetypes
step install_awscli

step setup_postgres_repo # See https://endoflife.date/postgresql
step install_postgresql "14"
step install_postgresql "15"
step install_postgresql "16"
step install_postgresql "17"

step install_geckodriver
step install_firefox_dependencies
step install_firefox_latest

# On Docker for Mac, make sure you allocate more than 2G of memory or
# gradle might randomly fail; 6G should be fairly reliable.
if [ "${BUILDARCH}" == "${TARGETARCH}" ]; then
# only do a pre-build to cache dependencies when not cross-compiling
step build_gocd
fi

if [ "${SKIP_INTERNAL_CONFIG}" != "yes" ]; then
step install_docker
step install_regctl
step setup_nexus_configs
step add_golang_gocd_bootstrapper
fi

step install_tini

step list_installed_packages
step clean

step print_versions_summary
}

function setup_epel() {
try dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-${RHEL_COMPAT_MAJOR_VERSION}.noarch.rpm
}

function setup_external_repos() {
try echo 'fastestmirror=1' >> /etc/dnf/dnf.conf
try echo 'install_weak_deps=False' >> /etc/dnf/dnf.conf

setup_epel

try dnf -y install "dnf-command(config-manager)"
try dnf config-manager --set-enabled crb
}

function install_basic_utils() {
try dnf -y install procps ncurses file which bzip2 gzip unzip zip sudo curl-minimal wget jq
}

function install_native_build_packages() {
# Core stuff
try dnf -y install autoconf automake make patch

# Ruby-build dependencies for Mise: https://github.com/rbenv/ruby-build/wiki#rhelcentos
# Also see https://docs.ruby-lang.org/en/3.3/contributing/building_ruby_md.html
try dnf -y install autoconf gcc patch bzip2 openssl-devel libyaml-devel zlib-devel
}

function install_scm_tools() {
install_git
try dnf -y install mercurial
try dnf -y install subversion

try git --version
try hg --version
try svn --version

if [ "$(arch)" == "x86_64" ]; then
try mkdir -p /usr/local/bin
try curl --silent --fail --location "https://cdist2.perforce.com/perforce/r${P4_VERSION}/bin.linux26x86_64/p4" --output /usr/local/bin/p4
try curl --silent --fail --location "https://cdist2.perforce.com/perforce/r${P4D_VERSION}/bin.linux26x86_64/p4d" --output /usr/local/bin/p4d
try chmod 755 /usr/local/bin/p4 /usr/local/bin/p4d
try p4 -V
try p4d -V
fi
}

function install_git() {
try dnf -y install git-core

if [ "${SKIP_INTERNAL_CONFIG}" != "yes" ]; then
setup_git_config
fi
}

function install_installer_tools() {
try dnf -y install \
xz-lzma-compat \
dpkg-devel dpkg-dev \
createrepo yum-utils rpm-build rpm-sign fakeroot \
gnupg2

if [ "$(arch)" == "x86_64" ]; then
try dnf -y install "http://gocd.github.io/nsis-rpm/rpms/mingw-nsis-base-${NSIS_VERSION}.$(arch).rpm"
try dnf -y install "http://gocd.github.io/nsis-rpm/rpms/mingw64-nsis-${NSIS_VERSION}.noarch.rpm"
try dnf -y install "http://gocd.github.io/nsis-rpm/rpms/mingw32-nsis-${NSIS_VERSION}.noarch.rpm"
fi

try su - "$PRIMARY_USER" -c "gem install fpm --no-document"
}

function install_awscli_mimetypes() {
# `/etc/mime.types` is required by aws cli so it can generate appropriate `content-type` headers when uploading to s3.
# Without this file, all files in s3 will have content type `application/octet-stream`
# See https://github.com/aws/aws-cli/issues/1249
try dnf -y install mailcap
}

function setup_postgres_repo() {
try dnf -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-$RHEL_COMPAT_MAJOR_VERSION-$(arch)/pgdg-redhat-repo-latest.noarch.rpm
}

function install_postgresql() {
local pg_version="$1"
package_suffix="$(printf "${pg_version}" | sed -e 's/\.//g')"
try dnf -y install postgresql${package_suffix} postgresql${package_suffix}-server postgresql${package_suffix}-contrib
}

function install_firefox_dependencies() {
# install just the FF dependencies, without FF
# shellcheck disable=SC2046
try dnf -y install $(dnf deplist -y --arch "$(arch)" --latest-limit=1 firefox | awk '/provider:/ {print $2}' | sort -u)
}

function install_firefox_latest() {
if [ "$(arch)" == "x86_64" ]; then
# latest versions of FF
try mkdir -p /opt/local/firefox
try mkdir -p /opt/local/firefox-latest
try curl --silent --fail --location 'https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=en-US' --output /usr/local/src/firefox-latest.tar.bz2
try tar -jxf /usr/local/src/firefox-latest.tar.bz2 -C /opt/local/firefox-latest --strip-components=1

try ln -sf /opt/local/firefox-latest/firefox /usr/local/bin/firefox
try /opt/local/firefox-latest/firefox -version
else
# Install latest official LTS/ESR release that is available for the platform
try dnf -y install firefox
fi
try firefox -version
}

function list_installed_packages() {
try bash -c "rpm -qa | sort"
}

function clean() {
try dnf clean all
try rm -rf /var/cache/dnf
try rm -rf /usr/local/src/*
}

function upgrade_os_packages() {
try dnf -y upgrade --quiet
}

function build_gocd() {
if [ "$(how_much_memory_in_gb)" -lt 6 ]; then
yellowalert " "
yellowalert "////////////////////////////////////////////////////////////////////////////////"
yellowalert "//// Warning! ////"
yellowalert "////////////////////////////////////////////////////////////////////////////////"
yellowalert " "
yellowalert "Your Docker container has less than 6GB of RAM allocated. Building the GoCD "
yellowalert "codebase may intermittently fail. For best results, allocate AT LEAST 4G of RAM "
yellowalert "to this container. "
yellowalert " "
yellowalert "No, really. In fact, I'd recommend 6G to be safe. "
yellowalert " "
yellowalert "As Biggie once said: \"Mo' RAM, fewer problems...\" "
yellowalert " "
yellowalert " (he didn't really say that) "
yellowalert " "
printf "\n"
fi

try su - ${PRIMARY_USER} -c "git clone --depth 1 https://github.com/gocd/gocd /tmp/gocd && \
cd /tmp/gocd && \
mise install && \
./gradlew compileAll yarnInstall --no-build-cache --max-workers 4 --quiet ${GRADLE_OPTIONS}"
try rm -rf /tmp/gocd /${PRIMARY_USER}/.gradle/caches/build-cache-*
}

function install_docker() {
try dnf config-manager --add-repo https://download.docker.com/linux/rhel/docker-ce.repo
try dnf -y install docker-ce containerd.io docker-buildx-plugin
try usermod -a -G docker ${PRIMARY_USER}
}

function install_regctl() {
local arch="$(if [ "$(arch)" == "x86_64" ]; then echo "amd64"; else echo "arm64"; fi)"
try mkdir -p /usr/local/bin
try curl --silent --fail --location "https://github.com/regclient/regclient/releases/latest/download/regctl-linux-${arch}" --output /usr/local/bin/regctl
try chmod 755 /usr/local/bin/regctl
try regctl version
}

provision
44 changes: 19 additions & 25 deletions provision/provision-ubuntu.sh
Original file line number Diff line number Diff line change
@@ -3,37 +3,33 @@
PRIMARY_USER="go"

# import functions
source "$(dirname $0)/common.sh"
source "$(dirname $0)/provision-common.sh"

function provision() {
step setup_apt_external_repos
step setup_external_repos
step upgrade_os_packages

step install_basic_utils
step install_native_build_packages

step add_gocd_user

# git, in particular, is used in subsequent provisioning so do this before things like `mise`
step install_scm_tools

step install_rbenv
step install_global_ruby "2.7.6"

step install_nodenv
step install_global_node "16.16.0"
step install_mise_tools \
"java@temurin-21.0.6+7.0.LTS" \
"ruby@3.3.7" \
"node@22.13.1"
step install_ruby_default_gems
step install_yarn

step install_jabba
step install_jdks "17"
step default_jdk "17"

step install_python
step install_awscli_mimetypes
step install_awscli

step setup_nexus_configs

step add_golang_gocd_bootstrapper
step setup_entrypoint
step install_tini

step list_installed_packages
@@ -46,7 +42,7 @@ function update_apt_cache() {
try apt-get update
}

function setup_apt_external_repos() {
function setup_external_repos() {
update_apt_cache
DEBIAN_FRONTEND=noninteractive try apt-get -y install software-properties-common
try bash -c "yes | add-apt-repository ppa:git-core/ppa"
@@ -62,27 +58,25 @@ function list_installed_packages() {
}

function install_basic_utils() {
try apt-get install -y debsigs gnupg gnupg-agent dpkg-sig apt-utils bzip2 gzip unzip zip sudo curl wget jq
}

function install_python() {
try apt-get install -y python python3-pip
try pip3 install --upgrade pip
try apt-get install -y debsigs gnupg gnupg-agent apt-utils bzip2 gzip unzip zip sudo curl wget jq
}

function install_native_build_packages() {
try apt-get install -y build-essential zlib1g-dev libcurl4 libssl-dev
# Ruby-build dependencies for mise: https://github.com/rbenv/ruby-build/wiki#ubuntudebianmint
# Also see https://docs.ruby-lang.org/en/3.3/contributing/building_ruby_md.html
try apt-get install -y autoconf patch build-essential libssl-dev libyaml-dev zlib1g-dev
}

function install_scm_tools() {
try apt-get install -y git subversion
setup_git_config
}

function install_awscli() {
# `/etc/mime.types` is required by aws cli so it can generate appropriate `content-type` headers when uploading to s3. Without this file, all files in s3 will have content type `application/octet-stream`
try apt-get install -y mime-support
try pip3 install awscli
function install_awscli_mimetypes() {
# `/etc/mime.types` is required by aws cli so it can generate appropriate `content-type` headers when uploading to s3.
# Without this file, all files in s3 will have content type `application/octet-stream`
# See https://github.com/aws/aws-cli/issues/1249
try apt-get install -y media-types
}

function clean() {
5 changes: 5 additions & 0 deletions provision/provision-winget.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Write-Host "Installing packages..."
&"$PSScriptroot\provision-install-packages-winget.ps1"
Write-Host "Initializing Gradle cache for gocd..."
&"$PSScriptroot\provision-init-gradle-cache.ps1"
Write-Host "Completed provisioning (layer now exporting...)"
2 changes: 0 additions & 2 deletions provision/provision.ps1

This file was deleted.

102 changes: 0 additions & 102 deletions provision/rbenv-installer

This file was deleted.

14 changes: 7 additions & 7 deletions provision/settings.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<mirrors>
<mirror>
<id>internal-repository</id>
<name>Maven Repository Manager running on nexus.gocd.io</name>
<url>https://nexus.gocd.io/repository/internal</url>
<mirrorOf>*</mirrorOf>
</mirror>
</mirrors>
<mirror>
<id>internal-repository</id>
<name>Maven Repository Manager running on nexus.gocd.io</name>
<url>https://nexus.gocd.io/repository/internal</url>
<mirrorOf>*</mirrorOf>
</mirror>
</mirrors>
</settings>
6 changes: 0 additions & 6 deletions provision/with-java

This file was deleted.

17 changes: 0 additions & 17 deletions provision/with-java.ps1

This file was deleted.

20 changes: 20 additions & 0 deletions rhel-compat.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM almalinux:9
LABEL org.opencontainers.image.authors="GoCD Team <go-cd-dev@googlegroups.com>"

ARG BUILDARCH
ARG TARGETARCH

COPY provision /usr/local/src/provision/

RUN /usr/local/src/provision/provision-rhel-compat.sh

ENTRYPOINT ["/usr/bin/tini", "--"]

USER go

# force encoding
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US:en
ENV LC_ALL=en_US.UTF-8

CMD ["/bin/bash", "-lc", "/go/go-agent"]
17 changes: 17 additions & 0 deletions ubuntu.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM ubuntu:24.04
LABEL org.opencontainers.image.authors="GoCD Team <go-cd-dev@googlegroups.com>"

COPY provision /usr/local/src/provision/

RUN /usr/local/src/provision/provision-ubuntu.sh

ENTRYPOINT ["/usr/bin/tini", "--"]

USER go

# force encoding
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US:en
ENV LC_ALL=en_US.UTF-8

CMD ["/bin/bash", "-lc", "/go/go-agent"]
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019
FROM mcr.microsoft.com/windows/servercore:ltsc2025
LABEL org.opencontainers.image.authors="GoCD Team <go-cd-dev@googlegroups.com>"

# Shamelessly nabbed from https://github.com/gantrior/docker-chrome-windows
#
# Fonts are needed for Chrome to launch and function. Windows Server Core 2019
# Fonts are needed for Chrome to launch and function. Windows Server Core
# does not include fonts, so we need to install them ourselves.
ADD Files/FontsToAdd.tar /Fonts/
WORKDIR /Fonts/
@@ -14,6 +15,6 @@ ENV TMP=C:\\tmp \

COPY provision C:\\Users\\ContainerAdministrator\\provision

RUN powershell -File C:\\Users\\ContainerAdministrator\\provision\\provision.ps1
RUN powershell -File C:\\Users\\ContainerAdministrator\\provision\\provision-winget.ps1

CMD ["powershell", "-File", "C:\\Users\\ContainerAdministrator\\provision\\with-java.ps1", "C:\\go-agent.exe"]
CMD ["C:\\go-agent.exe"]
20 changes: 20 additions & 0 deletions windowsservercore.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM mcr.microsoft.com/windows/servercore:ltsc2022
LABEL org.opencontainers.image.authors="GoCD Team <go-cd-dev@googlegroups.com>"

# Shamelessly nabbed from https://github.com/gantrior/docker-chrome-windows
#
# Fonts are needed for Chrome to launch and function. Windows Server Core
# does not include fonts, so we need to install them ourselves.
ADD Files/FontsToAdd.tar /Fonts/
WORKDIR /Fonts/
RUN powershell -File .\\Add-Font.ps1 Fonts
WORKDIR /

ENV TMP=C:\\tmp \
TEMP=C:\\tmp

COPY provision C:\\Users\\ContainerAdministrator\\provision

RUN powershell -File C:\\Users\\ContainerAdministrator\\provision\\provision-choco.ps1

CMD ["C:\\go-agent.exe"]