More releasing tweaks.

This commit is contained in:
Jeffrey Regan
2019-10-22 10:10:47 -07:00
parent 3063560e77
commit 24837bad40
5 changed files with 23 additions and 18 deletions

View File

@@ -4,11 +4,12 @@ set -x
# Script to run http://goreleaser.com # Script to run http://goreleaser.com
# Removed from `build` stanza
# binary: $module
module=$1 module=$1
shift shift
cd $module
configFile=$(mktemp) configFile=$(mktemp)
cat <<EOF >$configFile cat <<EOF >$configFile
project_name: $module project_name: $module
@@ -30,7 +31,7 @@ release:
owner: kubernetes-sigs owner: kubernetes-sigs
name: kustomize name: kustomize
builds: builds:
- binary: $module - main: ./$module/main.go
ldflags: > ldflags: >
-s -s
-X sigs.k8s.io/kustomize/api/provenance.version={{.Version}} -X sigs.k8s.io/kustomize/api/provenance.version={{.Version}}

View File

@@ -1,7 +1,7 @@
steps: steps:
- name: "gcr.io/cloud-builders/git" - name: "gcr.io/cloud-builders/git@sha256:477015d9bb2bc4780f505a4497f10ee581a28fccfa553821cc540cc64bdc37b9"
args: [fetch, --tags, --depth=100] args: [fetch, --tags, --depth=100]
- name: goreleaser/goreleaser - name: "goreleaser/goreleaser:v0.120.3"
entrypoint: /bin/sh entrypoint: /bin/sh
args: ["releasing/cloudbuild.sh", "api"] args: ["releasing/cloudbuild.sh", "api"]
secretEnv: ['GITHUB_TOKEN'] secretEnv: ['GITHUB_TOKEN']

View File

@@ -1,7 +1,7 @@
steps: steps:
- name: "gcr.io/cloud-builders/git" - name: "gcr.io/cloud-builders/git@sha256:477015d9bb2bc4780f505a4497f10ee581a28fccfa553821cc540cc64bdc37b9"
args: [fetch, --tags, --depth=100] args: [fetch, --tags, --depth=100]
- name: goreleaser/goreleaser - name: "goreleaser/goreleaser:v0.120.3"
entrypoint: /bin/sh entrypoint: /bin/sh
args: ["releasing/cloudbuild.sh", "kustomize"] args: ["releasing/cloudbuild.sh", "kustomize"]
secretEnv: ['GITHUB_TOKEN'] secretEnv: ['GITHUB_TOKEN']

View File

@@ -1,7 +1,7 @@
steps: steps:
- name: "gcr.io/cloud-builders/git" - name: "gcr.io/cloud-builders/git@sha256:477015d9bb2bc4780f505a4497f10ee581a28fccfa553821cc540cc64bdc37b9"
args: [fetch, --tags, --depth=100] args: [fetch, --tags, --depth=100]
- name: goreleaser/goreleaser - name: "goreleaser/goreleaser:v0.120.3"
entrypoint: /bin/sh entrypoint: /bin/sh
args: ["releasing/cloudbuild.sh", "pluginator"] args: ["releasing/cloudbuild.sh", "pluginator"]
secretEnv: ['GITHUB_TOKEN'] secretEnv: ['GITHUB_TOKEN']

View File

@@ -1,12 +1,17 @@
#!/bin/bash #!/bin/bash
# Usage - from repo root, enter:
# #
# module=(kustomize|pluginator|api) # To test the release process, this script attempts to
# ./releasing/localbuild.sh $module # 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 # 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 # Add the --snapshot flag to suppress the
# github release and leave the build output # github release and leave the build output
# in the kustomize/dist directory. # in the kustomize/dist directory.
sed -i 's|"\]$|", "--snapshot"]|' \ sed -i 's|"\]$|", "--snapshot"]|' $config
$config
echo "Executing cloud-build-local with:" echo "Executing cloud-build-local with:"
echo "=========================" echo "========================="
@@ -75,5 +79,5 @@ cloud-build-local \
echo " " echo " "
echo "Result of local build:" echo "Result of local build:"
echo "##########################################" echo "##########################################"
tree ./$module/dist tree ./dist
echo "##########################################" echo "##########################################"