Cloud build adjustments.

This commit is contained in:
jregan
2019-10-21 19:00:52 -07:00
parent 491baa74cb
commit 335077eade
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 module=$1
shift shift
cd $module
configFile=$(mktemp) configFile=$(mktemp)
cat <<EOF >$configFile cat <<EOF >$configFile
project_name: $module project_name: $module

View File

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

View File

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