mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-05 13:19:35 +02:00
Add pipeline to publish ghcr multi-arch image (#2268)
Refactor operator image build process Add a pipeline to build and publish arm64/amd64 image in ghcr on every pushed tag
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
arch=$(dpkg --print-architecture)
|
||||
|
||||
set -ex
|
||||
|
||||
# Install dependencies
|
||||
|
||||
apt-get update
|
||||
apt-get install -y wget
|
||||
|
||||
(
|
||||
cd /tmp
|
||||
wget -q "https://storage.googleapis.com/golang/go1.18.9.linux-${arch}.tar.gz" -O go.tar.gz
|
||||
tar -xf go.tar.gz
|
||||
mv go /usr/local
|
||||
ln -s /usr/local/go/bin/go /usr/bin/go
|
||||
go version
|
||||
)
|
||||
|
||||
# Build
|
||||
|
||||
export PATH="$PATH:$HOME/go/bin"
|
||||
export GOPATH="$HOME/go"
|
||||
mkdir -p build
|
||||
cp scm-source.json build/
|
||||
|
||||
GO111MODULE=on go mod vendor
|
||||
CGO_ENABLED=0 go build -o build/postgres-operator -v -ldflags "$OPERATOR_LDFLAGS" cmd/main.go
|
||||
Reference in New Issue
Block a user