2017-11-26 21:32:46 +00:00
|
|
|
---
|
|
|
|
# All tasks in this role should be done as the mastodon user
|
|
|
|
# This role clones the Mastodon GitHub repository and installs
|
|
|
|
# it's node.js and Ruby dependencies
|
|
|
|
|
2019-01-13 03:18:46 +00:00
|
|
|
- name: Clone Mastodon git repository [1st clone]
|
2017-11-26 21:32:46 +00:00
|
|
|
git:
|
|
|
|
repo: 'https://github.com/tootsuite/mastodon.git'
|
|
|
|
dest: /home/mastodon/live
|
2019-01-13 03:18:46 +00:00
|
|
|
become: true
|
|
|
|
become_user: mastodon
|
|
|
|
- name: Get latest version as an Ansible variable
|
|
|
|
shell: cd /home/mastodon/live && git tag -l | grep -v 'rc[0-9]*$' | sort -V | tail -n 1
|
|
|
|
become: true
|
|
|
|
become_user: mastodon
|
|
|
|
args:
|
|
|
|
executable: /bin/bash
|
|
|
|
register: MASTODON_VERSION
|
|
|
|
- name: Checkout latest Mastodon version
|
|
|
|
git:
|
|
|
|
repo: 'https://github.com/tootsuite/mastodon.git'
|
|
|
|
dest: /home/mastodon/live
|
|
|
|
version: {{ MASTODON_VERSION }}
|
2017-11-26 21:32:46 +00:00
|
|
|
become: true
|
|
|
|
become_user: mastodon
|
|
|
|
- name: Install bundler
|
2019-01-12 19:22:46 +00:00
|
|
|
shell: cd /home/mastodon/live && gem install bundler && gem install bundler -v 1.16.6
|
2017-11-26 21:32:46 +00:00
|
|
|
args:
|
|
|
|
executable: /bin/bash
|
2017-11-27 18:18:27 +00:00
|
|
|
environment:
|
|
|
|
PATH: '/home/mastodon/.rbenv/bin:/home/mastodon/.rbenv/shims:/home/mastodon/.rbenv/plugins/ruby-build/bin:{{ ansible_env.PATH }}'
|
2017-11-26 21:32:46 +00:00
|
|
|
become: true
|
|
|
|
become_user: mastodon
|
|
|
|
- name: Use bundler to install the rest of the Ruby dependencies
|
2019-01-12 19:17:17 +00:00
|
|
|
shell: cd /home/mastodon/live && bundle install
|
2017-11-26 21:32:46 +00:00
|
|
|
args:
|
|
|
|
executable: /bin/bash
|
2017-11-27 18:18:27 +00:00
|
|
|
environment:
|
|
|
|
PATH: '/home/mastodon/.rbenv/bin:/home/mastodon/.rbenv/shims:/home/mastodon/.rbenv/plugins/ruby-build/bin:{{ ansible_env.PATH }}'
|
2017-11-26 21:32:46 +00:00
|
|
|
become: true
|
|
|
|
become_user: mastodon
|
|
|
|
- name: Use yarn to install node.js dependencies
|
|
|
|
shell: cd /home/mastodon/live && yarn install --pure-lockfile
|
|
|
|
args:
|
|
|
|
executable: /bin/bash
|
|
|
|
become: true
|
|
|
|
become_user: mastodon
|