Skip to content

Commit

Permalink
deployment - copy the code instead of GIT checkout
Browse files Browse the repository at this point in the history
- much better to just copy the necessary files to
  the target system instead of having so many
  unnecessary files located at the target system
- remove associated variables from the Ansible
  inventory
  • Loading branch information
Sebastian Mangelsen committed Dec 30, 2020
1 parent 5900ee5 commit c1cc0b4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
3 changes: 0 additions & 3 deletions deployment/inventory.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ all:
roon-br-livingroom:
roon-br-children:
vars:
github:
url: https://github.com/smangels/roon-ir-remote.git
branch: main
service:
name: roon-remote
user: roon-remote
Expand Down
28 changes: 16 additions & 12 deletions deployment/site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,29 @@
groups: "{{ service.groups }}"

- name: Remove Installation Folder
tags: sebman
file:
dest: "{{ installation.folder }}/"
state: absent

- name: Git checkout
git:
repo: "{{ github.url }}"
dest: "{{ installation.folder }}"
version: "{{ github.branch }}"
force: true

- name: Chown Installation Folder
- name: Cleanup the APP folder
delegate_to: localhost
tags: sebman
file:
dest: "{{ installation.folder }}"
state: directory
recurse: true
state: absent
path: "../app/__pycache__/"

- name: Transfer the code
tags: sebman
copy:
src: "{{ item.src }}"
dest: "{{ installation.folder }}/{{ item.dest }}"
owner: "{{ service.user }}"
group: "{{ service.group }}"
mode: '770'
mode: "750"
loop:
- { src: '../app/', dest: 'app/' }
- { src: '../roon_remote.py', dest: 'roon_remote.py' }

- name: Generate template
template:
Expand Down
2 changes: 1 addition & 1 deletion deployment/templates/app_info.json.j2
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"app_info": {
"extension_id": "python_roon_remote",
"display_name": "Roon IR Remote {{ roon.zone_name }}",
"display_version": "0.1.1",
"display_version": "0.2.0",
"publisher": "smangels",
"email": "[email protected]"
}
Expand Down

0 comments on commit c1cc0b4

Please sign in to comment.