Small update/correction to README + uncommenting chunk of Forgejo Action automation
All checks were successful
Deploy the Helm Chart / build (push) Successful in 9s
All checks were successful
Deploy the Helm Chart / build (push) Successful in 9s
This commit is contained in:
parent
f40cbdf6dd
commit
0b611db030
2 changed files with 66 additions and 66 deletions
|
|
@ -31,27 +31,27 @@ jobs:
|
||||||
|
|
||||||
# Note, this depends on the [Harbor Helm Index](https://git.bridgemanaccessible.ca/Bridgeman-Accessible/harbor-helm-index) pretty heavily
|
# Note, this depends on the [Harbor Helm Index](https://git.bridgemanaccessible.ca/Bridgeman-Accessible/harbor-helm-index) pretty heavily
|
||||||
# In particular, that tool allows us to treat what is an OCI registry as a Helm repository (which includes using `helm search repo`)
|
# In particular, that tool allows us to treat what is an OCI registry as a Helm repository (which includes using `helm search repo`)
|
||||||
#helm repo add BridgemanAccessible https://helm.bridgemanaccessible.ca
|
helm repo add BridgemanAccessible https://helm.bridgemanaccessible.ca
|
||||||
|
|
||||||
# Check if the chart is already in the repository or not
|
# Check if the chart is already in the repository or not
|
||||||
#REMOTE_CHART_WORK_OUTPUT=$(helm search repo BridgemanAccessible/$CHART_NAME 2>/dev/null || echo "")
|
REMOTE_CHART_WORK_OUTPUT=$(helm search repo BridgemanAccessible/$CHART_NAME 2>/dev/null || echo "")
|
||||||
#if [ -n "$REMOTE_CHART_WORK_OUTPUT" ]; then
|
if [ -n "$REMOTE_CHART_WORK_OUTPUT" ]; then
|
||||||
# # The chart is already in the repository, so we need to check if the version is the same or not
|
# The chart is already in the repository, so we need to check if the version is the same or not
|
||||||
# echo "Chart already exists in the repository. Checking version..."
|
echo "Chart already exists in the repository. Checking version..."
|
||||||
#
|
|
||||||
# IFS=' ' read -r -a REMOTE_VERSIONS <<< $(helm search repo BridgemanAccessible/$CHART_NAME --output json | jq '.[].version | @sh')
|
IFS=' ' read -r -a REMOTE_VERSIONS <<< $(helm search repo BridgemanAccessible/$CHART_NAME --output json | jq '.[].version | @sh')
|
||||||
#
|
|
||||||
# echo "Remote Chart Versions: ${REMOTE_VERSIONS[@]}"
|
echo "Remote Chart Versions: ${REMOTE_VERSIONS[@]}"
|
||||||
#else
|
else
|
||||||
# # The chart is not in the repository, so we'll need to add it
|
# The chart is not in the repository, so we'll need to add it
|
||||||
# echo "Chart not found in the repository. Adding it..."
|
echo "Chart not found in the repository. Adding it..."
|
||||||
#
|
|
||||||
# # Set a blank value so that it WON'T match the local version
|
# Set a blank value so that it WON'T match the local version
|
||||||
# IFS=' ' read -r -a REMOTE_VERSIONS <<< ""
|
IFS=' ' read -r -a REMOTE_VERSIONS <<< ""
|
||||||
#fi
|
fi
|
||||||
|
|
||||||
# Just to keep things clean/safe/etc... remove the repo
|
# Just to keep things clean/safe/etc... remove the repo
|
||||||
#helm repo remove BridgemanAccessible
|
helm repo remove BridgemanAccessible
|
||||||
|
|
||||||
# Get the local version from the Chart.yaml file
|
# Get the local version from the Chart.yaml file
|
||||||
LOCAL_VERSION=$(yq '.version' Chart.yaml)
|
LOCAL_VERSION=$(yq '.version' Chart.yaml)
|
||||||
|
|
@ -59,54 +59,54 @@ jobs:
|
||||||
LOCAL_VERSION=${LOCAL_VERSION%\"} # Remove trailing quote
|
LOCAL_VERSION=${LOCAL_VERSION%\"} # Remove trailing quote
|
||||||
echo "Local Chart Version: $LOCAL_VERSION"
|
echo "Local Chart Version: $LOCAL_VERSION"
|
||||||
|
|
||||||
#has_match='false'
|
has_match='false'
|
||||||
#if [ ${#REMOTE_VERSIONS[@]} -gt 0 ]; then
|
if [ ${#REMOTE_VERSIONS[@]} -gt 0 ]; then
|
||||||
# # Loop through the remote tags and check if any of them match the local version
|
# Loop through the remote tags and check if any of them match the local version
|
||||||
# for REMOTE_VERSION in ${REMOTE_VERSIONS[@]}; do
|
for REMOTE_VERSION in ${REMOTE_VERSIONS[@]}; do
|
||||||
# REMOTE_VERSION=${REMOTE_VERSION#\'} # Remove leading quote
|
REMOTE_VERSION=${REMOTE_VERSION#\'} # Remove leading quote
|
||||||
# REMOTE_VERSION=${REMOTE_VERSION%\'} # Remove trailing quote
|
REMOTE_VERSION=${REMOTE_VERSION%\'} # Remove trailing quote
|
||||||
#
|
|
||||||
# # Check if the remote tag is the same as the local tag
|
# Check if the remote tag is the same as the local tag
|
||||||
# if [ "$REMOTE_VERSION" == "$LOCAL_VERSION" ]; then
|
if [ "$REMOTE_VERSION" == "$LOCAL_VERSION" ]; then
|
||||||
# echo "Remote version matches local version!"
|
echo "Remote version matches local version!"
|
||||||
# has_match='true'
|
has_match='true'
|
||||||
# break
|
break
|
||||||
# fi
|
fi
|
||||||
# done
|
done
|
||||||
#fi
|
fi
|
||||||
|
|
||||||
# If the versions match, we want to increment the chart's patch version
|
# If the versions match, we want to increment the chart's patch version
|
||||||
#if [ "has_match" ]; then
|
if [ "has_match" ]; then
|
||||||
# echo "Versions match!"
|
echo "Versions match!"
|
||||||
#
|
|
||||||
# # Increment the patch version of the local version (Ex. 1.0.0 -> 1.0.1)
|
# Increment the patch version of the local version (Ex. 1.0.0 -> 1.0.1)
|
||||||
# IFS='.' read -r major minor patch <<< "$LOCAL_VERSION"
|
IFS='.' read -r major minor patch <<< "$LOCAL_VERSION"
|
||||||
# patch=$((patch + 1))
|
patch=$((patch + 1))
|
||||||
# NEW_LOCAL_VERSION="$major.$minor.$patch"
|
NEW_LOCAL_VERSION="$major.$minor.$patch"
|
||||||
#
|
|
||||||
# echo "New Local Version: $NEW_LOCAL_VERSION"
|
echo "New Local Version: $NEW_LOCAL_VERSION"
|
||||||
# echo "Committing new chart version change..."
|
echo "Committing new chart version change..."
|
||||||
#
|
|
||||||
# sed -i "s|version: \"$LOCAL_VERSION\"|version: \"$NEW_LOCAL_VERSION\"|g" Chart.yaml
|
sed -i "s|version: \"$LOCAL_VERSION\"|version: \"$NEW_LOCAL_VERSION\"|g" Chart.yaml
|
||||||
#
|
|
||||||
# LOCAL_VERSION=$NEW_LOCAL_VERSION
|
LOCAL_VERSION=$NEW_LOCAL_VERSION
|
||||||
#
|
|
||||||
# # Update remote URL to use the GITHUB_TOKEN for authentication
|
# Update remote URL to use the GITHUB_TOKEN for authentication
|
||||||
# git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@git.bridgemanaccessible.ca/${{ github.repository }}.git
|
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@git.bridgemanaccessible.ca/${{ github.repository }}.git
|
||||||
#
|
|
||||||
# # Setup git user details for committing the version change and tag
|
# Setup git user details for committing the version change and tag
|
||||||
# git config user.name "Forgejo Actions"
|
git config user.name "Forgejo Actions"
|
||||||
# git config user.email "actions@git.bridgemanaccessible.ca"
|
git config user.email "actions@git.bridgemanaccessible.ca"
|
||||||
#
|
|
||||||
# # Commit the version change to the `package.json` file
|
# Commit the version change to the `package.json` file
|
||||||
# git add Chart.yaml
|
git add Chart.yaml
|
||||||
# git commit -m "[Forgejo Actions] Update Helm chart version to $(yq -r '.version' Chart.yaml)"
|
git commit -m "[Forgejo Actions] Update Helm chart version to $(yq -r '.version' Chart.yaml)"
|
||||||
#
|
|
||||||
# # Push the changes to the repository
|
# Push the changes to the repository
|
||||||
# git push origin HEAD:main
|
git push origin HEAD:main
|
||||||
#else
|
else
|
||||||
# echo "Versions do not match!"
|
echo "Versions do not match!"
|
||||||
#fi
|
fi
|
||||||
|
|
||||||
#helm package .
|
#helm package .
|
||||||
#helm push ./$CHART_NAME-$LOCAL_VERSION.tgz oci://${{ secrets.REPOSITORY_HOSTNAME }}/helm
|
#helm push ./$CHART_NAME-$LOCAL_VERSION.tgz oci://${{ secrets.REPOSITORY_HOSTNAME }}/helm
|
||||||
|
|
@ -121,7 +121,7 @@ jobs:
|
||||||
# env:
|
# env:
|
||||||
# NAMESPACE: custom-vault
|
# NAMESPACE: custom-vault
|
||||||
# RELEASE_NAME: custom-vault
|
# RELEASE_NAME: custom-vault
|
||||||
# CHART_NAME: ${{ needs.build.outputs.chart-name }}
|
# CHART_NAME: ${{ needs.build.outputs.chart-name }}
|
||||||
# steps:
|
# steps:
|
||||||
# # Deploy the resources to the cluster
|
# # Deploy the resources to the cluster
|
||||||
# - name: Deploy Helm Chart
|
# - name: Deploy Helm Chart
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,6 @@ To use this chart as a dependency:
|
||||||
dependencies:
|
dependencies:
|
||||||
- name: ba-custom-hashicorp-vault
|
- name: ba-custom-hashicorp-vault
|
||||||
version: 1.0.0
|
version: 1.0.0
|
||||||
repository: "https://charts.bridgemanaccessible.ca/"
|
repository: "https://helm.bridgemanaccessible.ca/"
|
||||||
condition: vault.enabled
|
condition: vault.enabled
|
||||||
```
|
```
|
||||||
Loading…
Add table
Add a link
Reference in a new issue