-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make different artifacts.go included in the release for different env…
…ironments. Signed-off-by: zeroalphat <[email protected]>
- Loading branch information
1 parent
0376c1d
commit 5d80f1c
Showing
13 changed files
with
290 additions
and
103 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 |
---|---|---|
|
@@ -133,15 +133,12 @@ jobs: | |
- setup-tools | ||
- run: time make deb SUDO="" FAKEROOT= | ||
- run: time make tools SUDO="" FAKEROOT= | ||
- run: | ||
command: | | ||
if [ "${CIRCLE_BRANCH}" != "main" ]; then | ||
go install ./pkg/generate-artifacts/ | ||
generate-artifacts > /tmp/artifacts.go | ||
diff -u artifacts.go /tmp/artifacts.go | ||
fi | ||
|
||
build_release: | ||
parameters: | ||
tags: | ||
type: string | ||
default: "" | ||
docker: | ||
- image: ghcr.io/cybozu/golang:1.22-jammy | ||
- image: ghcr.io/cybozu/etcd:3.5 | ||
|
@@ -156,12 +153,12 @@ jobs: | |
name: Build deb package | ||
command: | | ||
VERSION=$(echo $CIRCLE_TAG | sed 's/^[^-]*-//') | ||
time make deb SUDO="" DEBBUILD_FLAGS="-Zxz" VERSION="$VERSION" TAGS=release FAKEROOT= | ||
time make deb SUDO="" DEBBUILD_FLAGS="-Zxz" VERSION="$VERSION" TAGS=<< parameters.tags >> FAKEROOT= | ||
- run: | ||
name: Build neco-operation-cli packages | ||
command: | | ||
VERSION=$(echo $CIRCLE_TAG | sed 's/^[^-]*-//') | ||
time make tools SUDO="" DEBBUILD_FLAGS="-Zxz" VERSION="$VERSION" TAGS=release FAKEROOT= | ||
time make tools SUDO="" DEBBUILD_FLAGS="-Zxz" VERSION="$VERSION" TAGS=<< parameters.tags >> FAKEROOT= | ||
- persist_to_workspace: | ||
root: . | ||
paths: | ||
|
@@ -262,35 +259,27 @@ jobs: | |
. ./bin/env | ||
$GCLOUD compute instances delete ${INSTANCE_NAME} --zone ${ZONE} | ||
generate-artifacts: | ||
generate-and-compare-artifacts: | ||
docker: | ||
- image: ghcr.io/cybozu/golang:1.22-jammy | ||
steps: | ||
- checkout | ||
- run: go install ./pkg/generate-artifacts/ | ||
- run: generate-artifacts --release > artifacts_release.go | ||
- persist_to_workspace: | ||
root: . | ||
paths: | ||
- "artifacts_release.go" | ||
- run: make update-artifacts | ||
- run: | ||
name: Compare artifacts | ||
command: | | ||
diffs=$(git diff --name-only main) | ||
if [ "$diffs" = "" ]; then printf "%s\n" "$diffs"; exit 0; fi | ||
dctest-functions-release: | ||
docker: | ||
- image: google/cloud-sdk | ||
working_directory: /work | ||
steps: | ||
- checkout | ||
- attach_workspace: | ||
at: /tmp/workspace | ||
- run: | ||
name: Configure GIT | ||
command: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "cybozu-neco" | ||
# Check difference between [`release` branch] and [`main` branch + `artifacts_release.go`] | ||
# Check difference between [`release` branch] and [`main` branch ] | ||
- run: git checkout release | ||
- run: git merge --no-commit origin/main | ||
- run: cp /tmp/workspace/artifacts_release.go . | ||
- run: | ||
name: Check diff | ||
command: | | ||
|
@@ -328,17 +317,9 @@ jobs: | |
working_directory: /work | ||
steps: | ||
- checkout | ||
- attach_workspace: | ||
at: /tmp/workspace | ||
- run: | ||
name: Configure GIT | ||
command: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "cybozu-neco" | ||
# For testing on equal terms with "dctest-functions-release", check out in the same way as it. | ||
- run: git checkout release | ||
- run: git merge --no-commit origin/main | ||
- run: cp /tmp/workspace/artifacts_release.go . | ||
- restore-tools | ||
- run-dctest-bootstrap: | ||
tag: release | ||
|
@@ -369,17 +350,14 @@ jobs: | |
fingerprints: | ||
- "1d:a7:0e:6e:a6:aa:9c:5e:d7:be:e1:59:3f:ed:68:f3" | ||
- checkout | ||
- attach_workspace: | ||
at: /tmp/workspace | ||
- run: | ||
name: Configure GIT | ||
command: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "cybozu-neco" | ||
# Check difference between [`release` branch] and [`main` branch + `artifacts_release.go`] | ||
# Check difference between [`release` branch] and [`main` branch ] | ||
- run: git checkout release | ||
- run: git merge --no-commit origin/main | ||
- run: cp /tmp/workspace/artifacts_release.go . | ||
- run: | ||
name: Check diff | ||
command: | | ||
|
@@ -429,40 +407,60 @@ workflows: | |
release: | ||
jobs: | ||
- build_release: | ||
tags: "" | ||
filters: | ||
branches: | ||
ignore: /.*/ | ||
tags: | ||
only: /^(release|test)-.*/ | ||
only: /^test-.*/ | ||
- deploy_github: | ||
requires: | ||
- build_release | ||
filters: | ||
branches: | ||
ignore: /.*/ | ||
tags: | ||
only: /^(release|test)-.*/ | ||
only: /^test-.*/ | ||
- build_release: | ||
tags: "release" | ||
filters: | ||
branches: | ||
ignore: /.*/ | ||
tags: | ||
only: /^(release)-.*/ | ||
- deploy_github: | ||
requires: | ||
- build_release | ||
filters: | ||
branches: | ||
ignore: /.*/ | ||
tags: | ||
only: /^(release)-.*/ | ||
|
||
# Testing `main` branch and update "release" branch. | ||
update-release: | ||
jobs: | ||
- generate-artifacts: | ||
filters: | ||
branches: | ||
only: | ||
- main | ||
- dctest-functions-release: | ||
requires: | ||
- generate-artifacts | ||
- dctest-upgrade-release: | ||
requires: | ||
- generate-artifacts | ||
- dctest-functions-release | ||
- dctest-upgrade-release | ||
- update-release: | ||
requires: | ||
- dctest-functions-release | ||
- dctest-upgrade-release | ||
|
||
# For updating `artifact_release.go` regularly, run the same job as `main` workflow. | ||
# triggered weekdays at 15:00 UTC(00:00 UTC+9) on the main branch, | ||
# generates new artifacts and compares them with existing ones to highlight any discrepancies. | ||
daily-check-generate-and-compare-artifacts: | ||
triggers: | ||
- schedule: | ||
cron: "0 15 * * 1-5" | ||
filters: | ||
branches: | ||
only: | ||
- main | ||
jobs: | ||
- generate-and-compare-artifacts | ||
|
||
# Run daily tests for the `main` branch. | ||
daily: | ||
triggers: | ||
- schedule: | ||
|
@@ -472,17 +470,6 @@ workflows: | |
only: | ||
- main | ||
jobs: | ||
- generate-artifacts | ||
- dctest-functions-release: | ||
requires: | ||
- generate-artifacts | ||
- dctest-upgrade-release: | ||
requires: | ||
- generate-artifacts | ||
- dctest-reboot-worker: | ||
requires: | ||
- generate-artifacts | ||
- update-release: | ||
requires: | ||
- dctest-functions-release | ||
- dctest-upgrade-release | ||
- dctest-functions-release | ||
- dctest-upgrade-release | ||
- dctest-reboot-worker |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
/kustomize | ||
/helm | ||
/generate-artifacts |
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
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.