Skip to content

Commit

Permalink
Added nexus teardown script
Browse files Browse the repository at this point in the history
  • Loading branch information
haxorof committed Mar 17, 2024
1 parent 82d8043 commit 9e7e27c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,12 @@ jobs:

- name: Setup Nexus 3
run: ./setup_nexus.sh
working-directory: ./samples
working-directory: ./samples
env:
NEXUS_HOST: localhost

- name: Teardown Nexus 3
run: ./teardown_nexus.sh
working-directory: ./samples
env:
NEXUS_HOST: localhost
6 changes: 2 additions & 4 deletions samples/setup_nexus.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
#!/usr/bin/env bash
# Simple steps to setup Nexus 3 to run samples with.
# Note! nexus.localdomain must be set in your etc/hosts to where your local test instance will be available.
NEXUS_HOST=${NEXUS_HOST:-"nexus.localdomain"}
docker pull sonatype/nexus3
docker stop nexus
docker rm nexus --volumes
docker volume rm nexus_volume
# Default password would be admin123
docker run -d -p 8081:8081 --name nexus -v nexus_volume:/nexus-data -e NEXUS_SECURITY_RANDOMPASSWORD=false sonatype/nexus3
timeout 300 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' http://nexus.localdomain:8081/service/rest/v1/status/writable)" != "200" ]]; do sleep 5; done' || false
timeout 300 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' http://$NEXUS_HOST:8081/service/rest/v1/status/writable)" != "200" ]]; do sleep 5; done' || false
4 changes: 4 additions & 0 deletions samples/teardown_nexus.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
docker stop nexus
docker rm nexus --volumes
docker volume rm nexus_volume

0 comments on commit 9e7e27c

Please sign in to comment.