mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-11 17:12:51 +00:00
Cloud build adjustments.
This commit is contained in:
50
releasing/cloudbuild.sh
Executable file
50
releasing/cloudbuild.sh
Executable file
@@ -0,0 +1,50 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
set -x
|
||||
|
||||
# Script to run http://goreleaser.com
|
||||
|
||||
module=$1
|
||||
shift
|
||||
|
||||
cd $module
|
||||
|
||||
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 $@
|
||||
11
releasing/cloudbuild_api.yaml
Normal file
11
releasing/cloudbuild_api.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
steps:
|
||||
- name: "gcr.io/cloud-builders/git"
|
||||
args: [fetch, --tags, --depth=100]
|
||||
- name: goreleaser/goreleaser
|
||||
entrypoint: /bin/sh
|
||||
args: ["releasing/cloudbuild.sh", "api"]
|
||||
secretEnv: ['GITHUB_TOKEN']
|
||||
secrets:
|
||||
- kmsKeyName: projects/kustomize-199618/locations/global/keyRings/github-tokens/cryptoKeys/gh-release-token
|
||||
secretEnv:
|
||||
GITHUB_TOKEN: CiQAyrREbPgXJOeT7M3t+WlxkhXwlMPudixBeiyWTjmLOMLqdK4SUQA0W+xUmDJKAhyfHCcwqSEzUn9OwKC7XAYcmwe0CCKTCbPbDgmioDK24q3LVapndXNvnnHvCjhOJNEr1o+P1DCF+LlzYV2YL8lP09rrKrslPg==
|
||||
11
releasing/cloudbuild_kustomize.yaml
Normal file
11
releasing/cloudbuild_kustomize.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
steps:
|
||||
- name: "gcr.io/cloud-builders/git"
|
||||
args: [fetch, --tags, --depth=100]
|
||||
- name: goreleaser/goreleaser
|
||||
entrypoint: /bin/sh
|
||||
args: ["releasing/cloudbuild.sh", "kustomize"]
|
||||
secretEnv: ['GITHUB_TOKEN']
|
||||
secrets:
|
||||
- kmsKeyName: projects/kustomize-199618/locations/global/keyRings/github-tokens/cryptoKeys/gh-release-token
|
||||
secretEnv:
|
||||
GITHUB_TOKEN: CiQAyrREbPgXJOeT7M3t+WlxkhXwlMPudixBeiyWTjmLOMLqdK4SUQA0W+xUmDJKAhyfHCcwqSEzUn9OwKC7XAYcmwe0CCKTCbPbDgmioDK24q3LVapndXNvnnHvCjhOJNEr1o+P1DCF+LlzYV2YL8lP09rrKrslPg==
|
||||
11
releasing/cloudbuild_pluginator.yaml
Normal file
11
releasing/cloudbuild_pluginator.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
steps:
|
||||
- name: "gcr.io/cloud-builders/git"
|
||||
args: [fetch, --tags, --depth=100]
|
||||
- name: goreleaser/goreleaser
|
||||
entrypoint: /bin/sh
|
||||
args: ["releasing/cloudbuild.sh", "pluginator"]
|
||||
secretEnv: ['GITHUB_TOKEN']
|
||||
secrets:
|
||||
- kmsKeyName: projects/kustomize-199618/locations/global/keyRings/github-tokens/cryptoKeys/gh-release-token
|
||||
secretEnv:
|
||||
GITHUB_TOKEN: CiQAyrREbPgXJOeT7M3t+WlxkhXwlMPudixBeiyWTjmLOMLqdK4SUQA0W+xUmDJKAhyfHCcwqSEzUn9OwKC7XAYcmwe0CCKTCbPbDgmioDK24q3LVapndXNvnnHvCjhOJNEr1o+P1DCF+LlzYV2YL8lP09rrKrslPg==
|
||||
@@ -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 "##########################################"
|
||||
|
||||
Reference in New Issue
Block a user