Skip to content

Commit a25d445

Browse files
committed
Merging master into local branch
2 parents 6ba6823 + 31b685b commit a25d445

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

docker/run_docker.rb

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,33 @@
3333
spectra_user_keys = JSON.parse(response.body)["data"][0]
3434
abort("Spectra User Keys not found.") if spectra_user.keys.nil?
3535

36-
ENV["DOCKER_REPO"] = ENV["DOCKER_REPO"] || "denverm80/ds3_jsdk_docker_test:latest"
3736
ENV["DS3_ENDPOINT"] = "#{ENV['DS3_ENDPOINT']}.eng.sldomain.com"
3837
ENV["DS3_SECRET_KEY"] = spectra_user_keys["secret_key"]
3938
ENV["DS3_ACCESS_KEY"] = spectra_user_keys["auth_id"]
40-
ENV["GIT_BRANCH"] = ENV["GIT_BRANCH"] || "master"
4139
puts "DS3_ENDPOINT #{ENV["DS3_ENDPOINT"]}"
4240
puts "DS3_SECRET_KEY #{ENV["DS3_SECRET_KEY"]}"
4341
puts "DS3_ACCESS_KEY #{ENV["DS3_ACCESS_KEY"]}"
44-
puts "DOCKER_REPO #{ENV["DOCKER_REPO"]}"
42+
43+
ENV["GIT_REPO"] = ENV["GIT_REPO"] || "https://github.com/SpectraLogic/ds3_java_sdk.git"
44+
ENV["GIT_BRANCH"] = ENV["GIT_BRANCH"] || "master"
4545
puts "GIT_REPO #{ENV["GIT_REPO"] || "default"}"
4646
puts "GIT_BRANCH #{ENV["GIT_BRANCH"]}"
47-
47+
48+
ENV["DOCKER_REPO"] = ENV["DOCKER_REPO"] || "denverm80/ds3_jsdk_docker_test:latest"
49+
puts "DOCKER_REPO #{ENV["DOCKER_REPO"]}"
50+
51+
# pull down the git repo
52+
puts `git clone #{ENV["GIT_REPO"]} --branch #{ENV["GIT_BRANCH"]} --single-branch`
53+
54+
# Build latest docker image
55+
puts "docker build -t #{ENV['DOCKER_REPO']} ./ds3_java_sdk/docker/"
56+
docker_build_output = `docker build -t #{ENV["DOCKER_REPO"]} ./ds3_java_sdk/docker/`
57+
docker_build_status = $?
58+
puts docker_build_output
59+
puts "docker build status[#{docker_build_status}][#{docker_build_status.exitstatus}]"
60+
4861
puts "docker run -e DS3_ENDPOINT -e DS3_SECRET_KEY -e DS3_ACCESS_KEY -e GIT_REPO -e GIT_BRANCH -it --dns=10.1.0.9 #{ENV["DOCKER_REPO"]}"
62+
# remove the -it if not running from an interactive terminal
4963
output = `docker run -e DS3_ENDPOINT -e DS3_SECRET_KEY -e DS3_ACCESS_KEY -e GIT_REPO -e GIT_BRANCH -it --dns=10.1.0.9 #{ENV["DOCKER_REPO"]}`
5064

5165
docker_status = $?

0 commit comments

Comments
 (0)