Files
wrestlingdev-ansible/roles/web/tasks/main.yml
2016-01-14 08:46:55 -05:00

52 lines
2.1 KiB
YAML

---
# These tasks are responsible for copying the latest dev/production code from
# # the version control system.
#
- name: Copy the code from repository
git: repo={{ repository }} dest=/var/www/html/
- name: Create prod.env
shell: touch /var/www/html/prod.env
- name: Declare env file
shell: echo export WRESTLINGDEV_ENV_FILE=/var/www/html/prod.env
- name: Set env file permanently
shell: echo export WRESTLINGDEV_ENV_FILE=/var/www/html/prod.env >> /etc/environment
- name: Set DB Name
shell: echo export WRESTLINGDEV_DB_NAME={{ lookup('env', 'WRESTLINGDEV_DB_NAME') }} >> /var/www/html/prod.env
- name: Set db password
shell: echo export WRESTLINGDEV_DB_PWD={{ lookup('env', 'WRESTLINGDEV_DB_PWD') }} >> /var/www/html/prod.env
- name: Set db host
shell: echo export WRESTLINGDEV_DB_HOST={{ lookup('env', 'WRESTLINGDEV_DB_HOST') }} >> /var/www/html/prod.env
- name: Set db port
shell: echo export WRESTLINGDEV_DB_PORT={{ lookup('env', 'WRESTLINGDEV_DB_PORT') }} >> /var/www/html/prod.env
- name: Set devise secret key
shell: echo export WRESTLINGDEV_DEVISE_SECRET_KEY={{ lookup('env', 'WRESTLINGDEV_DEVISE_SECRET_KEY') }} >> /var/www/html/prod.env
- name: Set secret key base
shell: echo export WRESTLINGDEV_SECRET_KEY_BASE={{ lookup('env', 'WRESTLINGDEV_SECRET_KEY_BASE') }} >> /var/www/html/prod.env
- name: Set new relic license
shell: echo export WRESTLINGDEV_NEW_RELIC_LICENSE_KEY={{ lookup('env', 'WRESTLINGDEV_NEW_RELIC_LICENSE_KEY') }} >> /var/www/html/prod.env
- name: Set memcached username
shell: echo export MEMCACHIER_USERNAME={{ lookup('env', 'MEMCACHIER_USERNAME') }} >> /var/www/html/prod.env
- name: Set memcached password
shell: echo export MEMCACHIER_PASSWORD={{ lookup('env', 'MEMCACHIER_PASSWORD') }} >> /var/www/html/prod.env
- name: Set memcached servers
shell: echo export MEMCACHIER_SERVERS={{ lookup('env', 'MEMCACHIER_SERVERS') }} >> /var/www/html/prod.env
- name: Create and start apache docker image
shell: cd /var/www/html/ && bash rails-prod.sh wrestlingdev-web
- name: Create and run delayed job worker
shell: cd /var/www/html/ && bash rails-worker-prod.sh wrestlingdev-worker