docker_compose_deploy 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0d9dcaa86394d8c24329b214fb239286ff77c0ac
4
- data.tar.gz: d7643624e310fbd8305031e50187448a5688fd0b
3
+ metadata.gz: a774694b30eb0776bd8680e03ddb32587568420a
4
+ data.tar.gz: 2c59b4d8628a72430f1f87eb547fc3d30ba111e6
5
5
  SHA512:
6
- metadata.gz: 914b2cb664887b55b8331a0b8d472c7b671b19662d9cafe008b0b00fe9fa93a3f45d78d79a544f105d774d6189ccfe12d1f435a3a43cab875d2597aca484c998
7
- data.tar.gz: bb5c8425e50700e879e9b77d5176f744f3b822b79ddea3ab760280017e12be711a15db98e4cf3471f9b7fc08fb1e9d4704f98c326f9e0f2bb4b4916b010437aa
6
+ metadata.gz: dda2d468c2d77d01e5c8e9c8ebdff23327e58709cc84bcbafcc9b44d7b6f9577c549f46c529c903a08d6d5bb08c6e5048fcb1061f37624b2c896ac642e5d3af3
7
+ data.tar.gz: 36f940feea352bba112f9b2421f38d2f593731bd7bacde7f199d6aab6e2ded846e0a99ff4d4e4f1b28d9335afa1c4f032270ba27604b225fdbbc3375f4c0740e
data/README.md CHANGED
@@ -6,12 +6,27 @@ This gem is a collection of scripts that I use to deploy my personal websites us
6
6
  - Provision a server with Docker and Docker Compose
7
7
  - Test your deployment on a vagrant machine
8
8
  - Deploy your docker-compose project
9
- - Backup the data that your applications Generate
9
+ - Backup the data that your applications generate
10
10
 
11
11
  While these scripts are great for your personal projects, they will not help you with zero-downtime deploys, rotating your logs, or any of that other fancy stuff.
12
12
 
13
13
  This doesn't provide much over using docker-machine, but it will simplify working with volumes and allow you to test your deployment in a realistic environment.
14
14
 
15
+ ### Commands
16
+
17
+ Each command takes an optional `-e [environment]`. If the environment is not set, it will default to `test`. This environment corresponds to the entry in `config.yml`. There you can configure the connection string for sshing to the host. By default the `test` environment is set up to connect to the vagrant host configured in the Vagrantfile.
18
+
19
+ `dcd new [project_name]`: Scaffold a new project.
20
+
21
+ `dcd provision`: Install Docker & DockerCompose on the host machine.
22
+
23
+ `dcd deploy`: Push your `docker-compose.yml` to the host machine, create directories for volume-mapping (explained below), pull the required docker images, and run `docker-compose up`.
24
+
25
+ `dcd backup`: Tar, bzip, and download the `./sites/data` for safekeeping.
26
+
27
+ `dcd push [image_names]`: __If all of your images are on hub.docker.com, then you don't need this command.__ Normally you might push your docker images to http://hub.docker.com. However, you might have some images that you'd prefer to keep private. This command will take a local image, tar it, push it to the remote host. Using `dcd push` you do not need to push your private image to docker hub. This is significantly slower than using the registry because you need to push the entire image each time. Note that if you use this command, you will need to set `ignore_pull_failures: true` in your `config.yml`.
28
+
29
+
15
30
  ### The big picture
16
31
 
17
32
  For my homepage, I serve up multiple applications from the same machine. For this reason, I have nginx to inspect incoming requests and route them to the correct application. As I add new applications, I need to change this setup. So I need to push a new nginx config file as part of my deployment process.
@@ -87,12 +102,14 @@ Each site that is deployed with `dcd` will be provided three directories to moun
87
102
 
88
103
  - `./sites/[app_name]/config`: This directory is pushed from your localhost to the remote. Each time you run `dcd deploy` the config directory for each application will be __removed and replaced__ by the directory found on your localhost (if any). Notice that there is a file on your localhost at `./sites/proxy/config/nginx.conf`. This file will be copied to your host at deployment time.
89
104
 
90
- - `./sites/[app_name]/data`: This directory is the permanent storage for your application. When running `dcd backup`, each application's `data` directory will be zipped up and downloaded for safekeeping.
105
+ - `./sites/[app_name]/data`: This directory is the permanent storage for your application. This directory will be created by `dcd` but it will not be changed or removed by `dcd. When running `dcd backup`, each application's `data` directory will be zipped up and downloaded for safekeeping.
91
106
 
92
107
  - `./sites/[app_name]/log`: This directory is for storing logs. It is never removed, but it is also not included in backups. To see what's inside, you'll have to ssh to your server.
93
108
 
94
109
  Although none of the sites in the skeleton make use of their data directories, the volume maps are included to indicate what mounts are available. Understanding how nginx is configured is beyond the scope of this project, but the configuration found at `./sites/proxy/config/nginx.conf` should be a good template to follow.
95
110
 
111
+ Once you've deployed the initial skeleton to the vagrant host, ssh to it (`vagrant ssh`) and look around the `~/sites` folder to see all the folders its created.
112
+
96
113
  ---
97
114
 
98
115
  __config.yml__
@@ -146,6 +163,9 @@ vagrant ssh-config >> ssh_config_overrides
146
163
 
147
164
  This will update the ssh connection info to work with your vagrant machine.
148
165
 
166
+ ### Deploying to DigitalOcean
167
+
168
+ I use a cheap vps on http://wwww.digitalocean.com to host my site. Create a droplet and copy its ip address. Update `config.yml` with `root@[ip-address]` as the `production` connection string. Then run `dcd provision && dcd deploy`. Now configure your dns and you should be done!
149
169
 
150
170
  ### Issues/Questions
151
171
 
@@ -41,7 +41,7 @@ module DockerComposeDeploy
41
41
  Actions::Server.new(Util::Shell.new).provision
42
42
  end
43
43
 
44
- desc "new", "create a new docker-compose server skeleton"
44
+ desc "new PROJECT_NAME", "create a new docker-compose server skeleton"
45
45
  def new(name)
46
46
  Actions::Skeleton.new(name, Util::Shell.new).create
47
47
  end
@@ -1,3 +1,3 @@
1
1
  module DockerComposeDeploy
2
- VERSION = "1.1.0"
2
+ VERSION = "1.2.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docker_compose_deploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pete Kinnecom