Skip to content

Commit

Permalink
infra: The xsn script uses the explorer role
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexITC committed May 12, 2019
1 parent f3dc0fc commit 61b64a0
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 113 deletions.
File renamed without changes.
2 changes: 0 additions & 2 deletions infra/deployment/config/sentry-xsn.properties

This file was deleted.

16 changes: 0 additions & 16 deletions infra/deployment/systemd-services/xsn-backend.service

This file was deleted.

99 changes: 4 additions & 95 deletions infra/deployment/xsn-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,99 +3,8 @@
gather_facts: no
roles:
- ubuntu-16-04
- explorer

tasks:
- name: Install java8
become: yes
apt:
name: default-jre
state: latest

- name: Build the application
shell: ./scripts/build-server.sh
delegate_to: 127.0.0.1

- name: Upload the application
synchronize:
src: app.zip
dest: app.zip

- name: Create the play group
become: yes
group:
name: play
state: present

- name: Create the play user
become: yes
user:
name: play
group: play
state: present
system: yes

- name: Create the app directory
become: yes
file:
path: /home/play/app
state: directory
owner: play
group: play

- name: Unpack the application
become: yes
unarchive:
remote_src: yes
src: app.zip
dest: /home/play/app
owner: play
group: play

- name: Set the application config
become: yes
copy:
src: config/xsn-backend.env
dest: /home/play/app/.env
owner: play
group: play

- name: Set the sentry config
become: yes
copy:
src: config/sentry-xsn.properties
dest: /home/play/app/xsn-block-explorer-0.1.0-SNAPSHOT/conf/sentry.properties
owner: play
group: play

- name: Set the application files permissions
become: yes
file:
dest: /home/play/app
owner: play
group: play
recurse: yes

- name: Add the systemd service
become: yes
copy:
src: systemd-services/xsn-backend.service
dest: /etc/systemd/system/
owner: root
group: root

- name: Pick up systemd changes
become: yes
systemd:
daemon_reload: yes

- name: Restart the application
become: yes
systemd:
name: xsn-backend
state: restarted

- name: Enable the application to run on system startup
become: yes
systemd:
name: xsn-backend
enabled: yes
vars:
explorer_config_file: 'config/explorer/xsn-explorer.env'
explorer_service_name: 'xsn-backend'

0 comments on commit 61b64a0

Please sign in to comment.