-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
7b08ecd
commit 8010434
Showing
6 changed files
with
134 additions
and
62 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 |
---|---|---|
@@ -1 +1,3 @@ | ||
.devenv | ||
|
||
.pre-commit-config.yaml |
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,56 @@ | ||
{ config, pkgs, ...}: | ||
{ | ||
config = { | ||
pre-commit.hooks = { | ||
kustomize-build-staging = { | ||
enable = false; | ||
name = "Ensure staging kustomization output is up to date"; | ||
pass_filenames = false; | ||
raw.always_run = true; | ||
entry = "${pkgs.kustomize}/bin/kustomize build staging/ --output output/staging/manifest.yaml"; | ||
}; | ||
|
||
kustomize-build-prod = { | ||
enable = false; | ||
name = "Ensure prod kustomization output is up to date"; | ||
pass_filenames = false; | ||
raw.always_run = true; | ||
entry = "${pkgs.kustomize}/bin/kustomize build prod/ --output output/prod/manifest.yaml"; | ||
}; | ||
}; | ||
|
||
scripts.kustomize-build-staging.exec = '' | ||
set -xe | ||
pushd $DEVENV_ROOT | ||
kustomize build staging/ --output output/staging/manifest.yaml | ||
popd | ||
''; | ||
|
||
scripts.cd-update-staging.exec = '' | ||
set -ex | ||
if test -z "$1"; then | ||
echo "first argument should be an absolute path to the skaffold build output" | ||
exit 1 | ||
fi | ||
if test -z "$2"; then | ||
echo "second argument should be the git commit hash" | ||
exit 1 | ||
fi | ||
pushd staging/ | ||
kpt pkg update base@$2 | ||
if test -f "$1"; then | ||
pushd cd-set-images | ||
sh -xe <(cat $1 | jq -r '.builds[] | "kustomize edit set image \(.imageName)=\(.tag)"') | ||
popd | ||
fi | ||
popd | ||
kustomize build staging/ --output output/staging/manifest.yaml | ||
''; | ||
}; | ||
} |
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
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,20 @@ | ||
{ ...}: | ||
{ | ||
config = { | ||
scripts.skaffold-builder-buildx.exec = '' | ||
set -ex | ||
args="" | ||
if test "$PUSH_IMAGE" = true; then | ||
args+="--push " | ||
fi | ||
if test -n "$PLATFORMS"; then | ||
args+="--platform $PLATFORMS " | ||
fi | ||
docker buildx build "$BUILD_CONTEXT" --tag $IMAGE $args $SKAFFOLD_BUILDX_ARGS | ||
''; | ||
}; | ||
} |