Skip to content
Snippets Groups Projects
Commit 3dfe2b07 authored by nimrod's avatar nimrod
Browse files

Merge branch 'feature/virtualenv' into feature/tests

# Conflicts:
#	templates/receiver.sh
parents 6c6a6157 ba850340
No related branches found
No related tags found
No related merge requests found
...@@ -16,6 +16,10 @@ ...@@ -16,6 +16,10 @@
files: tests/playbook.yml files: tests/playbook.yml
args: args:
- tests/playbook.yml - tests/playbook.yml
- repo: https://github.com/adarnimrod/shell-pre-commit
sha: v0.1.0
hooks:
- id: shell-lint
- repo: https://github.com/willthames/ansible-lint - repo: https://github.com/willthames/ansible-lint
sha: 959ab0f525e9abb19cf75f34381015cf33695f61 sha: 959ab0f525e9abb19cf75f34381015cf33695f61
hooks: hooks:
......
...@@ -11,18 +11,29 @@ ...@@ -11,18 +11,29 @@
- name: APT install prerequisites - name: APT install prerequisites
when: ansible_pkg_mgr == 'apt' when: ansible_pkg_mgr == 'apt'
apt: apt:
name: python-dev name: [python-dev, libssl-dev, libffi-dev, build-essential]
state: present state: present
update_cache: yes update_cache: yes
cache_valid_time: 3600 cache_valid_time: 3600
- name: Create virtualenv directory
file:
path: /var/lib/pelican-gitreceive
owner: git
group: git
mode: 0o0700
state: directory
- name: pip install - name: pip install
become: True
become_user: git
with_items: with_items:
- pelican - pelican
- fabric - Fabric
pip: pip:
name: '{{ item }}' name: '{{ item }}'
state: present state: present
virtualenv: /var/lib/pelican-gitreceive
- name: Create directory structure - name: Create directory structure
file: file:
......
...@@ -31,6 +31,8 @@ then ...@@ -31,6 +31,8 @@ then
echo '----> Fetching submodules ...' echo '----> Fetching submodules ...'
fetch_submodules fetch_submodules
fi fi
echo '----> Activating virtualenv ...'
. /var/lib/pelican-gitreceive/bin/activate
echo '----> Building blog ...' echo '----> Building blog ...'
fab build fab build
echo '----> Copying blog ...' echo '----> Copying blog ...'
......
...@@ -9,6 +9,7 @@ def test_git_push(Command, Sudo): ...@@ -9,6 +9,7 @@ def test_git_push(Command, Sudo):
push = Command('git -C /root/blog push test') push = Command('git -C /root/blog push test')
assert push.rc == 0 assert push.rc == 0
for message in ['----> Unpacking ...', '----> Fetching submodules ...', for message in ['----> Unpacking ...', '----> Fetching submodules ...',
'----> Activating virtualenv ...',
'----> Building blog ...', 'Copying blog ...', '----> Building blog ...', 'Copying blog ...',
'----> Cleanup ...', '----> OK.']: '----> Cleanup ...', '----> OK.']:
assert message in push.stderr assert message in push.stderr
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment