-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ce562ed
commit 6c9d67e
Showing
7 changed files
with
72 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,30 @@ | ||
# user | ||
system_user: "react" | ||
system_group: "www-data" | ||
system_user_home: "/home/{{ system_user }}" | ||
react_system_user: "react" | ||
react_system_group: "www-data" | ||
react_system_user_home: "/home/{{ react_system_user }}" | ||
|
||
# git | ||
git_url: | ||
git_version: "master" | ||
git_key: | ||
git_key_filename: "id_ed25519" | ||
remove_git_key: True | ||
react_git_url: | ||
react_git_version: "master" | ||
react_git_key: | ||
react_git_key_filename: "id_ed25519" | ||
react_remove_git_key: True | ||
|
||
# system-wide dependencies | ||
system_wide_dependencies: | ||
react_system_wide_dependencies: | ||
- git | ||
- nodejs | ||
- yarn | ||
node_version: 10.x | ||
react_node_version: 10.x | ||
|
||
# app | ||
env_name: "prod" | ||
app_name: "{{ system_user }}" | ||
codebase_path: "{{ system_user_home }}/app" | ||
versioned_path: "{{ codebase_path }}-versioned" | ||
checkout_path: "{{ versioned_path }}/{{ ansible_date_time['epoch'] }}" | ||
log_path: "/var/log/{{ app_name }}" | ||
react_env_name: "prod" | ||
react_app_name: "{{ react_system_user }}" | ||
react_codebase_path: "{{ react_system_user_home }}/app" | ||
react_versioned_path: "{{ react_codebase_path }}-versioned" | ||
react_checkout_path: "{{ react_versioned_path }}/{{ ansible_date_time['epoch'] }}" | ||
react_log_path: "/var/log/{{ react_app_name }}" | ||
|
||
# app settings | ||
app_settings: | ||
react_app_settings: | ||
REACT_APP_WEBSITE_NAME: 'React Example App' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
--- | ||
- name: Get previous app deploy listing | ||
shell: ls -tr1 chdir={{ versioned_path }} | ||
shell: ls -tr1 chdir={{ react_versioned_path }} | ||
register: versioned_list | ||
|
||
- name: Remove extra files from app directroy | ||
file: | ||
path: "{{ versioned_path }}/{{ versioned_list.stdout_lines[item|int] }}" | ||
path: "{{ react_versioned_path }}/{{ versioned_list.stdout_lines[item|int] }}" | ||
state: absent | ||
with_sequence: start=0 end={{ versioned_list.stdout_lines|length - 10 }} | ||
ignore_errors: yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{% for k,v in app_settings.items() %} | ||
{% for k,v in react_app_settings.items() %} | ||
{{k}}={{v}} | ||
{% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters