-
Notifications
You must be signed in to change notification settings - Fork 31
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 #566 from ericvaandering/no_deploy_chartmuseum
Redo script to only push helm charts to Harbor OCI
- Loading branch information
Showing
1 changed file
with
4 additions
and
18 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 |
---|---|---|
@@ -1,28 +1,14 @@ | ||
#!/bin/bash | ||
|
||
helm repo add stable https://charts.helm.sh/stable | ||
helm plugin install https://github.com/chartmuseum/helm-push | ||
helm repo add --username=${HARBOR_USERNAME} --password=${HARBOR_TOKEN} myrepo https://registry.cern.ch/chartrepo/cmsrucio | ||
helm repo update | ||
helm repo list | ||
# OCI | ||
echo "${HARBOR_TOKEN}" | helm registry login -u ${HARBOR_USERNAME} --password-stdin registry.cern.ch | ||
cd helm | ||
for chart in $(ls -d */Chart.yaml | xargs dirname); do | ||
# echo $chart | ||
LOCAL_VERSION=$(grep -R "version:" ${chart}/Chart.yaml | awk '{print $2}') | ||
if ! REMOTE_LATEST_VERSION="$(helm search repo myrepo/"${chart}" | grep myrepo/"${chart}" | awk '{print $2}')" ; then | ||
echo "INFO There are no remote versions." | ||
REMOTE_LATEST_VERSION="" | ||
fi | ||
# if [ "${REMOTE_LATEST_VERSION}" = "" ] || \ | ||
# [ "$(expr "${REMOTE_LATEST_VERSION}" \< "${LOCAL_VERSION}")" -eq 1 ]; then | ||
helm dep update ${chart} | ||
helm package ${chart} | ||
LOCAL_VERSION=$(grep -R "version:" ${chart}/Chart.yaml | awk '{print $2}') | ||
helm dep update ${chart} | ||
helm package ${chart} | ||
set +x | ||
helm cm-push --username=${HARBOR_USERNAME} --password=${HARBOR_TOKEN} "${chart}-${LOCAL_VERSION}.tgz" myrepo | ||
# OCI | ||
set -x | ||
set -x | ||
helm push "${chart}-${LOCAL_VERSION}.tgz" oci://registry.cern.ch/cmsrucio/helm | ||
# fi | ||
done |