File tree 6 files changed +70
-54
lines changed
6 files changed +70
-54
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
- ## Steps to run build locally
1
+ ## Overview
2
2
3
- Install container-builder-local from github and define GOOS, GOARCH, OUTPUT env
4
- variables and run following command
3
+ This directory contains scripts and configruation files for publishing a
4
+ ` kustomize ` release on [ release page] ( https://github.com/kubernetes-sigs/kustomize/releases )
5
+
6
+ ## Steps to run build a release locally
7
+ Install container-builder-local from [ github] ( https://github.com/GoogleCloudPlatform/container-builder-local ) .
5
8
6
9
``` sh
7
- container-builder-local --config=cmd/kustomize/ build/cloudbuild_local.yaml --dryrun=false --substitutions=_GOOS= $GOOS ,_GOARCH= $GOARCH -- write-workspace=$OUTPUT .
10
+ container-builder-local --config=build/cloudbuild_local.yaml --dryrun=false --write-workspace=/tmp/w .
8
11
```
9
12
10
- ## Steps to submit build to Google container builder
11
-
12
- You need to be at the repo level to be able to run the following command
13
-
14
- ```
15
- gcloud container builds submit . --config=cmd/kustomize/build/cloudbuild.yaml --substitutions=_GOOS=$GOOS,_GOARCH=$GOARCH
16
- ```
13
+ You will find the build artifacts under ` /tmp/w/dist ` directory
Original file line number Diff line number Diff line change @@ -23,20 +23,37 @@ set -x
23
23
# - Use /go as the default GOPATH because this is what the image uses
24
24
# - Link our current directory (containing the source code) to the package location in the GOPATH
25
25
26
- export PKG=k8s.io
27
- export REPO=kubectl
28
- export CMD=kustomize
26
+ OWNER=" kubernetes-sigs"
27
+ REPO=" kustomize"
29
28
30
- GO_PKG_OWNER=$GOPATH /src/$PKG
29
+ GO_PKG_OWNER=$GOPATH /src/github.com/ $OWNER
31
30
GO_PKG_PATH=$GO_PKG_OWNER /$REPO
32
31
33
32
mkdir -p $GO_PKG_OWNER
34
- ln -s $( pwd) $GO_PKG_PATH
33
+ ln -sf $( pwd) $GO_PKG_PATH
35
34
36
35
# When invoked in container builder, this script runs under /workspace which is
37
36
# not under $GOPATH, so we need to `cd` to repo under GOPATH for it to build
38
37
cd $GO_PKG_PATH
39
38
40
- /goreleaser release --config=cmd/$CMD /build/.goreleaser.yml --debug --rm-dist
41
- # --skip-validate
42
- # --snapshot --skip-publish
39
+
40
+ # NOTE: if snapshot is enabled, release is not published to GitHub and the build
41
+ # is available under workspace/dist directory.
42
+ SNAPSHOT=" "
43
+
44
+ # parse commandline args copied from the link below
45
+ # https://stackoverflow.com/questions/192249/how-do-i-parse-command-line-arguments-in-bash?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa
46
+
47
+ while [[ $# -gt 0 ]]
48
+ do
49
+ key=" $1 "
50
+
51
+ case $key in
52
+ --snapshot)
53
+ SNAPSHOT=" --snapshot"
54
+ shift # past argument
55
+ ;;
56
+ esac
57
+ done
58
+
59
+ /goreleaser release --config=build/goreleaser.yml --rm-dist --skip-validate ${SNAPSHOT}
Original file line number Diff line number Diff line change 14
14
15
15
# TODO(droot): add instructions for running in production.
16
16
steps :
17
- - name : " ubuntu "
18
- args : ["mkdir", "-p", "/workspace/_output" ]
17
+ - name : " gcr.io/cloud-builders/git "
18
+ args : [fetch, --tags, --depth=100 ]
19
19
- name : " gcr.io/kustomize-199618/golang_with_goreleaser:1.10-stretch"
20
- args : ["bash", "cmd/kustomize/ build/build.sh"]
20
+ args : ["bash", "build/build.sh"]
21
21
secretEnv : ['GITHUB_TOKEN']
22
22
secrets :
23
23
- kmsKeyName : projects/kustomize-199618/locations/global/keyRings/github-tokens/cryptoKeys/gh-release-token
Original file line number Diff line number Diff line change 21
21
# Release tar will be in $OUTPUT
22
22
23
23
steps :
24
- - name : " ubuntu"
25
- args : ["mkdir", "-p", "/workspace/_output"]
26
24
- name : " gcr.io/kustomize-199618/golang_with_goreleaser:1.10-stretch"
27
- args : ["bash", "cmd/kustomize/ build/build.sh"]
25
+ args : ["bash", "build/build.sh", "--snapshot "]
28
26
secretEnv : ['GITHUB_TOKEN']
29
27
secrets :
30
28
- kmsKeyName : projects/kustomize-199618/locations/global/keyRings/github-tokens/cryptoKeys/gh-release-token
Original file line number Diff line number Diff line change
1
+ # This is an example goreleaser.yaml file with some sane defaults.
2
+ # Make sure to check the documentation at http://goreleaser.com
3
+ project_name : kustomize
4
+ builds :
5
+ - main : ./kustomize.go
6
+ binary : kustomize
7
+ ldflags : -s -X github.com/kubernetes-sigs/kustomize/version.kustomizeVersion={{.Version}} -X github.com/kubernetes-sigs/kustomize/version.gitCommit={{.Commit}} -X github.com/kubernetes-sigs/kustomize/version.buildDate={{.Date}}
8
+ goos :
9
+ - darwin
10
+ - linux
11
+ - windows
12
+ goarch :
13
+ - amd64
14
+ env :
15
+ - CGO_ENABLED=0
16
+ checksum :
17
+ name_template : ' checksums.txt'
18
+ archive :
19
+ format : binary
20
+ snapshot :
21
+ name_template : " master"
22
+ changelog :
23
+ sort : asc
24
+ filters :
25
+ exclude :
26
+ - ' ^docs:'
27
+ - ' ^test:'
28
+ - Merge pull request
29
+ - Merge branch
30
+ release :
31
+ github :
32
+ owner : kubernetes-sigs
33
+ name : kustomize
You can’t perform that action at this time.
0 commit comments