generated from cybozu-go/neco-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from cybozu-go/init
Implement cattage
- Loading branch information
Showing
126 changed files
with
8,255 additions
and
36 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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/config | ||
/docs | ||
/e2e | ||
/hack | ||
/.git | ||
/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,14 @@ | ||
name: "Setup tools" | ||
description: "Setup tools with aqua" | ||
inputs: | ||
github_token: | ||
description: "GitHub Token" | ||
required: true | ||
runs: | ||
using: composite | ||
steps: | ||
- uses: aquaproj/aqua-installer@58fc6b885cba1f956127fa2b40d64eea0400bf7b #v0.7.0 | ||
with: | ||
aqua_version: v0.10.2 | ||
env: | ||
GITHUB_TOKEN: ${{ inputs.github_token }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: Release Charts | ||
on: | ||
push: | ||
tags: | ||
- 'chart-v*' | ||
jobs: | ||
build: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- uses: ./.github/actions/aqua | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Check chart version | ||
run: | | ||
tag_version=${GITHUB_REF##*/chart-v} | ||
chart_version=$(cat charts/cattage/Chart.yaml | grep 'version:' | sed 's/version:\s//') | ||
if [ "$tag_version" != "$chart_version" ]; then | ||
echo "Different versions: tag \"$tag_version\", chart \"$chart_version\"" | ||
exit 1 | ||
fi | ||
- name: Packaging the chart | ||
run: helm package ./charts/cattage/ | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: helm-charts | ||
path: ./cattage-*.tgz | ||
retention-days: 1 | ||
publish: | ||
name: Publish charts on GitHub Pages | ||
runs-on: ubuntu-20.04 | ||
needs: build | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: gh-pages | ||
- uses: ./.github/actions/aqua | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: helm-charts | ||
- name: Update charts index | ||
run: helm repo index --url https://cybozu-go.github.io/cattage/ --merge index.yaml . | ||
- run: git add . | ||
- name: Check diffs | ||
run: | | ||
diffs=$(git status -s) | ||
if [ "$diffs" = "" ]; then | ||
echo "NO_DIFF=1" >> $GITHUB_ENV | ||
else | ||
printf "%s\n" "$diffs" | ||
fi | ||
- name: Commit changes | ||
if: env.NO_DIFF != '1' | ||
run: | | ||
git config --global user.name 'Cybozu Neco' | ||
git config --global user.email '[email protected]' | ||
git commit -m 'update' | ||
- name: Push to gh-pages | ||
if: env.NO_DIFF != '1' | ||
run: git push origin gh-pages |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Release | ||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
env: | ||
go-version: 1.17 | ||
jobs: | ||
release: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- uses: docker/setup-qemu-action@v1 | ||
- uses: docker/setup-buildx-action@v1 | ||
- name: GHCR Login | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Setup go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ env.go-version }} | ||
- name: GoReleaser | ||
uses: goreleaser/goreleaser-action@79d4afbba1b4eff8b9a98e3d2e58c4dbaf094e2b # v2.8.1 | ||
with: | ||
version: latest | ||
args: release --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
project_name: cattage | ||
dist: bin/ | ||
builds: | ||
- env: | ||
- CGO_ENABLED=0 | ||
main: ./cmd/cattage-controller | ||
binary: cattage-controller | ||
goos: | ||
- linux | ||
goarch: | ||
- amd64 | ||
- arm64 | ||
dockers: | ||
- image_templates: | ||
- "ghcr.io/cybozu-go/{{.ProjectName}}:{{ .Version }}-amd64" | ||
use: buildx | ||
dockerfile: Dockerfile | ||
extra_files: | ||
- LICENSE | ||
build_flag_templates: | ||
- "--platform=linux/amd64" | ||
- "--label=org.opencontainers.image.created={{.Date}}" | ||
- "--label=org.opencontainers.image.revision={{.FullCommit}}" | ||
- "--label=org.opencontainers.image.version={{.Version}}" | ||
- image_templates: | ||
- "ghcr.io/cybozu-go/{{.ProjectName}}:{{ .Version }}-arm64" | ||
use: buildx | ||
goarch: arm64 | ||
dockerfile: Dockerfile | ||
extra_files: | ||
- LICENSE | ||
build_flag_templates: | ||
- "--platform=linux/arm64" | ||
- "--label=org.opencontainers.image.created={{.Date}}" | ||
- "--label=org.opencontainers.image.revision={{.FullCommit}}" | ||
- "--label=org.opencontainers.image.version={{.Version}}" | ||
docker_manifests: | ||
- name_template: "ghcr.io/cybozu-go/{{.ProjectName}}:{{ .Version }}" | ||
image_templates: | ||
- "ghcr.io/cybozu-go/{{.ProjectName}}:{{ .Version }}-amd64" | ||
- "ghcr.io/cybozu-go/{{.ProjectName}}:{{ .Version }}-arm64" | ||
- name_template: "ghcr.io/cybozu-go/{{.ProjectName}}:{{ .Major }}.{{ .Minor }}" | ||
image_templates: | ||
- "ghcr.io/cybozu-go/{{.ProjectName}}:{{ .Version }}-amd64" | ||
- "ghcr.io/cybozu-go/{{.ProjectName}}:{{ .Version }}-arm64" | ||
checksum: | ||
name_template: 'checksums.txt' | ||
snapshot: | ||
name_template: "{{ .Tag }}-next" | ||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- '^docs:' | ||
- '^test:' |
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,10 @@ | ||
FROM scratch | ||
LABEL org.opencontainers.image.authors="Cybozu, Inc." \ | ||
org.opencontainers.image.title="cattage" \ | ||
org.opencontainers.image.source="https://github.com/cybozu-go/cattage" | ||
WORKDIR / | ||
COPY LICENSE / | ||
COPY cattage-controller / | ||
USER 65532:65532 | ||
|
||
ENTRYPOINT ["/cattage-controller"] |
Oops, something went wrong.