-
Notifications
You must be signed in to change notification settings - Fork 5
/
prepare.yml
64 lines (54 loc) · 1.95 KB
/
prepare.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
---
- name: Oration Staging Build
hosts: all
tasks:
# This step requries some manual intervention. Initially I was using the ekidd docker image, calling
# `docker pull ekidd/rust-musl-builder:nightly`, but this no longer allows me to properly update the
# nigtly version through `rustup update && cargo build`. Therefore, you need to pull the image from
# github and build it yourself with the current nightly. Throw your image id at the end of the alias
# and make sure your nightly is up to date before staging.
- name: Backend | Build production executable
shell: |
alias rust-musl-builder='docker run --rm -t -v {{playbook_dir}}/..:/home/rust/src c93608479ed8'
rust-musl-builder cargo build --release
- name: Backend | Check for deployment directory
file:
path: deploy
state: directory
- name: Backend | Ready configuration file
copy:
src: ../oration.yaml
dest: deploy/oration.yaml
- name: Backend | Setting localhost as blog entrypoint
replace:
path: deploy/oration.yaml
regexp: '^(host:\s+).*'
replace: '\1http://localhost/'
- name: Backend | Ready executable file
copy:
src: ../target/x86_64-unknown-linux-musl/release/oration
dest: deploy/oration
mode: u+rwx,g-wx,o-rwx
- name: Database | Environment file
copy:
src: ../.env
dest: deploy/.env
- name: Database | Ready database
copy:
src: ../oration.db
dest: deploy/oration.db
- name: Frontend | Build Elm app
command: npm run deploy
args:
chdir: ../app
- name: Frontend | Finding map files in public area
find:
paths: ../public
patterns: "*.map"
recurse: yes
register: map_files
- name: Frontend | Removing map files from public area
file:
path: "{{ item.path }}"
state: absent
with_items: "{{ map_files.files }}"