Created
April 21, 2022 08:03
-
-
Save bechampion/90f00edba6189c9a5bb9019eab26ed21 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
for i in $(curl -s https://registry.hub.docker.com/v1/repositories/sonatype/nexus3/tags | sed -e 's/[][]//g' -e 's/"//g' -e 's/ //g' | tr '}' '\n' | awk -F: '{print $3}') | |
do | |
echo $i ; docker run --net=host -d --rm sonatype/nexus3:${i} | |
until [[ $(curl -s -o /dev/null localhost:8081 -w "%{response_code}") == 200 ]] | |
do | |
echo "waiting on nexus..." | |
sleep 1 | |
done | |
curl -s -H"Content-Type: application/json" -u "admin:$(sudo cat /proc/$(docker inspect $(docker ps | grep -v CONT | awk '{ print $1 }') -f '{{ .State.Pid }}')/root/nexus-data/admin.password)" http://localhost:8081/service/rest/swagger.json | jq -r '.paths|keys' | |
docker kill $(docker ps | grep -v CONT | awk '{ print $1 }') | |
done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment