Skip to content

Commit

Permalink
Merge pull request #101 from ansistrano/download_strategy
Browse files Browse the repository at this point in the history
download strategy
  • Loading branch information
ricardclau committed Mar 22, 2016
2 parents 1959ca6 + eb00d18 commit 93257d0
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 3 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ Role Variables
ansistrano_git_branch: master # What version of the repository to check out. This can be the full 40-character SHA-1 hash, the literal string HEAD, a branch name, or a tag name
ansistrano_git_identity_key_path: "" # If specified this file is copied over and used as the identity key for the git commands, path is relative to the playbook in which it is used

# Variables used in the download deployment strategy
ansistrano_get_url: https://github.com/someproject/somearchive.tar.gz

# Variables used in the S3 deployment strategy
ansistrano_s3_bucket: s3bucket
ansistrano_s3_object: s3object.tgz
Expand Down
3 changes: 3 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ ansistrano_rsync_extra_params: ""
## you should set this parameter to "no".
ansistrano_rsync_set_remote_user: yes

## Download strategy
ansistrano_get_url: https://github.com/someproject/somearchive.tar.gz

## S3 get strategy
ansistrano_s3_bucket: s3bucket
ansistrano_s3_object: s3object.tgz
Expand Down
2 changes: 1 addition & 1 deletion tasks/update-code/copy_unarchive.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
- include: copy.yml

- name: ANSISTRANO | copy_unarchive Set archived file
- name: ANSISTRANO | copy_unarchive | Set archived file
set_fact: ansistrano_archived_file={{ ansistrano_release_path.stdout }}/{{ ansistrano_deploy_from | basename }}

- include: unarchive.yml
6 changes: 6 additions & 0 deletions tasks/update-code/download.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
- name: ANSISTRANO | download | Create release folder
file: state=directory path={{ ansistrano_release_path.stdout }}

- name: ANSISTRANO | download | Download artifact
get_url: url={{ ansistrano_get_url }} dest={{ ansistrano_release_path.stdout }}
7 changes: 7 additions & 0 deletions tasks/update-code/download_unarchive.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
- include: download.yml

- name: ANSISTRANO | download_unarchive | Set archived file
set_fact: ansistrano_archived_file={{ ansistrano_release_path.stdout }}/{{ ansistrano_get_url | basename }}

- include: unarchive.yml
4 changes: 2 additions & 2 deletions tasks/update-code/s3_unarchive.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
- include: s3.yml

- name: ANSISTRANO | s3_unarchive Set archived file
- name: ANSISTRANO | s3_unarchive | Set archived file
set_fact: ansistrano_archived_file={{ ansistrano_release_path.stdout }}/{{ ansistrano_s3_object }}

- include: unarchive.yml
- include: unarchive.yml

0 comments on commit 93257d0

Please sign in to comment.