Began work on main production tasks
parent
349f882a89
commit
08c3158667
|
@ -1 +1,3 @@
|
|||
*.retry
|
||||
|
||||
.vscode/
|
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
# Variables for production server
|
||||
|
||||
project_path: "~/cce-search-prototype"
|
||||
user_name: "ubuntu"
|
||||
git_repo: "https://github.com/EbookFoundation/cce-search-prototype"
|
||||
git_branch: "master"
|
2
hosts
2
hosts
|
@ -0,0 +1,2 @@
|
|||
[production]
|
||||
cce-prod ansible_host=cce.ebookfoundation.org ansible_user=ubuntu
|
|
@ -0,0 +1,46 @@
|
|||
---
|
||||
- name: Install prod dependencies
|
||||
become: true
|
||||
apt:
|
||||
name: "{{ item }}"
|
||||
update_cache: true
|
||||
state: present
|
||||
with_items:
|
||||
- 'git'
|
||||
- 'pipenv'
|
||||
|
||||
- name: Create project directory
|
||||
become: true
|
||||
file:
|
||||
path: "{{ project_path }}"
|
||||
state: directory
|
||||
owner: "{{ user_name }}"
|
||||
mode: 0755
|
||||
|
||||
- name: Checkout repo
|
||||
git:
|
||||
accept_hostkey: yes
|
||||
force: yes
|
||||
repo: "{{ git_repo }}"
|
||||
dest: "{{ project_path }}"
|
||||
version: "{{ git_branch }}"
|
||||
|
||||
# Source: https://github.com/pypa/pipenv/issues/363#issuecomment-421310544
|
||||
- name: Check for venv
|
||||
ignore_errors: true
|
||||
command: "pipenv --venv"
|
||||
args:
|
||||
chdir: "{{ project_path }}"
|
||||
register: pipenv_venv_check_cmd
|
||||
changed_when:
|
||||
- ('No virtualenv' not in pipenv_venv_check_cmd.stderr)
|
||||
|
||||
- name: Run pipenv install
|
||||
command: "pipenv install"
|
||||
args:
|
||||
chdir: "{{ project_root }}"
|
||||
when:
|
||||
- ('No virtualenv' in pipenv_venv_check_cmd.stderr)
|
||||
|
||||
|
||||
# TODO: open ports on firewall
|
|
@ -0,0 +1 @@
|
|||
an
|
Loading…
Reference in New Issue