sourcegraph/cmd/github-proxy/build-wolfi.sh
Will Dollman b95719f528
Apply Wolfi Cloud Instance Fixes (#51263)
This PR contains all the fixes and tweaks I've made during the process
of getting the wolfi-test cloud instance working.

There's a lot going on in this PR:

Packages:
* Build comby from source - the published binary isn't compatible with
Arch/Wolfi's libpcre library path
* Build cadvisor from source - may not be necessary, but done as a
debugging step and gives us more arch flexibility
* Package s3proxy
* Update p4-fusion dependency SHA
* Bump all packages to trigger a rebuild with latest version of melange.
The old version didn't seem to pick up on dylibs properly
* Fix opentelemetry-collector binary path

Base images:
* Fix cadvisor base image
* Fix redis UID+GIDs
* Add missing p4cli package to repo-updater image
* Remove nodejs from server image (no longer required by code-intel)

Other fixes:
* Update build-wolfi.sh scripts to match the current Bazelified build.sh
scripts
* Fix `server` image builds
* Fix zoekt-webserver CMD
* Fix postgres locale + default config + add a patch for
`unix_socket_directories`
* Fix `symbols` go-build-wolfi scripts

## Things to do before merging

- [ ] Validate the new postgres patch-conf.sh script with delivery - will do post-merge
- [x] Remove all DO NOT MERGE comments

## Test plan

<!-- All pull requests REQUIRE a test plan:
https://docs.sourcegraph.com/dev/background-information/testing_principles
-->

- [x] Manual testing on wolfi-test cloud instance
- [x] Manual testing on scaletesting instance
2023-05-18 10:48:43 +01:00

44 lines
1.3 KiB
Bash
Executable File

#!/usr/bin/env bash
# We want to build multiple go binaries, so we use a custom build step on CI.
cd "$(dirname "${BASH_SOURCE[0]}")"/../..
set -ex
OUTPUT=$(mktemp -d -t sgdockerbuild_XXXXXXX)
cleanup() {
rm -rf "$OUTPUT"
}
trap cleanup EXIT
if [[ "${DOCKER_BAZEL:-false}" == "true" ]]; then
./dev/ci/bazel.sh build //cmd/github-proxy \
--stamp \
--workspace_status_command=./dev/bazel_stamp_vars.sh \
--platforms=@io_bazel_rules_go//go/toolchain:linux_amd64
out=$(./dev/ci/bazel.sh cquery //cmd/github-proxy --output=files)
cp "$out" "$OUTPUT"
docker build -f cmd/github-proxy/Dockerfile.wolfi -t "$IMAGE" "$OUTPUT" \
--progress=plain \
--build-arg COMMIT_SHA \
--build-arg DATE \
--build-arg VERSION
exit $?
fi
# Environment for building linux binaries
export GO111MODULE=on
export GOARCH=amd64
export GOOS=linux
export CGO_ENABLED=0
pkg="github.com/sourcegraph/sourcegraph/cmd/github-proxy"
go build -trimpath -ldflags "-X github.com/sourcegraph/sourcegraph/internal/version.version=$VERSION -X github.com/sourcegraph/sourcegraph/internal/version.timestamp=$(date +%s)" -buildmode exe -tags dist -o "$OUTPUT/$(basename $pkg)" "$pkg"
docker build -f cmd/github-proxy/Dockerfile.wolfi -t "$IMAGE" "$OUTPUT" \
--progress=plain \
--build-arg COMMIT_SHA \
--build-arg DATE \
--build-arg VERSION