Skip to content

Instantly share code, notes, and snippets.

View intinig's full-sized avatar

Giovanni Intini intinig

View GitHub Profile
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
#config.vm.define "#{ENV['VAGRANT_DEFAULT_PROVIDER']}_boot2docker"
config.vm.box = "yungsang/boot2docker"
config.vm.network "private_network", ip: ENV['BOOT2DOCKER_IP'] || "10.211.55.5"
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
#config.vm.define "#{ENV['VAGRANT_DEFAULT_PROVIDER']}_boot2docker"
config.vm.box = "yungsang/boot2docker"
config.vm.network "private_network", ip: ENV['BOOT2DOCKER_IP'] || "10.211.55.5"
upstream rgts {
server app:9292;
}
server {
listen 80;
server_name $nginx_rgts_host *.$nginx_rgts_host;
root /app/public;
try_files $uri/index.html $uri @rgts;
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
env NGINX_RGTS_HOST;
events {
worker_connections 1024;
}
node[:deploy].each do |application, deploy|
if deploy[:application_type] != 'other'
Chef::Log.debug("Skipping deploy::docker application #{application} as it is not deployed to this layer")
next
elsif deploy["environment_variables"]["APP_TYPE"] != 'docker'
Chef::Log.debug("Skipping deploy::docker application #{application} as it is not of type 'docker'")
next
end
node[:deploy].each do |application, deploy|
if deploy[:application_type] != 'other'
Chef::Log.debug("Skipping deploy::docker application #{application} as it is not deployed to this layer")
next
elsif environment.delete(:APP_TYPE) != 'docker'
Chef::Log.debug("Skipping deploy::docker application #{application} as it is not of type 'docker'")
next
end
node[:deploy].each do |application, deploy|
# node[:deploy]['appshortname'][:environment_variables][:variable_name]
environment = deploy[:environment_variables].dup
if deploy[:application_type] != 'other'
Chef::Log.debug("Skipping deploy::docker application #{application} as it is not deployed to this layer")
next
elsif environment.delete(:APP_TYPE) != 'docker'
node[:deploy].each do |application, deploy|
# node[:deploy]['appshortname'][:environment_variables][:variable_name]
environment = deploy[:environment_variables].dup
if deploy[:application_type] != 'other'
Chef::Log.debug("Skipping deploy::docker application #{application} as it is not deployed to this layer")
next
elsif environment.delete(:APP_TYPE) != 'docker'
node[:deploy].each do |application, deploy|
# node[:deploy]['appshortname'][:environment_variables][:variable_name]
environment = deploy[:environment_variables].dup
if deploy[:application_type] != 'other'
Chef::Log.debug("Skipping deploy::docker application #{application} as it is not deployed to this layer")
next
elsif environment.delete(:APP_TYPE) != 'docker'
1 (M=56a43) [ruby-2.1.5] ~/src/opsworks-docker> docker inspect -f {{.State.Running}} d182180f3482
false
(M=56a43) [ruby-2.1.5] ~/src/opsworks-docker> echo $?
0
(M=56a43) [ruby-2.1.5] ~/src/opsworks-docker> docker inspect -f {{.State.Running}} non_existing
Error: No such image or container: non_existing
1 (M=56a43) [ruby-2.1.5] ~/src/opsworks-docker> echo $?
1
(M=56a43) [ruby-2.1.5] ~/src/opsworks-docker>