Merge pull request #1669 from monopole/cloudBuildTake9834

Cloud build adjustments.
This commit is contained in:
Jeff Regan
2019-10-21 19:03:03 -07:00
committed by GitHub
7 changed files with 11 additions and 106 deletions

View File

@@ -1,48 +0,0 @@
#!/bin/bash
set -e
set -x
# Script to run http://goreleaser.com
module=$1
shift
configFile=$(mktemp)
cat <<EOF >$configFile
project_name: $module
env:
- CGO_ENABLED=0
- GO111MODULE=on
checksum:
name_template: 'checksums.txt'
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
- Merge pull request
- Merge branch
release:
github:
owner: kubernetes-sigs
name: kustomize
builds:
- binary: $module
ldflags: >
-s
-X sigs.k8s.io/kustomize/api/provenance.version={{.Version}}
-X sigs.k8s.io/kustomize/api/provenance.gitCommit={{.Commit}}
-X sigs.k8s.io/kustomize/api/provenance.buildDate={{.Date}}
goos:
- linux
- darwin
- windows
goarch:
- amd64
EOF
cat $configFile
/bin/goreleaser release --config=$configFile --rm-dist --skip-validate $@

View File

@@ -1,48 +0,0 @@
#!/bin/bash
set -e
set -x
# Script to run http://goreleaser.com
module=$1
shift
configFile=$(mktemp)
cat <<EOF >$configFile
project_name: $module
env:
- CGO_ENABLED=0
- GO111MODULE=on
checksum:
name_template: 'checksums.txt'
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
- Merge pull request
- Merge branch
release:
github:
owner: kubernetes-sigs
name: kustomize
builds:
- binary: $module
ldflags: >
-s
-X sigs.k8s.io/kustomize/api/provenance.version={{.Version}}
-X sigs.k8s.io/kustomize/api/provenance.gitCommit={{.Commit}}
-X sigs.k8s.io/kustomize/api/provenance.buildDate={{.Date}}
goos:
- linux
- darwin
- windows
goarch:
- amd64
EOF
cat $configFile
/bin/goreleaser release --config=$configFile --rm-dist --skip-validate $@

View File

@@ -7,6 +7,8 @@ set -x
module=$1
shift
cd $module
configFile=$(mktemp)
cat <<EOF >$configFile
project_name: $module

View File

@@ -3,7 +3,7 @@ steps:
args: [fetch, --tags, --depth=100]
- name: goreleaser/goreleaser
entrypoint: /bin/sh
args: ["cloudbuild.sh", "api"]
args: ["releasing/cloudbuild.sh", "api"]
secretEnv: ['GITHUB_TOKEN']
secrets:
- kmsKeyName: projects/kustomize-199618/locations/global/keyRings/github-tokens/cryptoKeys/gh-release-token

View File

@@ -3,7 +3,7 @@ steps:
args: [fetch, --tags, --depth=100]
- name: goreleaser/goreleaser
entrypoint: /bin/sh
args: ["../releasing/cloudbuild.sh", "kustomize"]
args: ["releasing/cloudbuild.sh", "kustomize"]
secretEnv: ['GITHUB_TOKEN']
secrets:
- kmsKeyName: projects/kustomize-199618/locations/global/keyRings/github-tokens/cryptoKeys/gh-release-token

View File

@@ -3,7 +3,7 @@ steps:
args: [fetch, --tags, --depth=100]
- name: goreleaser/goreleaser
entrypoint: /bin/sh
args: ["../releasing/cloudbuild.sh", "pluginator"]
args: ["releasing/cloudbuild.sh", "pluginator"]
secretEnv: ['GITHUB_TOKEN']
secrets:
- kmsKeyName: projects/kustomize-199618/locations/global/keyRings/github-tokens/cryptoKeys/gh-release-token

View File

@@ -1,10 +1,9 @@
#!/bin/bash
# Usage - from the module (kustomize|pluginator|api) of
# your choice, enterthe repository root, enter
# Usage - from repo root, enter:
#
# cd module
# ../releasing/localbuild.sh
# module=(kustomize|pluginator|api)
# ./releasing/localbuild.sh $module
#
# The script attempts to use cloudbuild configuration
# to create a release "locally".
@@ -19,7 +18,7 @@
# applied to the kustomize repo, the cloud builder
# reads the repository-relative file
#
# ${module}/cloudbuild.yaml
# releasing/cloudbuild_${module}.yaml
#
# where module is one of kustomize, pluginator or api.
#
@@ -50,7 +49,7 @@ case "$module" in
esac
config=$(mktemp)
cp cloudbuild.yaml $config
cp releasing/cloudbuild_${module}.yaml $config
# Delete the cloud-builders/git step, which isn't needed
# for a local run.
@@ -76,5 +75,5 @@ cloud-build-local \
echo " "
echo "Result of local build:"
echo "##########################################"
tree ./dist
tree ./$module/dist
echo "##########################################"