Update README.md

This commit is contained in:
Jeff Regan
2019-10-21 16:43:35 -07:00
committed by Jeffrey Regan
parent 35dc15b16b
commit 2f2d078669
8 changed files with 122 additions and 24 deletions

View File

@@ -7,13 +7,9 @@ set -x
module=$1 module=$1
shift shift
executable=$module
cd $module
configFile=$(mktemp) configFile=$(mktemp)
cat <<EOF >$configFile cat <<EOF >$configFile
project_name: $executable project_name: $module
env: env:
- CGO_ENABLED=0 - CGO_ENABLED=0
- GO111MODULE=on - GO111MODULE=on
@@ -32,7 +28,7 @@ release:
owner: kubernetes-sigs owner: kubernetes-sigs
name: kustomize name: kustomize
builds: builds:
- binary: $executable - binary: $module
ldflags: > ldflags: >
-s -s
-X sigs.k8s.io/kustomize/api/provenance.version={{.Version}} -X sigs.k8s.io/kustomize/api/provenance.version={{.Version}}
@@ -50,5 +46,3 @@ EOF
cat $configFile cat $configFile
/bin/goreleaser release --config=$configFile --rm-dist --skip-validate $@ /bin/goreleaser release --config=$configFile --rm-dist --skip-validate $@

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", "api"] args: ["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

48
kustomize/cloudbuild.sh Executable file
View File

@@ -0,0 +1,48 @@
#!/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

@@ -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

48
pluginator/cloudbuild.sh Executable file
View File

@@ -0,0 +1,48 @@
#!/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

@@ -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

@@ -14,16 +14,16 @@ These modules release independently.
## Module summaries ## Module summaries
[`sigs.k8s.io/kustomize/kustomize`]: #sigsk8siokustomizekustomize [`sigs.k8s.io/kustomize/kustomize`]: #sigsk8siokustomizekustomize
[`sigs.k8s.io/kustomize`]: #sigsk8siokustomize [`sigs.k8s.io/kustomize/api`]: #sigsk8siokustomizeapi
[`sigs.k8s.io/kustomize/pluginator`]: #sigsk8siokustomizepluginator [`sigs.k8s.io/kustomize/pluginator`]: #sigsk8siokustomizepluginator
[kustomize/v3.2.1]: https://github.com/kubernetes-sigs/kustomize/releases/tag/kustomize%2Fv3.2.1 [kustomize/v3.2.1]: https://github.com/kubernetes-sigs/kustomize/releases/tag/kustomize%2Fv3.2.1
[pluginator/v1.0.0]: https://github.com/kubernetes-sigs/kustomize/releases/tag/pluginator%2Fv1.0.0 [pluginator/v1.0.0]: https://github.com/kubernetes-sigs/kustomize/releases/tag/pluginator%2Fv1.0.0
| Module Description | Module Prefix | Tag | Branch Name | | Module Description | Module Prefix | Ex. Tag | Ex. Branch Name |
| --- | ------ | --- | --- | | --- | ------ | --- | --- |
| kustomize executable | [`sigs.k8s.io/kustomize/kustomize`] | _kustomize/v{major}.{minor}.{patch}_ | _release-kustomize-v{major}.{minor}_ | | kustomize executable | [`sigs.k8s.io/kustomize/kustomize`] | _kustomize/v3.2.2_ | _release-kustomize-v3.2.2_ |
| kustomize Go API | [`sigs.k8s.io/kustomize/api`] | _api/v{major}.{minor}.{patch}_ | _release-api-v{major}.{minor}_ | | kustomize Go API | [`sigs.k8s.io/kustomize/api`] | _api/v0.1.0_ | _release-api-v0.1_ |
| pluginator executable | [`sigs.k8s.io/kustomize/pluginator`] | _pluginator/v{major}.{minor}.{patch}_ | _release-pluginator-v{major}.{minor}_ | | pluginator executable | [`sigs.k8s.io/kustomize/pluginator`] | _pluginator/v1.0.0_ | _release-pluginator-v1.0_ |
### sigs.k8s.io/kustomize/kustomize ### sigs.k8s.io/kustomize/kustomize
@@ -143,9 +143,7 @@ Go's [semver]-compatible version tags take the form `v{major}.{minor}.{patch}`:
with respect to CLI arguments and flags), increment `major`. with respect to CLI arguments and flags), increment `major`.
``` ```
major=1 major=0; minor=1; patch=0
minor=2
patch=3
``` ```
### create the release branch ### create the release branch
@@ -158,9 +156,15 @@ since the branch accumulates patch releases.
> TODO: define procedure for doing a cherrypick (committing a patch) to a > TODO: define procedure for doing a cherrypick (committing a patch) to a
> release branch that already exists. > release branch that already exists.
Name the branch:
``` ```
branch="release-${module}-v${major}.${minor}" branch="release-${module}-v${major}.${minor}"
echo "branch=$branch" echo "branch=$branch"
```
Create it:
```
git checkout -b $branch git checkout -b $branch
``` ```

View File

@@ -1,8 +1,10 @@
#!/bin/bash #!/bin/bash
# Usage - from the repository root, enter # Usage - from the module (kustomize|pluginator|api) of
# your choice, enterthe repository root, enter
# #
# ./releasing/localbuild.sh (kustomize|pluginator|api) # cd module
# ../releasing/localbuild.sh
# #
# The script attempts to use cloudbuild configuration # The script attempts to use cloudbuild configuration
# to create a release "locally". # to create a release "locally".
@@ -17,7 +19,9 @@
# 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
# #
# releasing/cloudbuild_(kustomize|pluginator|api).yaml # ${module}/cloudbuild.yaml
#
# where module is one of kustomize, pluginator or api.
# #
# Inside this yaml file is a reference to the script # Inside this yaml file is a reference to the script
# #
@@ -46,7 +50,7 @@ case "$module" in
esac esac
config=$(mktemp) config=$(mktemp)
cp releasing/cloudbuild_${module}.yaml $config cp cloudbuild.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.
@@ -72,5 +76,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 "##########################################"