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'
|
|
|
|
force: true
|
2021-02-22 20:35:30 +00:00
|
|
|
# Normally we don't update or timer might miss some changes.
|
|
|
|
update: '{{ item.get("update", false) }}'
|
2020-11-07 10:49:53 +00:00
|
|
|
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'
|
2021-02-08 10:46:24 +00:00
|
|
|
mode: 0775
|
2020-11-07 10:49:53 +00:00
|
|
|
|
|
|
|
- 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 }}'
|
2021-02-08 10:46:24 +00:00
|
|
|
group: '{{ beacon_node_builds_group }}'
|
|
|
|
mode: 0664
|
2020-11-07 10:49:53 +00:00
|
|
|
|
|
|
|
- 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 }}'
|
2021-04-07 07:23:50 +00:00
|
|
|
systemd_timer_group: '{{ beacon_node_builds_group }}'
|
2020-11-07 10:49:53 +00:00
|
|
|
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'
|