marathon_deploy 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +6 -0
- data/lib/marathon_deploy/application.rb +9 -5
- data/lib/marathon_deploy/version.rb +1 -1
- data/marathon_deploy.gemspec +2 -0
- data/test/application_test.rb +28 -0
- data/test/environment_test.rb +11 -0
- data/test/fixtures/deploy.json +66 -0
- data/test/fixtures/deploy.yml +33 -0
- data/test/test_helper.rb +7 -0
- metadata +27 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66057ff70c6413bf464ae07fd56a42607e5db141
|
4
|
+
data.tar.gz: b9f77c6bae0ca2517d6696142625376257745481
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5801d37f9352ac4bbf96dd123f04d6d6ce06a34b89c50764c77eca9b34fee570ec8842c584c0f952270e60adacc05f88e118b18e18ce592c5544054a28ea1a9d
|
7
|
+
data.tar.gz: f3273ef63fa0c04e0f3ffe98bbeb8b6e05e2ed2f411f2038e516414cd557b065f3e8b37a8aeebee9012e435f560613bc51e49370dd0606a7ab06bad067456aad
|
data/Rakefile
CHANGED
@@ -13,13 +13,13 @@ module MarathonDeploy
|
|
13
13
|
def initialize(options={})
|
14
14
|
default_options = {
|
15
15
|
:force => false,
|
16
|
-
:deployfile => 'deploy.
|
17
|
-
}
|
16
|
+
:deployfile => 'deploy.yml'
|
17
|
+
}
|
18
18
|
options = default_options.merge!(options)
|
19
19
|
deployfile = options[:deployfile]
|
20
20
|
|
21
|
-
if (!File.exist?(
|
22
|
-
message = "\'#{deployfile}\' not found
|
21
|
+
if (!File.exist?(deployfile))
|
22
|
+
message = "\'#{File.expand_path(deployfile)}\' not found."
|
23
23
|
raise Error::IOError, message, caller
|
24
24
|
end
|
25
25
|
|
@@ -66,7 +66,11 @@ module MarathonDeploy
|
|
66
66
|
end
|
67
67
|
|
68
68
|
def to_s
|
69
|
-
return
|
69
|
+
return JSON.pretty_generate(@json)
|
70
|
+
end
|
71
|
+
|
72
|
+
def env
|
73
|
+
@json[:env]
|
70
74
|
end
|
71
75
|
|
72
76
|
def id
|
data/marathon_deploy.gemspec
CHANGED
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class ApplicationTest < Minitest::Test
|
4
|
+
def setup
|
5
|
+
$LOG = Logger.new(STDOUT)
|
6
|
+
$LOG.level = Logger::INFO
|
7
|
+
@release_version = "TEST_VERSION_#{Time.now.utc.iso8601}"
|
8
|
+
ENV['RELEASE_VERSION'] = @release_version
|
9
|
+
@json = File.expand_path('../fixtures/deploy.json',__FILE__)
|
10
|
+
@yml = File.expand_path('../fixtures/deploy.yml',__FILE__)
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_new_application_with_json
|
14
|
+
application = MarathonDeploy::Application.new(:deployfile => @json)
|
15
|
+
assert_instance_of(MarathonDeploy::Application,application)
|
16
|
+
refute_empty(application.id)
|
17
|
+
application.add_envs({ :MINITEST => "MINITEST_ENV_TEST" })
|
18
|
+
assert_equal("MINITEST_ENV_TEST",application.env[:MINITEST])
|
19
|
+
end
|
20
|
+
|
21
|
+
def test_new_application_with_yaml
|
22
|
+
application = MarathonDeploy::Application.new(:deployfile => @yml)
|
23
|
+
assert_instance_of(MarathonDeploy::Application,application)
|
24
|
+
refute_empty(application.id)
|
25
|
+
assert_equal(@release_version,application.env[:RELEASE_VERSION])
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
@@ -0,0 +1,66 @@
|
|
1
|
+
{
|
2
|
+
"args": [
|
3
|
+
"properties.py && FOO=\"`cat /opt/etc/public-search-germany-webapp.properties | grep -v '^\\s*#' | grep -E '.+=.+'`\"; echo $FOO; echo; env $FOO; echo; env $FOO hostName=$HOSTNAME backend.instance.name=$HOSTNAME java -Dhttp.port=8080 -Dajp.port=8009 -Dinstance.confdir=file:///opt/etc -Dbackend.logdir=$MESOS_SANDBOX -Dlog.rootDir=$MESOS_SANDBOX -DlogDir=$MESOS_SANDBOX $CMD_OPTS -Xmx$JAVA_XMX -Xms$JAVA_XMS -jar $MESOS_SANDBOX/public-search-germany-webapp*.jar"
|
4
|
+
],
|
5
|
+
"cmd": null,
|
6
|
+
"container": {
|
7
|
+
"docker": {
|
8
|
+
"image": "dockerregistry.mobile.rz/mobile-java8:latest",
|
9
|
+
"network": "BRIDGE",
|
10
|
+
"portMappings": [
|
11
|
+
{
|
12
|
+
"containerPort": 8080,
|
13
|
+
"hostPort": 0,
|
14
|
+
"protocol": "tcp"
|
15
|
+
},
|
16
|
+
{
|
17
|
+
"containerPort": 8009,
|
18
|
+
"hostPort": 0,
|
19
|
+
"protocol": "tcp"
|
20
|
+
}
|
21
|
+
]
|
22
|
+
},
|
23
|
+
"type": "DOCKER"
|
24
|
+
},
|
25
|
+
"cpus": 0.1,
|
26
|
+
"env": {
|
27
|
+
"APPLICATION_NAME": "public-search-germany-webapp",
|
28
|
+
"CMD_OPTS": "",
|
29
|
+
"CONFIG_ASSEMBLER_BASE_URL": "http://mobile-config-assembler.service.consul/config-assembler",
|
30
|
+
"DATACENTER_NUMBER": "44",
|
31
|
+
"JAVA_XMS": "252m",
|
32
|
+
"JAVA_XMX": "504m",
|
33
|
+
"SERVERCLASS_NAME": "pubse",
|
34
|
+
"SERVICE_8009_NAME": "public-search-germany-webapp",
|
35
|
+
"SERVICE_8009_TAGS": "ajp",
|
36
|
+
"SERVICE_8080_CHECK_SCRIPT": "curl --fail --silent $HOST_IP:$SERVICE_PORT/fz/release-info",
|
37
|
+
"SERVICE_8080_NAME": "public-search-germany-webapp",
|
38
|
+
"SERVICE_8080_TAGS": "http,haproxy"
|
39
|
+
},
|
40
|
+
"healthChecks": [
|
41
|
+
{
|
42
|
+
"gracePeriodSeconds": 30,
|
43
|
+
"intervalSeconds": 10,
|
44
|
+
"maxConsecutiveFailures": 3,
|
45
|
+
"portIndex": 0,
|
46
|
+
"protocol": "TCP",
|
47
|
+
"timeoutSeconds": 30
|
48
|
+
},
|
49
|
+
{
|
50
|
+
"gracePeriodSeconds": 30,
|
51
|
+
"intervalSeconds": 10,
|
52
|
+
"maxConsecutiveFailures": 3,
|
53
|
+
"path": "/fz/release-info",
|
54
|
+
"portIndex": 0,
|
55
|
+
"protocol": "HTTP",
|
56
|
+
"timeoutSeconds": 30
|
57
|
+
}
|
58
|
+
],
|
59
|
+
"id": "public-search-germany-webapp",
|
60
|
+
"instances": 4,
|
61
|
+
"mem": 512,
|
62
|
+
"storeUrls": [
|
63
|
+
"http://maven-download.mobile.rz/maven/hosted-mobile-deployment-productive-releases/de/mobile/public-search-germany-webapp/ecs-1558-gb70c745/public-search-germany-webapp-ecs-1558-gb70c745.jar"
|
64
|
+
],
|
65
|
+
"uris": []
|
66
|
+
}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
---
|
2
|
+
id: python-example-stable
|
3
|
+
cmd: echo python stable `hostname` > index.html; python3 -m http.server 8080
|
4
|
+
mem: 16
|
5
|
+
cpus: 0.1
|
6
|
+
instances: 5
|
7
|
+
container:
|
8
|
+
type: DOCKER
|
9
|
+
docker:
|
10
|
+
image: ubuntu:14.04
|
11
|
+
network: BRIDGE
|
12
|
+
portMappings:
|
13
|
+
- containerPort: 8080
|
14
|
+
hostPort: 0
|
15
|
+
protocol: tcp
|
16
|
+
env:
|
17
|
+
SERVICE_TAGS: python,webapp,http,weight=100
|
18
|
+
SERVICE_NAME: python
|
19
|
+
RELEASE_VERSION: %%RELEASE_VERSION%%
|
20
|
+
healthChecks:
|
21
|
+
- portIndex: 0
|
22
|
+
protocol: TCP
|
23
|
+
gracePeriodSeconds: 30
|
24
|
+
intervalSeconds: 10
|
25
|
+
timeoutSeconds: 30
|
26
|
+
maxConsecutiveFailures: 3
|
27
|
+
- path: "/"
|
28
|
+
portIndex: 0
|
29
|
+
protocol: HTTP
|
30
|
+
gracePeriodSeconds: 30
|
31
|
+
intervalSeconds: 10
|
32
|
+
timeoutSeconds: 30
|
33
|
+
maxConsecutiveFailures: 3
|
data/test/test_helper.rb
ADDED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: marathon_deploy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Colby
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: logger
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '10.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: minitest
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '5.7'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '5.7'
|
69
83
|
description: Pushes a yaml or json file to the Marathon API.
|
70
84
|
email:
|
71
85
|
- jcolby@team.mobile.de
|
@@ -109,6 +123,11 @@ files:
|
|
109
123
|
- lib/marathon_deploy/version.rb
|
110
124
|
- lib/marathon_deploy/yaml_json.rb
|
111
125
|
- marathon_deploy.gemspec
|
126
|
+
- test/application_test.rb
|
127
|
+
- test/environment_test.rb
|
128
|
+
- test/fixtures/deploy.json
|
129
|
+
- test/fixtures/deploy.yml
|
130
|
+
- test/test_helper.rb
|
112
131
|
homepage: https://github.com/joncolby/marathon_deploy
|
113
132
|
licenses:
|
114
133
|
- MIT
|
@@ -133,4 +152,9 @@ rubygems_version: 2.4.5
|
|
133
152
|
signing_key:
|
134
153
|
specification_version: 4
|
135
154
|
summary: Mesos/Marathon deployment tool.
|
136
|
-
test_files:
|
155
|
+
test_files:
|
156
|
+
- test/application_test.rb
|
157
|
+
- test/environment_test.rb
|
158
|
+
- test/fixtures/deploy.json
|
159
|
+
- test/fixtures/deploy.yml
|
160
|
+
- test/test_helper.rb
|