-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OCM-2620 | build: Add files for building releases from Konflux
Added Dockerfile to be used from pipeline builds for release generations using Red Hat keys. Also added some needed modifications and removed old files related to previous release workflow. Signed-off-by: Enrique Belarte Luque <[email protected]>
- Loading branch information
1 parent
3bcd6a7
commit 32d3eb4
Showing
5 changed files
with
53 additions
and
122 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,17 @@ | ||
FROM registry.access.redhat.com/ubi9/go-toolset:latest AS builder | ||
COPY . . | ||
|
||
ENV GOFLAGS=-buildvcs=false | ||
RUN git config --global --add safe.directory /opt/app-root/src && \ | ||
make prepare_release | ||
|
||
FROM registry.access.redhat.com/ubi9/ubi-micro:latest | ||
LABEL description="Terraform Provider RHCS" | ||
LABEL io.k8s.description="Terraform Provider RHCS" | ||
LABEL com.redhat.component="terraform-provider-rhcs" | ||
LABEL distribution-scope="release" | ||
LABEL name="terraform-provider-rhcs" release="X.Y" url="https://github.com/terraform-redhat/terraform-provider-rhcs" | ||
LABEL vendor="Red Hat, Inc." | ||
LABEL version="X.Y" | ||
|
||
COPY --from=builder /opt/app-root/src/releases /releases |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
archs=(amd64 arm64) | ||
oses=(linux darwin windows) | ||
|
||
REL_VER=$(git describe --tags --abbrev=0 | sed "s/v//") | ||
if [[ -z "$REL_VER" ]]; then | ||
echo "Must provide version to prepare release" 1>&2 | ||
exit 1 | ||
fi | ||
mkdir -p releases | ||
|
||
# Manual build release based on Terraform docs. | ||
prepare_release() { | ||
for os in ${oses[@]} | ||
do | ||
for arch in ${archs[@]} | ||
do | ||
if [[ $os == "windows" ]]; then | ||
extension=".exe" | ||
fi | ||
GOOS=${os} GOARCH=${arch} go build -ldflags="${ldflags}" -o /tmp/terraform-provider-rhcs_${os}_${arch} | ||
mv /tmp/terraform-provider-rhcs_${os}_${arch} terraform-provider-rhcs_v${REL_VER}${extension} | ||
zip releases/terraform-provider-rhcs_${REL_VER}_${os}_${arch}.zip CHANGELOG.md LICENSE README.md terraform-provider-rhcs_v${REL_VER}${extension} | ||
rm terraform-provider-rhcs_v${REL_VER}${extension} | ||
cp terraform-registry-manifest.json releases/terraform-provider-rhcs_${REL_VER}_manifest.json | ||
done | ||
done | ||
sha256sum releases/*zip releases/terraform-provider-rhcs_${REL_VER}_manifest.json > releases/terraform-provider-rhcs_${REL_VER}_SHA256SUMS | ||
} | ||
|
||
prepare_release |