-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Bitnami Containers <[email protected]>
- Loading branch information
0 parents
commit c786729
Showing
4 changed files
with
421,901 additions
and
0 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,128 @@ | ||
name: '[Index] Generate the full bitnami/charts index.yaml' | ||
on: | ||
push: | ||
branches: | ||
- index | ||
jobs: | ||
get: | ||
runs-on: ubuntu-latest | ||
name: Get | ||
steps: | ||
- id: checkout-repo-index | ||
name: Checkout repo | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: index | ||
path: index | ||
- id: checkout-repo-full-index | ||
name: Checkout repo | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: archive-full-index | ||
path: full-index | ||
- id: get-last-indexes | ||
name: Get indexes | ||
run: | | ||
cp index/bitnami/index.yaml ./last_index.yaml | ||
cp full-index/bitnami/index.yaml ./previous_index.yaml | ||
- id: upload-artifact | ||
name: Upload artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: indexes | ||
path: ./*index.yaml | ||
retention-days: 2 | ||
if-no-files-found: error | ||
merge: | ||
runs-on: ubuntu-latest | ||
needs: get | ||
name: Merge | ||
steps: | ||
- id: download-artifact | ||
name: Download artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: indexes | ||
- id: merge | ||
name: Merge | ||
run: yq eval-all '. as $item ireduce ({}; . *+ $item )' previous_index.yaml last_index.yaml > duplicates_index.yaml | ||
- id: remove | ||
name: Remove duplicates | ||
# Removes duplicates per entry using 'digest' as value. | ||
run: yq eval '.entries[] |= unique_by(.digest)' duplicates_index.yaml > index.yaml | ||
- id: upload-artifact | ||
name: Upload artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: archive-full-index | ||
path: index.yaml | ||
retention-days: 2 | ||
if-no-files-found: error | ||
checks: | ||
runs-on: ubuntu-latest | ||
needs: merge | ||
name: Checks | ||
steps: | ||
- id: download-artifacts | ||
name: Download artifacts | ||
uses: actions/download-artifact@v3 | ||
- id: index-lint | ||
name: Lint archive full index | ||
# Lint the resulting archive full index using ignoring identation and lin-length rules. | ||
run: | | ||
cat << EOF > config | ||
extends: relaxed | ||
rules: | ||
indentation: | ||
level: error | ||
line-length: disable | ||
EOF | ||
yamllint -c config archive-full-index/index.yaml | ||
- id: check-no-dups | ||
name: Checks there are not any duplicates | ||
# Try to find duplicate digest attributes which would mean there are duplicates. | ||
run: | | ||
yq eval '.entries[][].digest' archive-full-index/index.yaml | sort | uniq -d | ( ! grep sha256 ) | ||
- id: check-missing-releases | ||
name: Checks there are not missing releases | ||
# Available URLs should be fine if everything went well during the merge & deduplication. | ||
run: | | ||
yq eval '.entries[][].urls[]' indexes/last_index.yaml |sort| uniq > last_index_urls | ||
yq eval '.entries[][].urls[]' archive-full-index/index.yaml | sort| uniq > index_urls | ||
missing_urls="$(comm -13 index_urls last_index_urls)" | ||
if [ -n "${missing_urls}" ]; then | ||
echo "Found missing URLs:\n${missing_urls}" | ||
exit 1 | ||
fi | ||
echo "No missing releases detected" | ||
update: | ||
runs-on: ubuntu-latest | ||
needs: checks | ||
name: Update | ||
steps: | ||
- id: checkout-repo | ||
name: Checkout repo | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: archive-full-index | ||
token: ${{ secrets.BITNAMI_BOT_TOKEN }} | ||
- id: download-artifact-archive-full-index | ||
name: Download artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: archive-full-index | ||
- id: update-index | ||
name: git-add-push | ||
run: | | ||
git config user.name "Bitnami Containers" | ||
git config user.email "[email protected]" | ||
git fetch origin archive-full-index | ||
git reset --hard $(git commit-tree origin/archive-full-index^{tree} -m "Update index.yaml") | ||
# Compare size of files | ||
if [[ $(stat -c%s bitnami/index.yaml) -gt $(stat -c%s index.yaml) ]]; then | ||
echo "New index.yaml file is shorter than the current one" | ||
exit 1 | ||
fi | ||
cp index.yaml bitnami/index.yaml | ||
git add bitnami/index.yaml && git commit --signoff --amend --no-edit && git push origin archive-full-index --force-with-lease |
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: '[Index] Sync bitnami/charts index.yaml to S3' | ||
|
||
on: | ||
push: | ||
branches: | ||
- index | ||
|
||
jobs: | ||
deploy: | ||
name: Sync bitnami/charts index.yaml to S3 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: Upload to S3 | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_PUBLISH_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_PUBLISH_SECRET_ACCESS_KEY }} | ||
AWS_ASSUME_ROLE_ARN: ${{ secrets.AWS_PUBLISH_ROLE_ARN }} | ||
AWS_DEFAULT_REGION: ${{ secrets.AWS_REGION }} | ||
run: | | ||
# Configure AWS account | ||
export $(printf "AWS_ACCESS_KEY_ID=%s AWS_SECRET_ACCESS_KEY=%s AWS_SESSION_TOKEN=%s" $(aws sts assume-role --role-arn ${AWS_ASSUME_ROLE_ARN} --role-session-name GitHubIndex --query "Credentials.[AccessKeyId,SecretAccessKey,SessionToken]" --output text)) | ||
aws s3 cp --follow-symlinks bitnami/index.yaml s3://${{ secrets.AWS_S3_BUCKET }}/bitnami/ | ||
aws s3 cp --follow-symlinks bitnami/index.html s3://${{ secrets.AWS_S3_BUCKET }}/ |
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 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta http-equiv="Content-type" content="text/html;charset=UTF-8"> | ||
<title>Bitnami Helm Charts</title> | ||
</head> | ||
<body> | ||
|
||
<h1 id="bitnami-library-kubernetes">The Bitnami Library for Kubernetes</h1> | ||
|
||
Popular applications, provided by <a href="https://bitnami.com">Bitnami</a>, ready to launch on Kubernetes using <a href="https://github.com/helm/helm">Kubernetes Helm</a>. | ||
|
||
<h2 id="tldr">TL;DR</h2> | ||
|
||
<code> | ||
$ helm repo add bitnami https://charts.bitnami.com/bitnami<br /> | ||
$ helm search repo bitnami<br /> | ||
$ helm install my-release bitnami/<chart> | ||
</code> | ||
|
||
<p>For more information, please refer to the <a href="https://github.com/bitnami/charts">Bitnami charts project on GitHub</a>.</p> | ||
|
||
</body> | ||
</html> |
Oops, something went wrong.