-
Notifications
You must be signed in to change notification settings - Fork 0
feat(helm): add Helm chart and build tooling #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,21 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| set -exo pipefail | ||
|
|
||
| DIR=$(dirname $0) | ||
|
|
||
| COMMIT_HASH=$(bash "${DIR}"/commit-hash.sh) | ||
|
|
||
| PLATFORM=linux/amd64 | ||
| ARCH_TAG=linux-amd64 | ||
|
|
||
| cd "${DIR}"/../ && \ | ||
| DOCKER_BUILDKIT=1 DOCKER_DEFAULT_PLATFORM=${PLATFORM} docker build -t ghcr.io/strrl/supabase-operator:"${COMMIT_HASH}" \ | ||
| -f ./image/supabase-operator/Dockerfile ./ | ||
|
|
||
| docker tag ghcr.io/strrl/supabase-operator:"${COMMIT_HASH}" ghcr.io/strrl/supabase-operator:"${COMMIT_HASH}-${ARCH_TAG}" | ||
| docker tag ghcr.io/strrl/supabase-operator:"${COMMIT_HASH}" ghcr.io/strrl/supabase-operator:latest | ||
|
|
||
| if [ -n "${IMAGE_TAG:-}" ]; then | ||
| docker tag ghcr.io/strrl/supabase-operator:"${COMMIT_HASH}" ghcr.io/strrl/supabase-operator:"${IMAGE_TAG}" | ||
| fi |
This file contains hidden or 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 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| set -euxo pipefail | ||
|
|
||
| HASH=$(git rev-parse --short HEAD) | ||
| if [[ $(git status --porcelain) ]]; then | ||
| HASH=${HASH}-dirty | ||
| fi | ||
|
|
||
| echo $HASH | ||
This file contains hidden or 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,12 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| # if setup-envtest is not installed, install it | ||
|
|
||
| if ! command -v 'setup-envtest' &> /dev/null | ||
| then | ||
| echo 'setup-envtest could not be found' | ||
| echo 'installing setup-envtest' | ||
| go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest | ||
| else | ||
| echo 'setup-envtest is already installed' | ||
| fi |
This file contains hidden or 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,45 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| # This script is adapted from chaos-mesh/chaos-mesh | ||
| # Original: https://github.com/chaos-mesh/chaos-mesh/blob/master/hack/update-kubernetes-library.sh | ||
|
|
||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| if [ $# -ne 1 ]; then | ||
| echo "Usage: $0 <kubernetes-version>" | ||
| echo "Example: $0 v1.32.1" | ||
| exit 1 | ||
| fi | ||
|
|
||
| VERSION=${1#"v"} | ||
| 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' | ||
| ) | ||
| echo "bump ${MOD}@${V}" | ||
| go mod edit "-replace=${MOD}=${MOD}@${V}" | ||
| done | ||
|
|
||
| go get "k8s.io/kubernetes@v${VERSION}" | ||
| go mod tidy |
This file contains hidden or 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,22 @@ | ||
| # Patterns to ignore when building packages. | ||
| # This supports shell glob matching, relative path matching, and negation. | ||
| .DS_Store | ||
| # Common VCS dirs | ||
| .git/ | ||
| .gitignore | ||
| .bzr/ | ||
| .bzrignore | ||
| .hg/ | ||
| .hgignore | ||
| .svn/ | ||
| # Common backup files | ||
| *.swp | ||
| *.bak | ||
| *.tmp | ||
| *.orig | ||
| *~ | ||
| # Various IDEs | ||
| .project | ||
| .idea/ | ||
| *.tmproj | ||
| .vscode/ |
This file contains hidden or 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,22 @@ | ||
| apiVersion: v2 | ||
| name: supabase-operator | ||
| description: Kubernetes operator that provisions Supabase projects and dependencies. | ||
| type: application | ||
| version: 0.1.0 | ||
| appVersion: "0.0.1" | ||
| home: https://github.com/STRRL/supabase-operator | ||
| sources: | ||
| - https://github.com/STRRL/supabase-operator | ||
| keywords: | ||
| - supabase | ||
| - operator | ||
| - kubernetes | ||
| maintainers: | ||
| - name: STRRL | ||
| email: im@strrl.dev | ||
| annotations: | ||
| artifacthub.io/containsSecurityUpdates: "false" | ||
| artifacthub.io/operator: "true" | ||
| artifacthub.io/operatorCapabilities: "Seamless Upgrades" | ||
| artifacthub.io/prerelease: "true" | ||
| artifacthub.io/license: "Apache-2.0" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 8 contains trailing whitespace after 'fi'. While this doesn't affect functionality, it's inconsistent with shell script best practices and can cause issues with some linters or formatters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch!