-
Notifications
You must be signed in to change notification settings - Fork 40
/
laravel-deploy.yml
57 lines (49 loc) · 1.94 KB
/
laravel-deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
---
- hosts: all
become: true
tasks:
- name: Make sure the remote app root exists and has the right permissions
file:
path: "{{ remote_www_root }}/{{ app_root_dir }}"
state: directory
mode: '0755'
owner: "{{ remote_user }}"
group: "{{ remote_user }}"
- name: Rsync application files to the remote server
synchronize:
src: "application/{{ app_root_dir }}"
dest: "{{ remote_www_root }}"
rsync_opts:
- "--no-motd"
- "--exclude=.git,vendor,tests,storage/logs/*,storage/framework/sessions/*,storage/framework/cache/*"
- name: Set up additional directory permissions for www-data user on storage folder
acl:
path: "{{ remote_www_root }}/{{ app_root_dir }}/storage/"
entry: group:www-data:rwX
recursive: yes
state: present
- name: Set up additional directory permissions for www-data user on bootstrap/cache folder
acl:
path: "{{ remote_www_root }}/{{ app_root_dir }}/bootstrap/cache/"
entry: group:www-data:rwX
recursive: yes
state: present
- name: Set up .env file
template:
src: laravel-env.j2
dest: "{{ remote_www_root }}/{{ app_root_dir }}/.env"
- name: Install Dependencies with Composer
become: false
composer:
command: install
working_dir: "{{ remote_www_root }}/{{ app_root_dir }}"
tags: [ 'composer:install' ]
- name: Generate app key
command: "/usr/bin/php {{ remote_www_root }}/{{ app_root_dir }}/artisan key:generate"
tags: [ 'laravel', 'artisan:key' ]
- name: Set up app storage link
command: "/usr/bin/php {{ remote_www_root }}/{{ app_root_dir }}/artisan storage:link"
tags: [ 'laravel', 'artisan:storage' ]
- name: Run Migrations + Seeders
command: "/usr/bin/php {{ remote_www_root }}/{{ app_root_dir }}/artisan migrate --seed"
tags: [ 'laravel', 'artisan:migrate' ]