Skip to content

Commit

Permalink
Confirms directoriews and bumps harbor version
Browse files Browse the repository at this point in the history
  • Loading branch information
crdant committed Oct 31, 2023
1 parent b2f062f commit 793ddf9
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -228,12 +228,12 @@ helm template harbor | kubectl preflight -
```

If you're satisfied with the tests, bump the version of your Helm chart in the file
`harbor/Chart.yaml` from `16.7.0` to `16.8.0`, then repackage it. You can edit
`harbor/Chart.yaml` from `19.2.0` to `19.3.0`, then repackage it. You can edit
the version in the Manifest Editor or run the following command to do it from
the shell:

```
yq -i '.version = "16.8.0"' harbor/Chart.yaml
yq -i '.version = "19.3.0"' harbor/Chart.yaml
```

Then run the `helm package` command to package the updated version:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ if [[ "${fails}" -ne "1" ]] ; then
fi

# look for the preflight template file
if [[ ! -f /home/replicant/release/harbor-16.8.0.tgz ]] ; then
if [[ ! -f /home/replicant/release/harbor-19.3.0.tgz ]] ; then
fail-message $'Please make sure you\'ve bumped the version of your Helm chart and re-packaged it'
let "result = result + 1"
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,6 @@ stringData:
message: Your cluster has sufficient memory available to run Harbor
HARBOR_PREFLIGHTS

yq -i '.version = "16.8.0"' /home/replicant/harbor/Chart.yaml
yq -i '.version = "19.3.0"' /home/replicant/harbor/Chart.yaml
helm package /home/replicant/harbor --destination /home/replicant/release
chown -R replicant /home/replicant/harbor /home/replicant/release
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ use the `Unstable` channel for this lab, since the latter
approach is best for teams working with feature branches.

```
replicated release create --promote Unstable --yaml-dir ./release --version 16.8.0 \
replicated release create --promote Unstable --yaml-dir ./release --version 19.3.0 \
--release-notes "Adds preflight checks to enable customers to validate cluster prerequisites before installing"
```

This creates a release for version `16.8.0` of the Harbor Helm
This creates a release for version `19.3.0` of the Harbor Helm
chart, and promotes it to the `Unstable` channel. The `create`
command output a sequence number that you'll need for `promote` (it
will be `2` if you haven't explored releasing a bit more).
Expand All @@ -112,14 +112,14 @@ of those channels---your teams review and approval processes,
steps in a continuous delivery pipeline, or both. Run the following command to promote our release to the `Beta` channel:

```
replicated release promote 2 Beta --version 16.8.0 \
replicated release promote 2 Beta --version 19.3.0 \
--release-notes "Adds preflight checks to enable customers to validate cluster prerequisites before installing"
```

Then promote to the `Stable` channel:

```
replicated release promote 2 Stable --version 16.8.0 \
replicated release promote 2 Stable --version 19.3.0 \
--release-notes "Adds preflight checks to enable customers to validate cluster prerequisites before installing"
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@ result=0
# check for release to Unstable
api_token=$(get_api_token)
unstable_version=$(curl --header "Accept: application/json" --header "Authorization: ${api_token}" https://api.replicated.com/vendor/v3/apps | jq -r '.apps[0].channels[] | select( .name == "Unstable" ) | .currentVersion')
if [[ ! "${unstable_version}" == "16.8.0" ]] ; then
fail-message $'Please be sure to release the applicaton to the \`Unstable\` channel with version \`16.8.0\`'
if [[ ! "${unstable_version}" == "19.3.0" ]] ; then
fail-message $'Please be sure to release the applicaton to the \`Unstable\` channel with version \`19.3.0\`'
let "result = result + 1"
fi

# check for promotion to Beta
beta_version=$(curl --header "Accept: application/json" --header "Authorization: ${api_token}" https://api.replicated.com/vendor/v3/apps | jq -r '.apps[0].channels[] | select( .name == "Beta" ) | .currentVersion')
if [[ ! "${beta_version}" == "16.8.0" ]] ; then
fail-message $'Please be sure to promote the applicaton to the \`Beta\` channel with version \`16.8.0\`'
if [[ ! "${beta_version}" == "19.3.0" ]] ; then
fail-message $'Please be sure to promote the applicaton to the \`Beta\` channel with version \`19.3.0\`'
let "result = result + 1"
fi

# check for promotion to Stable
stable_version=$(curl --header "Accept: application/json" --header "Authorization: ${api_token}" https://api.replicated.com/vendor/v3/apps | jq -r '.apps[0].channels[] | select( .name == "Stable" ) | .currentVersion')
if [[ ! "${stable_version}" == "16.8.0" ]] ; then
fail-message $'Please be sure to promote the applicaton to the \`Stable\` channel with version \`16.8.0\`'
if [[ ! "${stable_version}" == "19.3.0" ]] ; then
fail-message $'Please be sure to promote the applicaton to the \`Stable\` channel with version \`19.3.0\`'
let "result = result + 1"
fi

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@ api_token=$(get_api_token)
app_slug=$(curl --header "Accept: application/json" --header "Authorization: ${api_token}" https://api.replicated.com/vendor/v3/apps | jq -r '.apps[0].slug')

# release to the `Unstable` channel
replicated release create --promote Unstable --yaml-dir /home/replicant/release --version 16.8.0 \
replicated release create --promote Unstable --yaml-dir /home/replicant/release --version 19.3.0 \
--release-notes "Adds preflight checks to enable customers to validate cluster prerequisites before installing" \
--app ${app_slug} --token ${api_token}

# get the sequence number for the release to promote
release_sequence=$(curl --header "Accept: application/json" --header "Authorization: ${api_token}" https://api.replicated.com/vendor/v3/apps | jq -r '.apps[0].channels[] | select( .name == "Unstable" ) | .releaseSequence')

# promote to the `Beta` channel
replicated release promote ${release_sequence} Beta --version 16.8.0 \
replicated release promote ${release_sequence} Beta --version 19.3.0 \
--release-notes "Adds preflight checks to enable customers to validate cluster prerequisites before installing" \
--app ${app_slug} --token ${api_token}

# promote to the `Stable` channel
replicated release promote ${release_sequence} Stable --version 16.8.0 \
replicated release promote ${release_sequence} Stable --version 19.3.0 \
--release-notes "Adds preflight checks to enable customers to validate cluster prerequisites before installing" \
--app ${app_slug} --token ${api_token}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Password: `[[ Instruqt-Var key="PASSWORD" hostname="shell" ]]`

You'll land on the "Channels" page for your app, which will show
the release channels we discussed in the previous step. Notice that
each of the default channels shows the current version `16.8.0`,
each of the default channels shows the current version `19.3.0`,
while the channel LTS, which we haven't released to, reflects
that.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ result=0

# check for release to Unstable
installed_chart=$(helm list -o yaml --kubeconfig /home/replicant/.kube/config | yq '.[0].chart')
if [[ ! "${installed_chart}" == "harbor-16.8.0" ]] ; then
if [[ ! "${installed_chart}" == "harbor-19.3.0" ]] ; then
fail-message 'Please be sure to install the Harbor Helm chart'
let "result = result + 1"
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ export REPLICATED_API_TOKEN=${api_token}
export REPLICATED_APP=${app_slug}

cd /home/replicant
mkdir release
helm pull --version 16.6.8 oci://registry-1.docker.io/bitnamicharts/harbor --untar
yq -i '.version = "16.7.0"' harbor/Chart.yaml
mkdir /home/replicant/release

helm pull --version 19.1.0 oci://registry-1.docker.io/bitnamicharts/harbor --untar
yq -i '.version = "19.2.0"' harbor/Chart.yaml
replicated_sdk_version=$(curl -qsfL https://api.github.com/repos/replicatedhq/replicated-sdk/tags | jq -r '.[0] | .name')
yq -i ".dependencies += { \"name\": \"replicated\", \"repository\": \"oci://registry.replicated.com/library\", \"version\": \"${replicated_sdk_version#?}\"}" harbor/Chart.yaml

Expand All @@ -45,20 +46,20 @@ helm package harbor --destination release
# release and promote the app

# release to the `Unstable` channel
replicated release create --promote Unstable --yaml-dir /home/replicant/release --version 16.7.0 \
replicated release create --promote Unstable --yaml-dir /home/replicant/release --version 19.2.0 \
--release-notes "Prepares for distribution with Replicated by incorporating the Replicated SDK" \
--app ${app_slug} --token ${api_token}

# get the sequence number for the release to promote
release_sequence=$(curl --header "Accept: application/json" --header "Authorization: ${api_token}" https://api.replicated.com/vendor/v3/apps | jq -r '.apps[0].channels[] | select( .name == "Unstable" ) | .releaseSequence')

# promote to the `Beta` channel
replicated release promote ${release_sequence} Beta --version 16.7.0 \
replicated release promote ${release_sequence} Beta --version 19.2.0 \
--release-notes "Prepares for distribution with Replicated by incorporating the Replicated SDK" \
--app ${app_slug} --token ${api_token}

# promote to the `Stable` channel
replicated release promote ${release_sequence} Stable --version 16.7.0 \
replicated release promote ${release_sequence} Stable --version 19.2.0 \
--release-notes "Prepares for distribution with Replicated by incorporating the Replicated SDK" \
--app ${app_slug} --token ${api_token}

Expand All @@ -67,7 +68,7 @@ replicated channel create --name LTS --description "Releases with long-term supp
--app ${app_slug} --token ${api_token}

# remove the helm chart we used to create the release
rm /home/replicant/release/harbor-16.7.0.tgz
rm /home/replicant/release/harbor-19.2.0.tgz

# make sure permissions are good
chown -R replicant /home/replicant/harbor /home/replicant/release

0 comments on commit 793ddf9

Please sign in to comment.