From b94e20ffadab9dd3793d952896f2e6e1f5c045e6 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Sat, 17 Nov 2012 23:21:14 -0600 Subject: [PATCH 1/4] * adding jenkins build script --- jenkins | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 jenkins diff --git a/jenkins b/jenkins new file mode 100755 index 000000000..5c80a3ba3 --- /dev/null +++ b/jenkins @@ -0,0 +1,17 @@ +#!/bin/bash + +echo "starting build..." +./build + +if [ "$?" = "0" ]; then + echo "build succeeded" + echo "publishing gem" + pushd "target/ruby_package" + curl -T *.gem http://localhost:9000/gems + popd + echo "done publishing gems" +else + echo "build failed" +fi + + From 5c17f89a246b5b81eeebff5b15d33c8ec2dddd2e Mon Sep 17 00:00:00 2001 From: Seth Call Date: Sat, 17 Nov 2012 23:23:58 -0600 Subject: [PATCH 2/4] * jenkins script fails if curl push fails --- jenkins | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/jenkins b/jenkins index 5c80a3ba3..5d1ba94b8 100755 --- a/jenkins +++ b/jenkins @@ -8,10 +8,16 @@ if [ "$?" = "0" ]; then echo "publishing gem" pushd "target/ruby_package" curl -T *.gem http://localhost:9000/gems + + if [ "$?" != "0" ]; then + "publish failed" + exit 1 + fi popd echo "done publishing gems" else echo "build failed" + exit 1 fi From bac868558ce106c854dc5a7c1be6f64323a8a603 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Sat, 17 Nov 2012 23:26:42 -0600 Subject: [PATCH 3/4] * fail on error for curl --- jenkins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkins b/jenkins index 5d1ba94b8..8770f0288 100755 --- a/jenkins +++ b/jenkins @@ -7,7 +7,7 @@ if [ "$?" = "0" ]; then echo "build succeeded" echo "publishing gem" pushd "target/ruby_package" - curl -T *.gem http://localhost:9000/gems + curl -f -T *.gem http://localhost:9000/gems if [ "$?" != "0" ]; then "publish failed" From 6943ec207d3401f2ad39169ce8cb43cd8d3bfa08 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Sat, 17 Nov 2012 23:38:46 -0600 Subject: [PATCH 4/4] * tested version of jenkins script; should work this time --- jenkins | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/jenkins b/jenkins index 8770f0288..b80360438 100755 --- a/jenkins +++ b/jenkins @@ -1,5 +1,7 @@ #!/bin/bash +GEM_SERVER=http://localhost:9000/gems + echo "starting build..." ./build @@ -7,10 +9,10 @@ if [ "$?" = "0" ]; then echo "build succeeded" echo "publishing gem" pushd "target/ruby_package" - curl -f -T *.gem http://localhost:9000/gems + find . -name *.gem -exec curl -f -T {} $GEM_SERVER/{} \; if [ "$?" != "0" ]; then - "publish failed" + echo "publish failed" exit 1 fi popd