Skip to content

Commit

Permalink
Add steps for easier provisioning and deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
mrchrisadams committed Nov 4, 2024
1 parent d54ec9c commit 57cf5c1
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 6 deletions.
10 changes: 5 additions & 5 deletions ansible/_add_system_dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@
when: install_node is true
tags: [fnm-install]

- name:
ansible.builtin.debug:
var: fnm_installed
when: install_node is true
tags: [fnm-install]
# - name:
# ansible.builtin.debug:
# var: fnm_installed
# when: install_node is true
# tags: [fnm-install]

- name: Download FNM install (Fast Node Manager) script
ansible.builtin.get_url:
Expand Down
2 changes: 1 addition & 1 deletion ansible/_create_deployment_directories.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
group: deploy
become: true

- name: Move .aws.credentials file to the deploy directory for using with aws cli
- name: Move .aws.credentials file to shared directory
ansible.builtin.template:
src: "templates/dotaws.credentials.j2"
dest: "{{ project_root }}/shared/.aws.credentials"
Expand Down
45 changes: 45 additions & 0 deletions ansible/provision_app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,56 @@
# is a workaround
update_front_end_deps: true

project_git_repo: "[email protected]:thegreenwebfoundation/admin-portal.git"
project_deploy_strategy: git
project_version: "{{ project_deploy_branch }}"
project_local_path: "../"
project_unwanted_items:
- .git
project_finalize: true

# set these to decide about setting up a folder structure as if we are deploying
deploy_project: true
update_symlinks: true

tasks:
- name: Set up most recent timestamps directories
ansible.builtin.include_tasks: "_create_deployment_directories.yml"
when: create_deployment_dirs is true

- name: Run the deploy steps to check out the project repo
ansible.builtin.include_role:
name: f500.project_deploy
when: deploy_project is defined and deploy_project is true

- name: Link .env to shared directory
ansible.builtin.file:
src: "{{ project_root }}/shared/.env"
dest: "{{ project_root }}/current/.env"
state: link
when: update_symlinks is true

- name: Link ./media to shared ./media directory
ansible.builtin.file:
src: "{{ project_root }}/shared/media"
dest: "{{ project_root }}/current/media"
state: link
when: update_symlinks is true

- name: Link ./data to shared ./data directory
ansible.builtin.file:
src: "{{ project_root }}/shared/data"
dest: "{{ project_root }}/current/data"
state: link
when: update_symlinks is true

- name: Link to .aws.credentials in shared directory
ansible.builtin.file:
src: "{{ project_root }}/shared/.aws.credentials"
dest: "{{ project_root }}/current/.aws.credentials"
state: link
when: update_symlinks is true

- name: Install all system dependencies
ansible.builtin.include_tasks: "_add_system_dependencies.yml"
when: install_system_reqs is true
Expand Down

0 comments on commit 57cf5c1

Please sign in to comment.