-
Notifications
You must be signed in to change notification settings - Fork 269
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/GitHub actions - update release workflow to verify release wa…
…s successful (#779) * Workflow enhancements Extracted out Integration tests as a separate worflow Changed runner OS from 'ubuntu-latest' to 'ubuntu-18.04' * add new job to verify-release * Name Correction * Update pom.xml Co-authored-by: Eric Wittmann <[email protected]>
- Loading branch information
1 parent
02b4714
commit ea6dc29
Showing
3 changed files
with
118 additions
and
0 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,52 @@ | ||
#!/bin/bash | ||
|
||
############################################################################################################################################################################################# | ||
## Description: The script helps in verifying two things:- ## | ||
## (1) All the images that are passed as parameters are pushed successfully to dockerhub. This is done by fetching the SHA Digests ## | ||
## for all the images. If we are able to fetch the SHA Digest for the images, that means the images are available at Dockerhub ## | ||
## ## | ||
## (2) All the images that are passed as parameters are same or not. This is done by matching the SHA Digests for all the images. ## | ||
## If the SHA Digest for all the images are same, that means the images are same. ## | ||
## ## | ||
## NOTE: I have used "Skopeo" to inspect the images. Skopeo tool can helps us in inspecting the docker images without pulling them ## | ||
## ## | ||
## USAGE: The script accepts image names as paramaters. We can pass as many image names as we want. ## | ||
## ## | ||
## EXAMPLE: ./verify-docker-release.sh apicurio/apicurio-registry-infinispan:1.2.3.Final apicurio/apicurio-registry-infinispan:latest apicurio/apicurio-registry-infinispan:latest-release ## | ||
## ## | ||
############################################################################################################################################################################################# | ||
|
||
set -euo pipefail | ||
|
||
IMAGES=("$@") | ||
SHA=() | ||
i=0 | ||
|
||
# Fetching SHA Digest for the images | ||
for image in "${IMAGES[@]}"; do | ||
SHA[$i]=$(skopeo inspect --raw --tls-verify=false docker://${image} | jq --raw-output '.config.digest' | sed 's/sha256://;s/"//g') | ||
echo "SHA for Image ${image}: ${SHA[$i]}" | ||
((i=i+1)) | ||
done | ||
echo "The Images are successfully pushed to the dockerhub. Verifying if the images are same..." | ||
|
||
|
||
# Verifying if images are same by comparing SHA Digest of the images | ||
watermark=${SHA[0]} | ||
not_equal=false | ||
for i in "${SHA[@]}"; do | ||
if [[ "$watermark" != "$i" ]]; then | ||
not_equal=true | ||
break | ||
fi | ||
done | ||
|
||
if [[ $not_equal = "true" ]]; then | ||
echo "[FAILURE] The Images Are Not Same. Verification Failed" && exit 1 | ||
else | ||
echo "[SUCCESS] Verification Successfull! The SHA Digest Matched for all the images." | ||
fi | ||
|
||
|
||
|
||
|
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,31 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>com.apicurio.test</groupId> | ||
<artifactId>verify-registry-maven-deploy</artifactId> | ||
<version>1.0.0-SNAPSHOT</version> | ||
<name>verify-registry-maven-deploy</name> | ||
<description>Simple Project to verify the deployment of Apicurio Registry JARS</description> | ||
|
||
<properties> | ||
<!-- To be filled at runtime using "-Dversion.apicurio=1.x.x.Final" --> | ||
<version.apicurio>TBD</version.apicurio> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>io.apicurio</groupId> | ||
<artifactId>apicurio-registry-utils-serde</artifactId> | ||
<version>${version.apicurio}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.apicurio</groupId> | ||
<artifactId>apicurio-registry-rest-client</artifactId> | ||
<version>${version.apicurio}</version> | ||
</dependency> | ||
</dependencies> | ||
</project> | ||
|
||
|
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