-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.yml
29 lines (29 loc) · 1.23 KB
/
build.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
---
- name: Build PGXN API
hosts: main
tags: [build]
tasks:
- name: Include Variables
include_vars: file=vars.yml name=app
- name: Create Directories
file: path="{{ item.dir }}" state=directory mode={{ item.mode }}
loop:
- { dir: "{{ app.release_dir }}", mode: "u=rwx,g=rx,o=rx" }
- { dir: "{{ app.release_dir }}/logs", mode: "u=rwx,g=rwx,o=" }
- { dir: "{{ app.release_dir }}/pids", mode: "u=rwx,g=rwx,o=" }
- { dir: "{{ app.release_dir }}/api-root", mode: "u=rwx,g=rx,o=rx" }
- name: Build {{ app.name }}-{{ app.version }}
command:
chdir: "{{ app.release_dir }}"
# creates: "{{ app.name }}-{{ app.version }}"
cmd: cpanm --with-recommends --notest --local-lib-contained {{ app.name }}-{{ app.version }} {{ app.module }}@{{ app.version }} Cookie::Baker::XS WWW::Form::UrlEncoded::XS
- name: Link {{ app.name }}-{{ app.version }}
file:
state: link
src: "{{ app.release_dir }}/{{ item.src }}"
dest: "{{ app.release_dir }}/{{ app.name }}-{{ app.version }}/{{ item.dst }}"
force: yes
loop:
- { src: "logs", dst: logs }
- { src: "pids", dst: pids }
- { src: "api-root", dst: www }