Skip to content
This repository has been archived by the owner on Jan 4, 2023. It is now read-only.

Commit

Permalink
Can't execute the script as source ... write IP to file
Browse files Browse the repository at this point in the history
  • Loading branch information
tfennelly committed Sep 23, 2016
1 parent a2bb817 commit 8d4b0c0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 4 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ node ('docker') {
checkout scm

// Run selenium in a docker container of its own on the host.
// It will export BLUEO_SELENIUM_SERVER_ADDR
sh "sudo source start-selenium.sh"
// It will output the selenium server address to ./target/.selenium_ip
sh "./start-selenium.sh"
def seleniumIP = readFile './target/.selenium_ip'

try {
// Build an image from the the local Dockerfile
Expand All @@ -22,7 +23,7 @@ node ('docker') {
// -v /home/tfennelly/.m2:/home/bouser/.m2
//
athImg.inside("--expose=12345 -p 12345:12345 -v /home/tfennelly/.m2:/home/bouser/.m2") {
withEnv(["BLUEO_SELENIUM_SERVER_ADDR=${BLUEO_SELENIUM_SERVER_ADDR}"]) {
withEnv(["BLUEO_SELENIUM_SERVER_ADDR=${seleniumIP}"]) {
try {
sh "echo 'Starting build stage'"
// Build blueocean and the ATH
Expand Down
4 changes: 3 additions & 1 deletion start-selenium.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ echo ""
echo " Starting Selenium Docker container..."
echo ""
docker run -d --name blueo-selenium -p 15900:5900 -p 4444:4444 -e no_proxy=localhost selenium/standalone-firefox-debug:2.53.0
export BLUEO_SELENIUM_SERVER_ADDR=`docker inspect -f '{{ .NetworkSettings.IPAddress }}' blueo-selenium`

# Output the containers bridge network IP to file
docker inspect -f '{{ .NetworkSettings.IPAddress }}' blueo-selenium > ./target/.selenium_ip

echo ""
echo "**************************************************************"
Expand Down

0 comments on commit 8d4b0c0

Please sign in to comment.