Skip to content

Commit

Permalink
Improvements for 0.39.0 release
Browse files Browse the repository at this point in the history
Signed-off-by: Jade Carino <carino_jade@yahoo.co.uk>
  • Loading branch information
jadecarino committed Dec 9, 2024
1 parent 2409bc6 commit 827b5e3
Show file tree
Hide file tree
Showing 6 changed files with 97 additions and 51 deletions.
16 changes: 16 additions & 0 deletions releasePipeline/02-create-argocd-apps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,21 @@ function create_maven_repos {
--helm-set mvp.deploy=true
}

function create_bld {
argocd app create ${release_type}-bld \
--project default \
--sync-policy auto \
--sync-option Prune=true \
--self-heal \
--repo https://github.com/galasa-dev/automation \
--revision HEAD \
--path infrastructure/galasa-plan-b-lon02/galasa-development/galasabld \
--dest-server https://kubernetes.default.svc \
--dest-namespace galasa-development \
--helm-set branch=${release_type} \
--helm-set imageTag=${release_type}
}

function create_cli {
argocd app create ${release_type}-cli \
--project default \
Expand Down Expand Up @@ -99,6 +114,7 @@ if [[ "$CALLED_BY_PRERELEASE" == "" ]]; then
ask_user_for_release_type
set -e
create_maven_repos
create_bld
create_cli
create_simplatform
fi
59 changes: 31 additions & 28 deletions releasePipeline/25-check-artifacts-signed.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,78 +92,81 @@ function ask_user_for_release_type {


function check_maven_repo_for_jar_asc {
github_repo_name=$1
artifact_name=$1

# For example, the following repo needs checking...
# https://development.galasa.dev/prerelease/maven-repo/maven/dev/galasa/com.auth0.jwt/
# https://development.galasa.dev/prerelease/maven-repo/obr/dev/galasa/dev.galasa.wrapping.com.auth0.jwt/

url="https://development.galasa.dev/${release_type}/maven-repo/${github_repo_name}/dev/galasa/com.auth0.jwt/"
curl $url > temp/top_level_maven_contents_${github_repo_name}.txt
url="https://development.galasa.dev/${release_type}/maven-repo/obr/dev/galasa/${artifact_name}/"
curl $url > temp/top_level_maven_contents_${artifact_name}.txt
rc=$?;
if [[ "${rc}" != "0" ]]; then
error "Failed to get top-level information from maven repo for github repo ${github_repo_name}"
error "Failed to get top-level information from maven repo for artifact ${artifact_name}"
exit 1
fi


# Gives us something like this:
# <html>
# <head>
# <title>Index of /prerelease/maven-repo/maven/dev/galasa/com.auth0.jwt</title>
# <title>Index of /prerelease/maven-repo/obr/dev/galasa/dev.galasa.wrapping.com.auth0.jwt</title>
# </head>
# <body>
# <h1>Index of /prerelease/maven-repo/maven/dev/galasa/com.auth0.jwt</h1>
# <h1>Index of /prerelease/maven-repo/obr/dev/galasa/dev.galasa.wrapping.com.auth0.jwt</h1>
# <pre> <a href="?C=N;O=D">Name</a> <a href="?C=M;O=A">Last modified</a> <a href="?C=S;O=A">Size</a> <hr> <a href="/prerelease/maven-repo/maven/dev/galasa/">Parent Directory</a> -
# <a href="3.8.1/">3.8.1/</a> 2023-06-13 12:58 -
# <a href="0.39.0/">0.39.0/</a> 2023-06-13 12:58 -
# <a href="maven-metadata.xml">maven-metadata.xml</a> 2023-06-13 12:58 303
# <a href="maven-metadata.xml.md5">maven-metadata.xml.md5</a> 2023-06-13 12:58 32
# <a href="maven-metadata.xml.sha1">maven-metadata.xml.sha1</a> 2023-06-13 12:58 40
# <hr></pre>
# </body></html>
#
# ... and we need to pick-out the '3.8.1' version number.
# ... and we need to pick-out the '0.39.0' version number.

# Note: We take the 2nd line which has an "<a href" string on... hopefully it won't change...
artifact_version=$(cat temp/top_level_maven_contents_${github_repo_name}.txt | grep "<a href" | head -2 | tail -1 | cut -f2 -d'"' | cut -f1 -d'/')
artifact_version=$(cat temp/top_level_maven_contents_${artifact_name}.txt | grep "<a href" | head -2 | tail -1 | cut -f2 -d'"' | cut -f1 -d'/')

info "Version of artifact in repo ${github_repo_name} is ${artifact_version}"
info "Version of artifact ${artifact_name} is ${artifact_version}"

url="https://development.galasa.dev/${release_type}/maven-repo/${github_repo_name}/dev/galasa/com.auth0.jwt/${artifact_version}/"
url="https://development.galasa.dev/${release_type}/maven-repo/obr/dev/galasa/${artifact_name}/${artifact_version}/"
info "Looking at url for a more detailed list of artifacts. url: $url"

# -L option follows re-directs.
curl -L $url > temp/detailed_level_maven_contents_${github_repo_name}.txt
curl -L $url > temp/detailed_level_maven_contents_${artifact_name}.txt
rc=$?;
if [[ "${rc}" != "0" ]]; then
error "Failed to get detailed-level information from maven repo for github repo ${github_repo_name}"
error "Failed to get detailed-level information from maven repo for artifact ${artifact_name}"
exit 1
fi

# That file downloaded should contain the string "com.auth0.jwt-${artifact_version}.jar.asc"
info "looking for the .jar.asc in the maven file listing..."
grep "com.auth0.jwt-${artifact_version}.jar.asc" temp/detailed_level_maven_contents_${github_repo_name}.txt
# That file downloaded should contain the string "${artifact_name}-${artifact_version}.pom.asc"
info "looking for the .pom.asc in the maven file listing..."
grep "${artifact_name}-${artifact_version}.pom.asc" temp/detailed_level_maven_contents_${artifact_name}.txt
rc=$?
if [[ "${rc}" != "0" ]]; then
error "The .jar.asc file for repository ${github_repo_name} is missing!"
error "The .pom.asc file for artifact ${artifact_name} is missing!"
exit 1
fi

success "The .jar.asc file for repository ${github_repo_name} was found."
success "The .pom.asc file for artifact ${artifact_name} was found."
}


ask_user_for_release_type



# TOOD: Do the same thing for


declare -a repo_list=("obr" )
declare -a artifact_list=(
"dev.galasa.platform"\
"dev.galasa.wrapping.com.auth0.jwt"\
"dev.galasa.gradle.impl"\
"galasa-maven-plugin"\
"dev.galasa.framework"\
"dev.galasa.ras.couchdb"\
"dev.galasa.core.manager"\
"dev.galasa.uber.obr"
)

# Iterate the string array using for loop
for github_repo_name in ${repo_list[@]}; do
check_maven_repo_for_jar_asc $github_repo_name
for artifact in ${artifact_list[@]}; do
check_maven_repo_for_jar_asc $artifact
done

success "All checks done and passed."
2 changes: 2 additions & 0 deletions releasePipeline/92-delete-argocd-apps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
#

argocd app delete release-maven-repos
argocd app delete release-bld
argocd app delete release-cli
argocd app delete release-simplatform
argocd app delete prerelease-maven-repos
argocd app delete prerelease-bld
argocd app delete prerelease-cli
argocd app delete prerelease-simplatform

Expand Down
53 changes: 40 additions & 13 deletions releasePipeline/95-move-to-new-version.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,19 @@ These are manual steps to bump the version of Galasa to the next version.

a. Create branch

b. Invoke the `set-version --version {new version}` script in each of these modules in order:
b. Invoke the `./tools/set-version --version {new version}` script in which invokes a separate `set-version.sh` for each module.

i. Framework
ii. Extensions
iii. Managers
iv. OBR
c. Currently not all versions are found by the script alone such as dev.galasa.platform's version used throughout the code, so do a search for the current version in VSCode and replace with the new development version. Manually check that all dev.galasa bundles have been upgraded.

c. Make sure it builds with `./tools/build-locally.sh --module framework --chain true` which will invoke each individual module's `build-locally.sh` script
d. Make sure it builds with `./tools/build-locally.sh` which will invoke each individual module's `build-locally.sh` script. Make sure the API Server starts locally also.

d. Push the changes to your branch
e. Push the changes to your branch

e. Open PR for this change and wait for the PR build to pass
f. Open PR for this change and wait for the PR build to pass

f. Merge in the PR
g. Merge in the PR and wait for the Main build to pass and finish

g. Upgrade the `galasaecosystem.runtime.version` CPS property with the release version value, for example: `galasactl properties set --namespace galasaecosystem --name runtime.version --value 0.35.0 --bootstrap https://prod1-galasa-dev.cicsk8s.hursley.ibm.com/api/bootstrap`. This is needed so the 'run-tests' pipeline will pass in the next step.
**Note:** Once the Galasa mono repo's build finishes, this will trigger the `recycle-prod1` Tekton pipeline, which will then trigger the `run-tests` Tekton pipeline. The `run-tests` will fail as the CPS properties have not yet been upgraded to the new development version - this is okay.


3. Upgrade CLI
Expand All @@ -40,15 +37,15 @@ These are manual steps to bump the version of Galasa to the next version.

f. Merge in the PR and wait for the Main build to pass and finish

g. When the isolated Main build is triggered, cancel it with `kubectl delete pipelinerun -n galasa-build trigger-isolated-main-xxxx` replacing the correct pipeline run name.
g. When the Isolated Main build is triggered, cancel it on the GitHub UI [here](https://github.com/galasa-dev/isolated/actions/workflows/build.yaml) with the "Cancel Workflow" button, as you are going to rebuild it in the next step anyway.

4. Upgrade Isolated

a. Create branch

b. Invoke the `set-version --version {new version}` script.
b. Invoke the `set-version --version {new version}` script. Currently not all versions are found by the script alone, so do a search for the current version in VSCode and replace with the new development version. Manually check that all dev.galasa bundles have been upgraded.

c. Make sure it builds with `build-locally.sh`
c. There is no `build-locally.sh` script for this repo so you will have to rely on the GitHub Actions workflow to confirm it builds okay.

d. Push

Expand All @@ -63,3 +60,33 @@ These are manual steps to bump the version of Galasa to the next version.
c. Push

e. Open PR for this change, wait for the PR build to pass, then merge in the PR, and wait for the Main build to pass and finish.

6. Upgrade Simplatform

a. Create branch

b. Currently no `set-version.sh` script exists so do a search for the current version in VSCode and replace with the new development version. Manually check that all dev.galasa bundles have been upgraded then run `build-locally.sh` to check it builds.

c. Push

e. Open PR for this change, wait for the PR build to pass, then merge in the PR, and wait for the Main build to pass and finish.

7. Upgrade Web UI

a. Create branch

b. Invoke the `set-version --version {new version}` script.

c. Push

e. Open PR for this change, wait for the PR build to pass, then merge in the PR, and wait for the Main build to pass and finish.

8. Upgrade Integratedtests (not a released component)

a. Create branch

b. Currently no `set-version.sh` script exists so do a search for the current version in VSCode and replace with the new development version. Manually check that all dev.galasa bundles have been upgraded then run `build-locally.sh` to check it builds.

c. Push

e. Open PR for this change, wait for the PR build to pass, then merge in the PR, and wait for the Main build to pass and finish.
6 changes: 4 additions & 2 deletions releasePipeline/prerelease.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ a new branch called `prerelease` in every github repo we need to build. **Note:*
- Branch: `pre-release`
- Enable Jacoco code coverage: `false`
- Artifacts should be signed: `true`
8. Build the CLI and Isolated repositories that are not included in the mono repo. The CLI build which will trigger the Isolated build down the chain. Select the "Run workflow" button on [this page](https://github.com/galasa-dev/cli/actions/workflows/build.yml) and select the following inputs:
- Branch: `pre-release`
8. The build of the CLI repository and Isolated repository will be triggered automatically as part of the build chain, so monitor those builds and make sure they finish successfully.
- The [CLI Main build workflow](https://github.com/galasa-dev/cli/actions/workflows/build.yml) should run with the `prerelease` ref
- This will trigger the Tekton pipeline `test-cli-ecosystem-commands` so go to the Tekton dashboard
- That will then trigger the [Isolated Main build workflow](https://github.com/galasa-dev/isolated/actions/workflows/build.yaml) for the `prerelease` ref back in GitHub
9. Run the Web UI Main build. Select the "Run workflow" button on [this page](https://github.com/galasa-dev/webui/actions/workflows/build.yaml) and select the following inputs:
- Branch: `pre-release`
10. Run [25-check-artifacts-signed.sh](./25-check-artifacts-signed.sh). When prompted, choose the '`pre-release`' option.
Expand Down
12 changes: 4 additions & 8 deletions releasePipeline/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ For each of the Kubernetes Tekton command, you can follow with tkn -n galasa-bui
- Branch: `release`
- Enable Jacoco code coverage: `false`
- Artifacts should be signed: `true`
2. Build the CLI and Isolated repositories that are not included in the mono repo. The CLI build which will trigger the Isolated build down the chain. Select the "Run workflow" button on [this page](https://github.com/galasa-dev/cli/actions/workflows/build.yml) and select the following inputs:
- Branch: `release`
2. The build of the CLI repository and Isolated repository will be triggered automatically as part of the build chain, so monitor those builds and make sure they finish successfully.
- The [CLI Main build workflow](https://github.com/galasa-dev/cli/actions/workflows/build.yml) should run with the `release` ref
- This will trigger the Tekton pipeline `test-cli-ecosystem-commands` so go to the Tekton dashboard
- That will then trigger the [Isolated Main build workflow](https://github.com/galasa-dev/isolated/actions/workflows/build.yaml) for the `release` ref back in GitHub
3. Run the Web UI Main build. Select the "Run workflow" button on [this page](https://github.com/galasa-dev/webui/actions/workflows/build.yaml) and select the following inputs:
- Branch: `release`
4. Run [28-run-regression-tests.sh](./28-run-regression-tests.sh). All the tests must pass before moving on. For the ones which fail, run them individually:
Expand Down Expand Up @@ -107,12 +109,6 @@ Once an approver has approved, you can move on.
7. `exit` the image. -->
<!-- End of temporary steps -->

**IMPORTANT if releasing a Galasa wrapper:** This step uses the release version number to identify artefacts that have been updated in this release. However, the Galasa wrappers for OSGi bundles do not share the version naming conventions with the rest of the Galasa components, so won't get picked up in this. If a Galasa wrapper has been updated and needs to be released:

a. Amend line 87 of the 30-deploy-maven-galasa.sh script to say `galasa_version="<VERSION OF WRAPPER>"`. So if you are wanting to release jta version 1.2: `galasa_version="1.2"`.
b. Run the script as normal and check in the output on Tekton that only 1 artefact has been found and it is the expected one.
c. The next step will have to be done multiple times for each staging repository: the one with most of the components, and the other(s) for the wrapper(s).

2. 31-oss-sonatype-actions.md - Do the Sonatype actions detailed in this document, to check the maven artifacts are OK, and release them to maven central.
3. 32-wait-maven.sh - Run the watch command to wait for the artifacts to reach Maven Central. The release will appear in the BOM metadata. Wait until Maven Central is updated. Takes a while. 20 to 40-ish mins. Kill the terminal to exit this process.

Expand Down

0 comments on commit 827b5e3

Please sign in to comment.