-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create scripts for bootstrapping the env (#42)
* Create scripts for bootstrapping the env * Shellcheck the scripts and add shellcheck to pre-commit * Add shell-format to pre-commit * Add action for shell checking * Add action for shell checking * Finalize scripts * Paremetrize argocd version * Script login against local argocd. Update readme * Use jsonpath instead of piping cut Co-authored-by: Sebastien Le Digabel <[email protected]> * Open login page Co-authored-by: Sebastien Le Digabel <[email protected]>
- Loading branch information
1 parent
ebe96b3
commit 7b89c36
Showing
19 changed files
with
510 additions
and
26 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,24 @@ | ||
name: Shell Lint | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
shellcheck: | ||
name: shellcheck | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: shellcheck | ||
run: | | ||
pip install shellcheck-py | ||
GO111MODULE=on go get mvdan.cc/sh/v3/cmd/shfmt | ||
shellcheck -x **/*.sh | ||
$(go env GOPATH)/bin/shfmt -l -d . | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,24 @@ | ||
#!/bin/sh | ||
#!/bin/bash | ||
# See https://github.com/argoproj/argo-cd/issues/4055 | ||
set -euo pipefail | ||
|
||
VERSION=${1#"v"} | ||
if [ -z "$VERSION" ]; then | ||
echo "Must specify version!" | ||
exit 1 | ||
if [[ -z "$VERSION" ]]; then | ||
echo "Must specify version!" | ||
exit 1 | ||
fi | ||
MODS=($( | ||
curl -sS https://raw.githubusercontent.com/kubernetes/kubernetes/v${VERSION}/go.mod | | ||
sed -n 's|.*k8s.io/\(.*\) => ./staging/src/k8s.io/.*|k8s.io/\1|p' | ||
)) | ||
for MOD in "${MODS[@]}"; do | ||
V=$( | ||
go mod download -json "${MOD}@kubernetes-${VERSION}" | | ||
sed -n 's|.*"Version": "\(.*\)".*|\1|p' | ||
) | ||
go mod edit "-replace=${MOD}=${MOD}@${V}" | ||
done | ||
|
||
FILES=$( | ||
curl -sS https://raw.githubusercontent.com/kubernetes/kubernetes/v"${VERSION}"/go.mod | | ||
sed -n 's|.*k8s.io/\(.*\) => ./staging/src/k8s.io/.*|k8s.io/\1|p' | ||
) | ||
|
||
while read -r MOD; do | ||
V=$( | ||
go mod download -json "${MOD}@kubernetes-${VERSION}" | | ||
sed -n 's|.*"Version": "\(.*\)".*|\1|p' | ||
) | ||
go mod edit "-replace=${MOD}=${MOD}@${V}" | ||
done <<<"$FILES" | ||
|
||
go get "k8s.io/kubernetes@v${VERSION}" |
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.