-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Epic: none Release note: None
- Loading branch information
Showing
5 changed files
with
177 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
build/teamcity/internal/release/build-and-publish-patched-go-fips.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
google_credentials="$GOOGLE_EPHEMERAL_CREDENTIALS" | ||
dir="$(dirname $(dirname $(dirname $(dirname "${0}"))))" | ||
source "$dir/teamcity-support.sh" # for log_into_gcloud | ||
log_into_gcloud | ||
|
||
set -x | ||
|
||
this_dir="$(cd "$(dirname "${0}")"; pwd)" | ||
toplevel="$(dirname $(dirname $(dirname $(dirname $this_dir))))" | ||
|
||
mkdir -p "${toplevel}"/artifacts | ||
# TODO: pin docker image version | ||
DOCKER_IMAGE=registry.access.redhat.com/ubi8/go-toolset:latest | ||
|
||
tc_start_block "Build Go toolchains (linux/amd64)" | ||
docker run --rm -i ${tty-} -v $this_dir/build-and-publish-patched-go:/bootstrap \ | ||
-v "${toplevel}"/artifacts:/artifacts \ | ||
--user root \ | ||
--platform linux/amd64 \ | ||
$DOCKER_IMAGE /bootstrap/impl-fips.sh | ||
tc_end_block "Build Go toolchains (linux/amd64)" | ||
|
||
tc_start_block "Build Go toolchains (linux/arm64)" | ||
docker run --rm -i ${tty-} -v $this_dir/build-and-publish-patched-go:/bootstrap \ | ||
-v "${toplevel}"/artifacts:/artifacts \ | ||
--user root \ | ||
--platform linux/arm64 \ | ||
$DOCKER_IMAGE /bootstrap/impl-fips.sh | ||
tc_end_block "Build Go toolchains (linux/arm64)" | ||
|
||
tc_start_block "Publish artifacts" | ||
loc=$(date +%Y%m%d-%H%M%S) | ||
for FILE in `find $root/artifacts -name '*.tar.gz'`; do | ||
BASE=$(basename $FILE) | ||
gsutil cp $FILE gs://public-bazel-artifacts/go-fips/$loc/$BASE | ||
done | ||
tc_end_block "Publish artifacts" | ||
|
||
tc_end_block "Print checksums" | ||
sha256sum $root/artifacts/*.tar.gz | ||
tc_start_block "Print checksums" |
34 changes: 34 additions & 0 deletions
34
build/teamcity/internal/release/build-and-publish-patched-go/impl-fips.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -xeuo pipefail | ||
|
||
# TODO: create a fork? | ||
GO_FIPS_REPO=https://github.com/golang-fips/go | ||
GO_FIPS_BRANCH=go1.19-fips-release | ||
|
||
|
||
yum install git golang golang-bin openssl openssl-devel -y | ||
cat /etc/os-release | ||
go version | ||
openssl version | ||
git config --global user.name "golang-fips ci" | ||
git config --global user.email "<>" | ||
|
||
mkdir /workspace | ||
cd /workspace | ||
git clone $GO_FIPS_REPO go | ||
cd go | ||
git init | ||
git config --global --add safe.directory /__w/go/go | ||
git checkout $GO_FIPS_BRANCH | ||
sed -i "s/go mod tidy/go mod tidy -go=1.16/g" scripts/create-secondary-patch.sh | ||
./scripts/full-initialize-repo.sh | ||
./scripts/configure-crypto-tests.sh | ||
cd go/src | ||
patch -p2 < /bootstrap/diff.patch | ||
./make.bash -v | ||
cd ../.. | ||
GOVERS=$(go/bin/go env GOVERSION) | ||
GOOS=$(go/bin/go env GOOS) | ||
GOARCH=$(go/bin/go env GOARCH) | ||
tar cf - go | gzip -9 > /artifacts/$GOVERS.$GOOS-$GOARCH.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters