Skip to content

Commit

Permalink
Merge branch 'release/1.1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
mblaschke committed Dec 15, 2016
2 parents 9904b03 + a3b23dc commit f3c5316
Show file tree
Hide file tree
Showing 11 changed files with 96 additions and 4 deletions.
3 changes: 2 additions & 1 deletion docker/samson-deployment/latest/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,12 @@ ADD crontab /etc/cron.d/webdevops-samson-deployment

RUN rake assets:precompile \
&& /opt/docker/bin/control.sh service.enable cron \
&& /opt/docker/bin/provision run --tag bootstrap --role webdevops-samson-deployment \
&& /opt/docker/bin/provision run --tag bootstrap --role webdevops-base --role webdevops-base-app --role webdevops-samson-deployment \
&& /opt/docker/bin/bootstrap.sh


EXPOSE 80
VOLUME /storage

ENTRYPOINT ["/opt/docker/bin/entrypoint.sh"]
CMD ["supervisord"]
1 change: 1 addition & 0 deletions docker/samson-deployment/latest/Dockerfile.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
{{ samsonDeployment.general() }}

{{ docker.expose('80') }}
{{ docker.volume('/storage') }}

{{ docker.entrypoint("/opt/docker/bin/entrypoint.sh") }}
{{ docker.cmd("supervisord") }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Prevent startup of nginx (ubuntu 16.04 needs it)
ln -f -s /var/lib/nginx/logs /var/log/nginx

# Replace markers
find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "<ALIAS_DOMAIN>" "$WEB_ALIAS_DOMAIN"
find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "<SERVERNAME>" "$HOSTNAME"
7 changes: 7 additions & 0 deletions docker/samson-deployment/latest/conf/bin/service.d/nginx.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

source /opt/docker/bin/config.sh

includeScriptDir "/opt/docker/bin/service.d/nginx.d/"

exec /usr/sbin/nginx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ programs=nginxd
priority=20

[program:nginxd]
command = /usr/sbin/nginx
command = /opt/docker/bin/service.d/nginx.sh
process_name=%(program_name)s
startsecs = 0
autostart = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,35 @@
group: "{{ APPLICATION_GROUP }}"
mode: u=rwX,g=rX,o=rX
recurse: yes

- name: Remove old log directory
file:
path: "/var/lib/nginx/logs"
state: absent

- name: Create log directory
file:
path: "/var/lib/nginx/logs"
state: directory

- name: Create stdout symlinks
file:
dest: "{{ item }}"
src: "/docker.stdout"
state: link
force: yes
with_items:
- "/var/lib/nginx/logs/access.log"
- "/var/lib/nginx/logs/error.log"

- name: Create storage directories
file:
path: "{{ item }}"
state: directory
owner: "{{ APPLICATION_USER }}"
group: "{{ APPLICATION_GROUP }}"
mode: u=rwX,g=rX,o=rX
recurse: yes
with_items:
- "/storage"
- "/storage/db"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Prevent startup of nginx (ubuntu 16.04 needs it)
ln -f -s /var/lib/nginx/logs /var/log/nginx

# Replace markers
find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "<ALIAS_DOMAIN>" "$WEB_ALIAS_DOMAIN"
find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "<SERVERNAME>" "$HOSTNAME"
7 changes: 7 additions & 0 deletions provisioning/samson-deployment/general/bin/service.d/nginx.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

source /opt/docker/bin/config.sh

includeScriptDir "/opt/docker/bin/service.d/nginx.d/"

exec /usr/sbin/nginx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ programs=nginxd
priority=20

[program:nginxd]
command = /usr/sbin/nginx
command = /opt/docker/bin/service.d/nginx.sh
process_name=%(program_name)s
startsecs = 0
autostart = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,35 @@
group: "{{ APPLICATION_GROUP }}"
mode: u=rwX,g=rX,o=rX
recurse: yes

- name: Remove old log directory
file:
path: "/var/lib/nginx/logs"
state: absent

- name: Create log directory
file:
path: "/var/lib/nginx/logs"
state: directory

- name: Create stdout symlinks
file:
dest: "{{ item }}"
src: "/docker.stdout"
state: link
force: yes
with_items:
- "/var/lib/nginx/logs/access.log"
- "/var/lib/nginx/logs/error.log"

- name: Create storage directories
file:
path: "{{ item }}"
state: directory
owner: "{{ APPLICATION_USER }}"
group: "{{ APPLICATION_GROUP }}"
mode: u=rwX,g=rX,o=rX
recurse: yes
with_items:
- "/storage"
- "/storage/db"
2 changes: 1 addition & 1 deletion template/Dockerfile/images/samson-deployment.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ ADD crontab /etc/cron.d/webdevops-samson-deployment

RUN rake assets:precompile \
&& /opt/docker/bin/control.sh service.enable cron \
{{ provision.runRoleInline('samson-deployment ', role) }}
{{ provision.runRoleInline('base', 'base-app', 'samson-deployment', role) }}


{%- endmacro %}

0 comments on commit f3c5316

Please sign in to comment.