Created
June 21, 2023 10:34
-
-
Save jgato/06bd4cf7ab1946acdc011763e0dbf9d5 to your computer and use it in GitHub Desktop.
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
#! /bin/bash | |
# | |
echo "Execute the command from a directory containing a Git repo of the assisted-agent" | |
echo "Also, exports a proper KUBECONFIG to your Openshift cluster with RHACM installed" | |
IMAGE=`oc -n open-cluster-management get deployment infrastructure-operator -o yaml | grep assisted-installer-agent-rhel8 | grep value | awk '{print $2}'` | |
echo "#########################################" | |
echo "Assisted Agent image is: $IMAGE" | |
COMMIT=`skopeo inspect docker://${IMAGE} | grep "org.label-schema.vcs-ref" | awk '{print $2}' | awk -F '"' '{print $2}'` | |
echo "The image was built from https://github.com/openshift/assisted-service/commit/$COMMIT" | |
echo "#########################################" | |
git log --pretty=medium -1 ${COMMIT} | |
echo "#########################################" | |
BRANCH=`git branch -a --contains ${COMMIT} | tr -d '[:space:]'` | |
echo "The commit was done on branch(es): $BRANCH" | |
#it could be more than one branch ToDo: interate | |
#but you are mainly interested in the branc/version of your ACM | |
#if acm2.6 you are interested on branch ocm-release-2.6 | |
echo "All these other commits are not included in the current installed version" | |
git rev-list ${COMMIT}..${BRANCH} --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(cyan)<%an>%Creset' --abbrev-commit --date=relative | |
echo "#########################################" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment