diff --git a/releasing/cloudbuild.sh b/releasing/cloudbuild.sh index 1a895148b..5debd200d 100755 --- a/releasing/cloudbuild.sh +++ b/releasing/cloudbuild.sh @@ -4,11 +4,12 @@ set -x # Script to run http://goreleaser.com +# Removed from `build` stanza +# binary: $module + module=$1 shift -cd $module - configFile=$(mktemp) cat <$configFile project_name: $module @@ -30,7 +31,7 @@ release: owner: kubernetes-sigs name: kustomize builds: -- binary: $module +- main: ./$module/main.go ldflags: > -s -X sigs.k8s.io/kustomize/api/provenance.version={{.Version}} diff --git a/releasing/cloudbuild_api.yaml b/releasing/cloudbuild_api.yaml index 3f706890f..6654b870c 100644 --- a/releasing/cloudbuild_api.yaml +++ b/releasing/cloudbuild_api.yaml @@ -1,7 +1,7 @@ steps: -- name: "gcr.io/cloud-builders/git" +- name: "gcr.io/cloud-builders/git@sha256:477015d9bb2bc4780f505a4497f10ee581a28fccfa553821cc540cc64bdc37b9" args: [fetch, --tags, --depth=100] -- name: goreleaser/goreleaser +- name: "goreleaser/goreleaser:v0.120.3" entrypoint: /bin/sh args: ["releasing/cloudbuild.sh", "api"] secretEnv: ['GITHUB_TOKEN'] diff --git a/releasing/cloudbuild_kustomize.yaml b/releasing/cloudbuild_kustomize.yaml index d7d83beca..cd184a650 100644 --- a/releasing/cloudbuild_kustomize.yaml +++ b/releasing/cloudbuild_kustomize.yaml @@ -1,7 +1,7 @@ steps: -- name: "gcr.io/cloud-builders/git" +- name: "gcr.io/cloud-builders/git@sha256:477015d9bb2bc4780f505a4497f10ee581a28fccfa553821cc540cc64bdc37b9" args: [fetch, --tags, --depth=100] -- name: goreleaser/goreleaser +- name: "goreleaser/goreleaser:v0.120.3" entrypoint: /bin/sh args: ["releasing/cloudbuild.sh", "kustomize"] secretEnv: ['GITHUB_TOKEN'] diff --git a/releasing/cloudbuild_pluginator.yaml b/releasing/cloudbuild_pluginator.yaml index 365c85a3c..2b7cead33 100644 --- a/releasing/cloudbuild_pluginator.yaml +++ b/releasing/cloudbuild_pluginator.yaml @@ -1,7 +1,7 @@ steps: -- name: "gcr.io/cloud-builders/git" +- name: "gcr.io/cloud-builders/git@sha256:477015d9bb2bc4780f505a4497f10ee581a28fccfa553821cc540cc64bdc37b9" args: [fetch, --tags, --depth=100] -- name: goreleaser/goreleaser +- name: "goreleaser/goreleaser:v0.120.3" entrypoint: /bin/sh args: ["releasing/cloudbuild.sh", "pluginator"] secretEnv: ['GITHUB_TOKEN'] diff --git a/releasing/localbuild.sh b/releasing/localbuild.sh index fb5e95833..5b29bab36 100755 --- a/releasing/localbuild.sh +++ b/releasing/localbuild.sh @@ -1,12 +1,17 @@ #!/bin/bash - -# Usage - from repo root, enter: # -# module=(kustomize|pluginator|api) -# ./releasing/localbuild.sh $module +# To test the release process, this script attempts to +# use Google cloudbuild configuration to create a release +# locally. +# +# Usage: from the repo root, enter: +# +# module=kustomize +# module=pluginator # pick one +# module=api +# +# ./releasing/localbuild.sh $module # -# The script attempts to use cloudbuild configuration -# to create a release "locally". # # See https://cloud.google.com/cloud-build/docs/build-debug-locally # @@ -58,8 +63,7 @@ sed -i '2,3d' $config # Add the --snapshot flag to suppress the # github release and leave the build output # in the kustomize/dist directory. -sed -i 's|"\]$|", "--snapshot"]|' \ - $config +sed -i 's|"\]$|", "--snapshot"]|' $config echo "Executing cloud-build-local with:" echo "=========================" @@ -75,5 +79,5 @@ cloud-build-local \ echo " " echo "Result of local build:" echo "##########################################" -tree ./$module/dist +tree ./dist echo "##########################################"