diff --git a/infra/deployment/config/xsn-backend.env b/infra/deployment/config/explorer/xsn-explorer.env similarity index 100% rename from infra/deployment/config/xsn-backend.env rename to infra/deployment/config/explorer/xsn-explorer.env diff --git a/infra/deployment/config/sentry-xsn.properties b/infra/deployment/config/sentry-xsn.properties deleted file mode 100644 index 11fd084e..00000000 --- a/infra/deployment/config/sentry-xsn.properties +++ /dev/null @@ -1,2 +0,0 @@ -stacktrace.app.packages=com.xsn,com.alexitc -servername=xsn diff --git a/infra/deployment/systemd-services/xsn-backend.service b/infra/deployment/systemd-services/xsn-backend.service deleted file mode 100644 index ee4a9a9e..00000000 --- a/infra/deployment/systemd-services/xsn-backend.service +++ /dev/null @@ -1,16 +0,0 @@ -[Unit] -Description=XSN Backend Server - -[Service] -Type=simple -WorkingDirectory=/home/play/app/xsn-block-explorer-0.1.0-SNAPSHOT -StandardOutput=tty -StandardError=tty -EnvironmentFile=/home/play/app/.env -LimitNOFILE=65535 -User=play -ExecStart=/home/play/app/xsn-block-explorer-0.1.0-SNAPSHOT/bin/xsn-block-explorer -Dhttp.port=9000 -Dpidfile.path=/dev/null -Restart=on-failure - -[Install] -WantedBy=multi-user.target diff --git a/infra/deployment/xsn-backend.yml b/infra/deployment/xsn-backend.yml index 4c663d15..7bcefdf3 100644 --- a/infra/deployment/xsn-backend.yml +++ b/infra/deployment/xsn-backend.yml @@ -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'