2020-11-07 10:49:53 +00:00
|
|
|
---
|
|
|
|
- name: '{{ item.name }} - Create builds folder'
|
|
|
|
file:
|
|
|
|
path: '{{ beacon_node_builds_path }}'
|
|
|
|
owner: '{{ beacon_node_builds_user }}'
|
|
|
|
group: 'adm'
|
|
|
|
mode: 0755
|
|
|
|
state: 'directory'
|
|
|
|
|
2020-12-11 17:41:24 +00:00
|
|
|
- name: '{{ item.name }} - Clone repo version'
|
2020-11-07 10:49:53 +00:00
|
|
|
git:
|
|
|
|
repo: 'https://github.com/status-im/nimbus-eth2'
|
2020-12-11 17:41:24 +00:00
|
|
|
version: '{{ item.version }}'
|
2020-11-07 10:49:53 +00:00
|
|
|
dest: '{{ beacon_node_builds_path }}/{{ item.name }}/repo'
|
|
|
|
update: true
|
|
|
|
force: true
|
|
|
|
become_user: '{{ beacon_node_builds_user }}'
|
|
|
|
|
|
|
|
- name: '{{ item.name }} - Create script'
|
|
|
|
template:
|
|
|
|
src: 'build.sh.j2'
|
|
|
|
dest: '{{ beacon_node_builds_path }}/{{ item.name }}/build.sh'
|
|
|
|
owner: '{{ beacon_node_builds_user }}'
|
|
|
|
group: 'adm'
|
|
|
|
mode: 0755
|
|
|
|
|
|
|
|
- name: '{{ item.name }} - Create Dockerfile'
|
2020-11-10 14:39:24 +00:00
|
|
|
template:
|
|
|
|
src: 'Dockerfile.j2'
|
2020-11-07 10:49:53 +00:00
|
|
|
dest: '{{ beacon_node_builds_path }}/{{ item.name }}/Dockerfile'
|
|
|
|
owner: '{{ beacon_node_builds_user }}'
|
|
|
|
group: 'adm'
|
|
|
|
mode: 0644
|
|
|
|
|
|
|
|
- name: '{{ item.name }} - Create .dockerignore'
|
|
|
|
copy:
|
|
|
|
src: 'dockerignore'
|
|
|
|
dest: '{{ beacon_node_builds_path }}/{{ item.name }}/.dockerignore'
|
|
|
|
owner: '{{ beacon_node_builds_user }}'
|
|
|
|
group: 'adm'
|
|
|
|
mode: 0644
|
|
|
|
|
|
|
|
- name: Create timer for rebuilding image
|
|
|
|
include_role: name=systemd-timer
|
|
|
|
vars:
|
|
|
|
systemd_timer_name: 'beacon-node-build-{{ item.name }}'
|
|
|
|
systemd_timer_user: '{{ beacon_node_builds_user }}'
|
|
|
|
systemd_timer_description: 'Docker image build for Nimbus beacon node'
|
|
|
|
systemd_timer_requires_extra: 'docker.service'
|
|
|
|
systemd_timer_start_on_creation: false
|
2020-12-11 17:41:24 +00:00
|
|
|
systemd_timer_enabled: '{{ item.enabled | default(true) }}'
|
|
|
|
systemd_timer_frequency: '{{ item.frequency | default("daily") }}'
|
2020-11-07 10:49:53 +00:00
|
|
|
systemd_timer_timeout_sec: '{{ beacon_node_build_timer_timeout }}'
|
|
|
|
systemd_timer_work_dir: '{{ beacon_node_builds_path }}/{{ item.name }}'
|
|
|
|
systemd_timer_script_path: '{{ beacon_node_builds_path }}/{{ item.name }}/build.sh'
|