shippy 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 88e53546e6bcac389ac600b0432bed0809b162857622e3bc560dbc98ea87da94
4
- data.tar.gz: bc1e127d902f21cf04d3282d3f04c10db1aff3ea6113df213e2af0ceea8e69f4
3
+ metadata.gz: e28ff568f47b1c6ab79cd83a7f136a07187f9966d71fc134200396f9a7f235c4
4
+ data.tar.gz: c3d4d946f98cfc6c993e00ff3e5bc685261a34e05bad9b1e9e7c776a5fe26bf2
5
5
  SHA512:
6
- metadata.gz: 430ed1debda3020d516dd4d5902b6b176a747cb53d9775eed6e49ecf070fe5cd028b3ed343641d60c3e38959e918d9d8730d3bb9a6aba43a7650393aa24b55b1
7
- data.tar.gz: 2596088fa15a92310a8fd4e5db8909267892b1c04b4cbaacbeffe37fceaf8ba1905c57580ac9d8cf277e94b64629cb88e97620aef6f7db9de6c81db4e5d3cbb4
6
+ metadata.gz: c964e8762f426cae3ed46adb35c117dc327a15f9a378a39015ebe30b17bc045418a6bbbe786988f48884cb96e71863436693fd53267ca6fb9662efd272b045af
7
+ data.tar.gz: e87db690c30bb9939114fd95a06f315c0356f79efceff5353baaf99ea9cadabfe54d0e89465f7f5e5c0d8c7cc43cd3d39e024123a8803b8581a310542fc7d4c1
data/README.md CHANGED
@@ -40,6 +40,48 @@ This will generate the config files and the `apps` directory with Traefik in the
40
40
 
41
41
  Now `shippy` can be called using `bin/shippy` binstub and the other commands can be listed using `bin/shippy -h`.
42
42
 
43
+ ### Docker compose DSL:
44
+
45
+ Conventions:
46
+
47
+ - the file needs to be located at `apps/app_name/docker-compose.rb`
48
+ - the `Shippy.define {}` block describes multiple services for the same compose file
49
+ - `service :name` describes a docker service
50
+ - most of the docker-compose keywords are implemented as [methods](./lib/shippy/service.rb) that accept a block.
51
+ - `volumes` and `networks` are automatically defined
52
+
53
+ Example:
54
+
55
+ ```ruby
56
+ Shippy.define do
57
+ service :proxy do
58
+ image { "traefik:v2.9" }
59
+ command { "--configFile=/config/config.yml" }
60
+
61
+ environment do
62
+ {
63
+ CF_API_EMAIL: secrets(:cloudflare_email),
64
+ CF_DNS_API_TOKEN: secrets(:cloudflare_token)
65
+ }
66
+ end
67
+
68
+ ports do
69
+ ["80:80", "443:443", "8080:8080"]
70
+ end
71
+
72
+ volumes do
73
+ [
74
+ "/var/run/docker.sock:/var/run/docker.sock",
75
+ "./traefik:/config",
76
+ "acme:/etc/traefik/acme"
77
+ ]
78
+ end
79
+
80
+ use_default_options
81
+ end
82
+ end
83
+ ```
84
+
43
85
  ## Development
44
86
 
45
87
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -2,7 +2,7 @@ module Shippy
2
2
  class Service
3
3
  ATTRIBUTES = %i[
4
4
  build command depends_on devices entrypoint environment hostname image
5
- labels logging networks ports restart volumes volumes_from working_dir
5
+ labels logging networks user ports restart volumes volumes_from working_dir
6
6
  security_opt
7
7
  ].freeze
8
8
 
@@ -1,3 +1,3 @@
1
1
  module Shippy
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shippy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marius Bobin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-01 00:00:00.000000000 Z
11
+ date: 2023-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport