Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0
Ce dépôt a été archivé le 2022-05-07. Vous pouvez voir ses fichiers ou le cloner, mais pas ouvrir de ticket ou de demandes d'ajout, ni soumettre de changements.
nyaa-pantsu/deploy/ansible/roles/nyaapantsu/tasks/main.yml
tomleb 45da57fd0d Playbook to install latest nyaa straight from github (#843)
* Playbook to install latest nyaa straight from github

* Backup old nyaa dir before pulling latest
2017-05-30 21:48:20 -05:00

38 lignes
1,3 Kio
YAML

- name: Make directory
file:
state: directory
path: "{{ nyaapantsu_build_directory }}/src/github.com/NyaaPantsu"
- name: Register nyaa directory
stat:
path: "{{ nyaapantsu_build_directory }}/src/github.com/NyaaPantsu/nyaa"
register: nyaa_directory
- name: Register old nyaa directory
stat:
path: "{{ nyaapantsu_build_directory }}/src/github.com/NyaaPantsu/nyaa_old"
register: old_nyaa_directory
- name: Remove old nyaa directory
file:
path: "{{ nyaapantsu_build_directory }}/src/github.com/NyaaPantsu/nyaa_old"
state: absent
when: old_nyaa_directory.stat.exists == true
become: true # FIXME Need super user because public/dumps gives permission error
- name: Backup nyaa to old nyaa directory
command: mv -Tf "{{ nyaapantsu_build_directory }}/src/github.com/NyaaPantsu/nyaa/" "{{ nyaapantsu_build_directory }}/src/github.com/NyaaPantsu/nyaa_old/"
when: nyaa_directory.stat.exists == true
# TODO ability to get specify commit
- name: Get latest nyaa
git:
repo: 'https://github.com/NyaaPantsu/nyaa'
dest: "{{ nyaapantsu_build_directory }}/src/github.com/NyaaPantsu/nyaa"
- name: Go build
shell: go build
args:
chdir: "{{ nyaapantsu_build_directory }}/src/github.com/NyaaPantsu/nyaa"
environment:
GOPATH: "/home/{{ ansible_ssh_user }}/{{ nyaapantsu_build_directory }}"