Skip to content

Instantly share code, notes, and snippets.

@bechampion
Created April 21, 2022 08:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bechampion/90f00edba6189c9a5bb9019eab26ed21 to your computer and use it in GitHub Desktop.
Save bechampion/90f00edba6189c9a5bb9019eab26ed21 to your computer and use it in GitHub Desktop.
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