Skip to content

Commit

Permalink
Merge pull request #579 from cloudfoundry/consume-golang-1
Browse files Browse the repository at this point in the history
use golang-1-* and update vendor packages script
  • Loading branch information
asalan316 authored Apr 20, 2022
2 parents 80c19d9 + 9a4ab77 commit 2ea8616
Show file tree
Hide file tree
Showing 26 changed files with 56 additions and 31 deletions.
6 changes: 6 additions & 0 deletions .final_builds/packages/golang-1-linux/index.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
builds:
b8021c5bdc377a4807fb1caad8416215032698ae356825afb427c7efc5ef76c1:
version: b8021c5bdc377a4807fb1caad8416215032698ae356825afb427c7efc5ef76c1
blobstore_id: 1085db26-f5ec-42d3-7389-5750b941602a
sha1: sha256:2a2785460af04aee276c3c2b38dd914c8e1cbefbf52cb14da130207e82e86289
format-version: "2"
6 changes: 0 additions & 6 deletions .final_builds/packages/golang-1.18-linux/index.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
golang 1.18
java adoptopenjdk-11.0.12+7
golang 1.18.1
java openjdk-11
ruby 2.7.4
maven 3.6.3
nodejs 16.10.0
Expand Down
2 changes: 1 addition & 1 deletion jobs/golangapiserver/spec
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ templates:
hooks/post-start.sh.erb: bin/hooks/post-start.sh
hooks/post-stop.sh.erb: bin/hooks/post-stop.sh
packages:
- golang-1.18-linux
- golang-1-linux
- golangapiserver
- db
- openjdk-11
Expand Down
2 changes: 1 addition & 1 deletion packages/changeloglockcleaner/packaging
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
set -e -x

export GOROOT=$(readlink -nf /var/vcap/packages/golang-1.18-linux)
export GOROOT=$(readlink -nf /var/vcap/packages/golang-1-linux)
export PATH=$GOROOT/bin:$PATH
export GOPATH=${BOSH_COMPILE_TARGET}
export GOCACHE=/tmp/gocache
Expand Down
2 changes: 1 addition & 1 deletion packages/changeloglockcleaner/spec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: changeloglockcleaner

dependencies:
- golang-1.18-linux
- golang-1-linux

files:

Expand Down
2 changes: 1 addition & 1 deletion packages/eventgenerator/packaging
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
set -e -x

export GOROOT=$(readlink -nf /var/vcap/packages/golang-1.18-linux)
export GOROOT=$(readlink -nf /var/vcap/packages/golang-1-linux)
export PATH=$GOROOT/bin:$PATH
export GOPATH=${BOSH_COMPILE_TARGET}
export GOCACHE=/tmp/gocache
Expand Down
2 changes: 1 addition & 1 deletion packages/eventgenerator/spec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: eventgenerator

dependencies:
- golang-1.18-linux
- golang-1-linux

files:
- autoscaler/*
Expand Down
2 changes: 2 additions & 0 deletions packages/golang-1-linux/spec.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name: golang-1-linux
fingerprint: b8021c5bdc377a4807fb1caad8416215032698ae356825afb427c7efc5ef76c1
1 change: 1 addition & 0 deletions packages/golang-1-linux/vendored-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a7d96582bcd53009f6db424ec6868c728d02a6af
1 change: 1 addition & 0 deletions packages/golang-1-linux/version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.18.1
2 changes: 0 additions & 2 deletions packages/golang-1.18-linux/spec.lock

This file was deleted.

2 changes: 1 addition & 1 deletion packages/golangapiserver/packaging
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
set -e -x

export GOROOT=$(readlink -nf /var/vcap/packages/golang-1.18-linux)
export GOROOT=$(readlink -nf /var/vcap/packages/golang-1-linux)
export PATH=$GOROOT/bin:$PATH
export GOPATH=${BOSH_COMPILE_TARGET}
export GOCACHE=/tmp/gocache
Expand Down
2 changes: 1 addition & 1 deletion packages/golangapiserver/spec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: golangapiserver

dependencies:
- golang-1.18-linux
- golang-1-linux

files:
- autoscaler/*
Expand Down
2 changes: 1 addition & 1 deletion packages/metricsforwarder/packaging
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
set -e -x

export GOROOT=$(readlink -nf /var/vcap/packages/golang-1.18-linux)
export GOROOT=$(readlink -nf /var/vcap/packages/golang-1-linux)
export PATH=$GOROOT/bin:$PATH
export GOPATH=${BOSH_COMPILE_TARGET}
export GOCACHE=/tmp/gocache
Expand Down
2 changes: 1 addition & 1 deletion packages/metricsforwarder/spec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: metricsforwarder

dependencies:
- golang-1.18-linux
- golang-1-linux

files:
- autoscaler/*
Expand Down
2 changes: 1 addition & 1 deletion packages/metricsgateway/packaging
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
set -e -x

export GOROOT=$(readlink -nf /var/vcap/packages/golang-1.18-linux)
export GOROOT=$(readlink -nf /var/vcap/packages/golang-1-linux)
export PATH=$GOROOT/bin:$PATH
export GOPATH=${BOSH_COMPILE_TARGET}
export GOCACHE=/tmp/gocache
Expand Down
2 changes: 1 addition & 1 deletion packages/metricsgateway/spec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: metricsgateway

dependencies:
- golang-1.18-linux
- golang-1-linux

files:
- autoscaler/*
Expand Down
2 changes: 1 addition & 1 deletion packages/metricsserver/packaging
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
set -e -x

export GOROOT=$(readlink -nf /var/vcap/packages/golang-1.18-linux)
export GOROOT=$(readlink -nf /var/vcap/packages/golang-1-linux)
export PATH=$GOROOT/bin:$PATH
export GOPATH=${BOSH_COMPILE_TARGET}
export GOCACHE=/tmp/gocache
Expand Down
2 changes: 1 addition & 1 deletion packages/metricsserver/spec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: metricsserver

dependencies:
- golang-1.18-linux
- golang-1-linux

files:
- autoscaler/*
Expand Down
1 change: 1 addition & 0 deletions packages/openjdk-11/vendored-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dbdec67b4bf923f584f65dc88a247a568d46a9b0
2 changes: 1 addition & 1 deletion packages/operator/packaging
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
set -e -x

export GOROOT=$(readlink -nf /var/vcap/packages/golang-1.18-linux)
export GOROOT=$(readlink -nf /var/vcap/packages/golang-1-linux)
export PATH=$GOROOT/bin:$PATH
export GOPATH=${BOSH_COMPILE_TARGET}
export GOCACHE=/tmp/gocache
Expand Down
2 changes: 1 addition & 1 deletion packages/operator/spec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: operator

dependencies:
- golang-1.18-linux
- golang-1-linux

files:
- autoscaler/*
Expand Down
2 changes: 1 addition & 1 deletion packages/scalingengine/packaging
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
set -e -x

export GOROOT=$(readlink -nf /var/vcap/packages/golang-1.18-linux)
export GOROOT=$(readlink -nf /var/vcap/packages/golang-1-linux)
export PATH=$GOROOT/bin:$PATH
export GOPATH=${BOSH_COMPILE_TARGET}
export GOCACHE=/tmp/gocache
Expand Down
2 changes: 1 addition & 1 deletion packages/scalingengine/spec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: scalingengine

dependencies:
- golang-1.18-linux
- golang-1-linux

files:
- autoscaler/*
Expand Down
30 changes: 26 additions & 4 deletions scripts/update_vendor_packages
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,41 @@

set -euo pipefail

script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"

function vendor-package {
local release=${1}
local package=${2}

local tmpdir_name="/tmp/${release}-${RANDOM}"
mkdir -p ${tmpdir_name}
mkdir -p "${tmpdir_name}"
trap "rm -r -f ${tmpdir_name}" EXIT

pushd ${tmpdir_name}
pushd "${tmpdir_name}"
git clone --depth 1 "https://github.com/bosh-packages/${release}.git" .
vendored_commit=$(git rev-parse HEAD)
popd
bosh vendor-package ${package} ${tmpdir_name}

bosh vendor-package "${package}" "${tmpdir_name}"
echo "${vendored_commit}" >> "${script_dir}/../packages/${package}/vendored-commit"

package_version_file="${tmpdir_name}/packages/${package}/version"
if [[ -f "${package_version_file}" ]]; then
cp "${package_version_file}" "${script_dir}/../packages/${package}"
fi
}

vendor-package golang-release golang-1.18-linux
vendor-package golang-release golang-1-linux
vendor-package java-release openjdk-11

golang_version=$( cat "${script_dir}/../packages/golang-1-linux/version")
stripped_go_version=$(echo "${golang_version}" | cut -d . -f -2)

sed -i '' "s/go 1.*/go $stripped_go_version/g" "${script_dir}/../src/acceptance/go.mod"
sed -i '' "s/go 1.*/go $stripped_go_version/g" "${script_dir}/../src/autoscaler/go.mod"
sed -i '' "s/go 1.*/go $stripped_go_version/g" "${script_dir}/../src/changelog/go.mod"
sed -i '' "s/go 1.*/go $stripped_go_version/g" "${script_dir}/../src/changeloglockcleaner/go.mod"

sed -i '' "s/golang 1.*/golang $golang_version/g" "${script_dir}/../.tool-versions"


0 comments on commit 2ea8616

Please sign in to comment.