-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
123 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,7 +36,6 @@ env: | |
HELM_CHART_VERSION: 0.0.0-edge | ||
GIT_NAME: NGINX Kubernetes Team | ||
GIT_MAIL: [email protected] | ||
VERSION: edge | ||
|
||
jobs: | ||
|
||
|
@@ -46,6 +45,8 @@ jobs: | |
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Output Variables | ||
id: commit | ||
run: | | ||
|
@@ -56,24 +57,26 @@ jobs: | |
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
- name: Determine GOPATH | ||
run: echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV | ||
- name: Check if CRDs changed | ||
run: | | ||
make update-crds && git diff --name-only --exit-code deployments/common/crds* | ||
- name: Check if Codegen changed | ||
run: | | ||
make update-codegen && git diff --name-only --exit-code pkg/**/zz_generated.deepcopy.go | ||
- name: Build Binary | ||
run: > | ||
make build | ||
VERSION=${{ env.VERSION }} | ||
IC_VERSION=${{ env.VERSION }}-${{ steps.commit.outputs.sha }} | ||
GIT_COMMIT=${{ steps.commit.outputs.sha }} | ||
- name: Build binaries | ||
uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
version: latest | ||
args: --rm-dist --debug --skip-publish --snapshot | ||
env: | ||
GOFLAGS: '-gcflags=-trimpath=${{ github.workspace }} -asmflags=-trimpath=${{ github.workspace }}' | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GOPATH: ${{ env.GOPATH }} | ||
- name: Store Artifacts in Cache | ||
uses: actions/[email protected] | ||
with: | ||
path: ${{ github.workspace }}/nginx-ingress | ||
path: ${{ github.workspace }}/dist | ||
key: nginx-ingress-${{ github.run_id }}-${{ github.run_number }} | ||
|
||
unit-tests: | ||
|
@@ -171,7 +174,7 @@ jobs: | |
- name: Fetch Cached Artifacts | ||
uses: actions/[email protected] | ||
with: | ||
path: ${{ github.workspace }}/nginx-ingress | ||
path: ${{ github.workspace }}/dist | ||
key: nginx-ingress-${{ github.run_id }}-${{ github.run_number }} | ||
- name: Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
@@ -191,7 +194,7 @@ jobs: | |
context: '.' | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache | ||
target: local | ||
target: goreleaser | ||
tags: ${{ matrix.image }}:${{ matrix.tag }} | ||
load: true | ||
build-args: | | ||
|
@@ -204,7 +207,7 @@ jobs: | |
context: '.' | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache | ||
target: local | ||
target: goreleaser | ||
tags: ${{ matrix.image }}:${{ matrix.tag }} | ||
load: true | ||
secrets: | | ||
|
@@ -219,7 +222,7 @@ jobs: | |
with: | ||
file: build/Dockerfile | ||
context: '.' | ||
target: local | ||
target: goreleaser | ||
tags: ${{ matrix.image }}:${{ matrix.tag }} | ||
load: true | ||
secrets: | | ||
|
@@ -296,7 +299,7 @@ jobs: | |
- name: Fetch Cached Artifacts | ||
uses: actions/[email protected] | ||
with: | ||
path: ${{ github.workspace }}/nginx-ingress | ||
path: ${{ github.workspace }}/dist | ||
key: nginx-ingress-${{ github.run_id }}-${{ github.run_number }} | ||
- name: Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
@@ -316,7 +319,7 @@ jobs: | |
context: '.' | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache | ||
target: local | ||
target: goreleaser | ||
tags: nginx-plus-ingress-ap-openshift:${{ github.sha }} | ||
secrets: | | ||
"nginx-repo.crt=${{ secrets.KIC_NGINX_AP_CRT }}" | ||
|
@@ -353,7 +356,7 @@ jobs: | |
- name: Fetch Cached Artifacts | ||
uses: actions/[email protected] | ||
with: | ||
path: ${{ github.workspace }}/nginx-ingress | ||
path: ${{ github.workspace }}/dist | ||
key: nginx-ingress-${{ github.run_id }}-${{ github.run_number }} | ||
- name: Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
@@ -373,7 +376,7 @@ jobs: | |
context: '.' | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache | ||
target: local | ||
target: goreleaser | ||
tags: ${{ matrix.image }}:${{ matrix.tag }} | ||
load: true | ||
build-args: | | ||
|
@@ -385,7 +388,7 @@ jobs: | |
context: '.' | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache | ||
target: local | ||
target: goreleaser | ||
tags: ${{ matrix.image }}:${{ matrix.tag }} | ||
load: true | ||
secrets: | | ||
|
@@ -463,10 +466,11 @@ jobs: | |
id: commit | ||
run: | | ||
echo "::set-output name=sha::$(echo ${GITHUB_SHA} | cut -c1-7)" | ||
echo "::set-output name=tag::${GITHUB_REF#refs/tags/}" | ||
- name: Fetch Cached Artifacts | ||
uses: actions/[email protected] | ||
with: | ||
path: ${{ github.workspace }}/nginx-ingress | ||
path: ${{ github.workspace }}/dist | ||
key: nginx-ingress-${{ github.run_id }}-${{ github.run_number }} | ||
- name: Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
@@ -491,12 +495,13 @@ jobs: | |
context: '.' | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache | ||
target: local | ||
target: goreleaser | ||
tags: nginx/${{ matrix.image }}:${{ matrix.tag }} | ||
platforms: linux/arm,linux/arm64,linux/amd64,linux/ppc64le,linux/s390x | ||
push: true | ||
build-args: | | ||
BUILD_OS=${{ matrix.type }} | ||
IC_VERSION=${{ env.VERSION }}-${{ steps.commit.outputs.sha }} | ||
IC_VERSION=${{ steps.commit.outputs.tag }}-SNAPSHOT-${{ steps.commit.outputs.sha }} | ||
package-helm: | ||
name: Package Helm Chart | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,24 +29,30 @@ jobs: | |
echo "::set-output name=sha::$(echo ${GITHUB_SHA} | cut -c1-7)" | ||
- name: Determine Go version from go.mod | ||
run: echo "GO_VERSION=$(grep "go 1." go.mod | cut -d " " -f 2)" >> $GITHUB_ENV | ||
- name: Setup Golang Environment | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
- name: Determine GOPATH | ||
run: echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV | ||
- name: Check if CRDs changed | ||
run: | | ||
make update-crds && git diff --name-only --exit-code deployments/common/crds* | ||
- name: Check if Codegen changed | ||
run: | | ||
make update-codegen && git diff --name-only --exit-code pkg/**/zz_generated.deepcopy.go | ||
- name: Build Binary | ||
run: > | ||
make build | ||
VERSION=${{ env.VERSION }} | ||
IC_VERSION=${{ env.VERSION }}-${{ steps.commit.outputs.sha }} | ||
GIT_COMMIT=${{ steps.commit.outputs.sha }} | ||
- name: Build binaries | ||
uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
version: latest | ||
args: --rm-dist --debug --skip-publish --snapshot | ||
env: | ||
GOFLAGS: '-gcflags=-trimpath=${{ github.workspace }} -asmflags=-trimpath=${{ github.workspace }}' | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GOPATH: ${{ env.GOPATH }} | ||
- name: Store Artifacts in Cache | ||
uses: actions/[email protected] | ||
with: | ||
path: ${{ github.workspace }}/nginx-ingress | ||
path: ${{ github.workspace }}/dist | ||
key: nginx-ingress-${{ github.run_id }}-${{ github.run_number }} | ||
|
||
unit-tests: | ||
|
@@ -291,7 +297,7 @@ jobs: | |
- name: Fetch Cached Artifacts | ||
uses: actions/[email protected] | ||
with: | ||
path: ${{ github.workspace }}/nginx-ingress | ||
path: ${{ github.workspace }}/dist | ||
key: nginx-ingress-${{ github.run_id }}-${{ github.run_number }} | ||
- name: Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
@@ -430,7 +436,7 @@ jobs: | |
- name: Fetch Cached Artifacts | ||
uses: actions/[email protected] | ||
with: | ||
path: ${{ github.workspace }}/nginx-ingress | ||
path: ${{ github.workspace }}/dist | ||
key: nginx-ingress-${{ github.run_id }}-${{ github.run_number }} | ||
- name: Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,3 +53,5 @@ hack/controller-gen-* | |
docs-web/.netlify/state.json | ||
site/ | ||
venv/ | ||
|
||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
env: | ||
- GO111MODULE=on | ||
before: | ||
hooks: | ||
- go mod tidy | ||
- go mod verify | ||
builds: | ||
- env: | ||
- CGO_ENABLED=0 | ||
goos: | ||
- linux | ||
goarch: | ||
- amd64 | ||
- arm | ||
- arm64 | ||
- ppc64le | ||
- s390x | ||
goarm: | ||
- 7 | ||
flags: | ||
- -trimpath | ||
gcflags: | ||
- all=-trimpath={{.Env.GOPATH}} | ||
asmflags: | ||
- all=-trimpath={{.Env.GOPATH}} | ||
main: ./cmd/nginx-ingress/main.go | ||
binary: nginx-ingress | ||
archives: | ||
- format: binary | ||
changelog: | ||
skip: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.