Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F4083050
D1797.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1005 B
Referenced Files
None
Subscribers
None
D1797.diff
View Options
diff --git a/README.md b/README.md
--- a/README.md
+++ b/README.md
@@ -21,6 +21,13 @@
docker run -dt -p 8080:4567 -e JENKINS_URL=http://ci.domain.tld nasqueron/tommy
```
+### Exit codes
+
+The app uses the following exit codes:
+
+* 0: regular exit
+* 1: required configuration environment variable is missing
+
### Contributors
* Written by [@arfon](http://twitter.com/arfon "Twitter")
diff --git a/tommy.rb b/tommy.rb
--- a/tommy.rb
+++ b/tommy.rb
@@ -32,7 +32,15 @@
# Environment
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-JENKINS_URL = ENV['JENKINS_URL'] || 'http://username:password@jenkins.domain.tld'
+begin
+ JENKINS_URL = ENV.fetch('JENKINS_URL')
+rescue KeyError
+ $stderr.write %(You must define JENKINS_URL to your Jenkins instance URL.
+
+If you need to pass credentials, you can use the syntax http://username:password@jenkins.domain.tld.
+)
+ exit 1
+end
# -------------------------------------------------------------
# Project class
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Feb 2, 08:20 (20 h, 28 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2390798
Default Alt Text
D1797.diff (1005 B)
Attached To
Mode
D1797: Ensure JENKINS_URL is present at app start
Attached
Detach File
Event Timeline
Log In to Comment