-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #95 from rancher/dpock/repo-updates
[main] helm-project-operator and helm-locker repo reorg updates
- Loading branch information
Showing
59 changed files
with
1,682 additions
and
116 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,55 @@ | ||
#!/bin/bash | ||
|
||
# Exit immediately if a command exits with a non-zero status | ||
set -e | ||
|
||
# Function to get the previous tag | ||
getPreviousTag() { | ||
local tagPrefix="$1" | ||
# List all tags and filter ones that start with tagPrefix, sort by creation date | ||
git tag --sort=-creatordate | grep "^${tagPrefix}" | head -n 1 | ||
} | ||
|
||
# Determine if we're in a GitHub Actions environment | ||
if [ -n "$GITHUB_REF" ] && [ -n "$GITHUB_SHA" ]; then | ||
# Use GHA environment variables | ||
ref="$GITHUB_REF" | ||
commitSha="${GITHUB_SHA:0:7}" | ||
else | ||
# Fallback to local Git repo | ||
if [ ! -d ".git" ]; then | ||
echo "This script must be run from the root of a Git repository or GitHub Actions." | ||
exit 1 | ||
fi | ||
ref=$(git symbolic-ref HEAD) | ||
commitSha=$(git rev-parse --short HEAD) | ||
fi | ||
|
||
branchTag="" | ||
branchStaticTag="" | ||
prevTag="" | ||
|
||
if [ "$ref" == "refs/heads/main" ]; then | ||
branchTag="head" | ||
branchStaticTag="main-${commitSha}" | ||
prevTag=$(getPreviousTag "main-") | ||
elif [[ "$ref" == refs/heads/release/* ]]; then | ||
version="${ref#refs/heads/release/}" # Extract "vX.0" | ||
branchTag="${version}-head" | ||
branchStaticTag="${version}-head-${commitSha}" | ||
prevTag=$(getPreviousTag "${version}-head-") | ||
else | ||
gitTag=$(git tag -l --contains HEAD | head -n 1) | ||
if [[ -n "$gitTag" ]]; then | ||
branchTag="${gitTag}" | ||
branchStaticTag="${gitTag}-${commitSha}" | ||
else | ||
branchTag="dev-${commitSha}" | ||
branchStaticTag="dev-${commitSha}" | ||
fi | ||
fi | ||
|
||
# Output the results | ||
echo "branch_tag=${branchTag}" | ||
echo "branch_static_tag=${branchStaticTag}" | ||
echo "prev_static_tag=${prevTag}" |
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
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
set -x | ||
|
||
K3D_URL=https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | ||
DEFAULT_K3D_VERSION=v5.7.4 | ||
|
||
install_k3d(){ | ||
local k3dVersion=${K3D_VERSION:-${DEFAULT_K3D_VERSION}} | ||
echo -e "Downloading k3d@${k3dVersion} see: ${K3D_URL}" | ||
curl --silent --fail ${K3D_URL} | TAG=${k3dVersion} bash | ||
} | ||
|
||
install_k3d | ||
|
||
k3d 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.