-
-
Save KyMidd/d22583d8172ead4748d10425a47c9aa7 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
# Download the job XML | |
echo "- Downloading job xml/${job}_original.xml" | |
#rm xml/${job}_original.xml | |
curl -s -u "$JENKINS_USERNAME:$api_token" -X GET "https://$JENKINS_URL/job/${job}/config.xml" > xml/${job}_original.xml | |
# Check the git source | |
if [[ $(cat xml/${job}_original.xml | yq -p xml .project.scm.userRemoteConfigs | grep url) == *"github"* ]]; then | |
echo "✅ The pipeline already points at github, and requires no changes" | |
else | |
# Changes needed | |
echo "🚧 Pipeline needs changes" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment