Skip to content

Commit

Permalink
Updated download URL. Added functions from clone.yml. Using unarchive…
Browse files Browse the repository at this point in the history
… instead of bash.
  • Loading branch information
eslerm committed Nov 9, 2018
1 parent 3853b8d commit b1f73d5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion defaults/main.yml
Expand Up @@ -22,7 +22,7 @@ galaxy_repo: "{{ galaxy_git_repo | default('https://github.com/galaxyproject/gal
galaxy_commit_id: "{{ galaxy_changeset_id | default('master') }}"

# Download URL (if used)
galaxy_download_url: "{{ galaxy_repo }}/get/{{ galaxy_commit_id }}.tar.gz"
galaxy_download_url: "{{ galaxy_repo | replace('.git', '') }}/archive/{{ galaxy_commit_id | replace('release_', 'v') }}.tar.gz"

# This will automatically be used by run.sh
galaxy_venv_dir: "{{ galaxy_server_dir }}/.venv"
Expand Down
22 changes: 20 additions & 2 deletions tasks/download.yml
@@ -1,11 +1,29 @@
---
# Manage Galaxy download

- name: Check for Galaxy download receipt
stat:
path: "{{ galaxy_server_dir }}/{{ galaxy_commit_id }}_receipt"
register: download_receipt

- name: Replace current version of Galaxy
shell: "rm -rf '{{ galaxy_server_dir }}' && mkdir '{{ galaxy_server_dir }}' && wget -q -O - {{ galaxy_download_url }} | tar xzf - --strip-components=1 -C {{ galaxy_server_dir }} && touch '{{ galaxy_server_dir }}/{{ galaxy_commit_id }}_receipt'"
- name: Install current version of Galaxy
unarchive:
src: "{{ galaxy_download_url }}"
dest: "{{ galaxy_server_dir }}"
extra_opts: --strip-components=1
remote_src: yes
when: not download_receipt.stat.exists

- name: Create Galaxy download receipt
file:
path: "{{ galaxy_server_dir }}/{{ galaxy_commit_id }}_receipt"
state: touch
when: not download_receipt.stat.exists

- name: Include virtualenv setup tasks
include_tasks: virtualenv.yml

- name: Remove orphaned .pyc files and compile bytecode
script: makepyc.py {{ galaxy_server_dir }}/lib
environment:
PATH: "{{ galaxy_venv_dir }}/bin"

0 comments on commit b1f73d5

Please sign in to comment.