-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Owen Rumney
committed
Dec 9, 2021
1 parent
d88991e
commit eaa38ea
Showing
2 changed files
with
18 additions
and
15 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
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,15 +1,25 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo "update plugin.yaml" | ||
set -ex | ||
|
||
sed -e "s/PLACEHOLDERVERSION/${GITHUB_REF##*/}/g" .github/plugin_template.yaml > plugin.yaml | ||
function log() { | ||
message=$1 | ||
|
||
echo `date +"%T"` $message | ||
} | ||
|
||
git fetch --all | ||
log "Switching to master branch" | ||
git checkout master | ||
git pull | ||
git config --global user.name "GitHub Actions Build" | ||
git config --global user.email github-action@aquasec.com | ||
|
||
log "Getting latest tags" | ||
git fetch --tags | ||
LATEST_TAG=`git describe --tag` | ||
|
||
sed -e "s/PLACEHOLDERVERSION/${GITHUB_REF##*/}/g" .github/plugin_template.yaml > plugin.yaml | ||
|
||
git checkout -b "plugin-update-${LATEST_TAG}" | ||
|
||
git add plugin.yaml | ||
git commit -m "GitHub Actions Build: Update plugin version" || true | ||
git push --set-upstream origin HEAD:master || true | ||
git commit -m "Updateing plugin to latest tag ${LATEST_TAG}" || true | ||
git push --set-upstream origin "plugin-update-${LATEST_TAG}" || true | ||
|