lnurld/build/tasks/main.yaml
author Luke Hoersten <luke@hoersten.org>
Fri, 15 Sep 2023 22:45:51 -0500
changeset 31 562b76293a66
child 32 500a32d1f026
permissions -rw-r--r--
Moved lnurld from my general ansible roles repo to the btc specific repo.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
31
562b76293a66 Moved lnurld from my general ansible roles repo to the btc specific repo.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     1
---
562b76293a66 Moved lnurld from my general ansible roles repo to the btc specific repo.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     2
562b76293a66 Moved lnurld from my general ansible roles repo to the btc specific repo.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     3
- name: install golang
562b76293a66 Moved lnurld from my general ansible roles repo to the btc specific repo.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     4
  become: yes
562b76293a66 Moved lnurld from my general ansible roles repo to the btc specific repo.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     5
  apt: name="golang-go"
562b76293a66 Moved lnurld from my general ansible roles repo to the btc specific repo.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     6
562b76293a66 Moved lnurld from my general ansible roles repo to the btc specific repo.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     7
- name: git checkout lnurld
562b76293a66 Moved lnurld from my general ansible roles repo to the btc specific repo.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     8
  git:
562b76293a66 Moved lnurld from my general ansible roles repo to the btc specific repo.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     9
    repo: "{{lnurld_git}}"
562b76293a66 Moved lnurld from my general ansible roles repo to the btc specific repo.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    10
    dest: "{{lnurld_build_dir}}"
562b76293a66 Moved lnurld from my general ansible roles repo to the btc specific repo.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    11
562b76293a66 Moved lnurld from my general ansible roles repo to the btc specific repo.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    12
- name: check if build exists
562b76293a66 Moved lnurld from my general ansible roles repo to the btc specific repo.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    13
  stat:
562b76293a66 Moved lnurld from my general ansible roles repo to the btc specific repo.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    14
    path: "{{lnurld_build_dir}}/lnurld"
562b76293a66 Moved lnurld from my general ansible roles repo to the btc specific repo.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    15
  register: build_file
562b76293a66 Moved lnurld from my general ansible roles repo to the btc specific repo.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    16
562b76293a66 Moved lnurld from my general ansible roles repo to the btc specific repo.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    17
- name: build
562b76293a66 Moved lnurld from my general ansible roles repo to the btc specific repo.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    18
  command: "go build"
562b76293a66 Moved lnurld from my general ansible roles repo to the btc specific repo.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    19
  args:
562b76293a66 Moved lnurld from my general ansible roles repo to the btc specific repo.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    20
    chdir: "/tmp/lnurld/"
562b76293a66 Moved lnurld from my general ansible roles repo to the btc specific repo.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    21
  when: not build_file.stat.exists
562b76293a66 Moved lnurld from my general ansible roles repo to the btc specific repo.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    22
562b76293a66 Moved lnurld from my general ansible roles repo to the btc specific repo.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    23
- name: create build server dir
562b76293a66 Moved lnurld from my general ansible roles repo to the btc specific repo.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    24
  become: yes
562b76293a66 Moved lnurld from my general ansible roles repo to the btc specific repo.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    25
  file:
562b76293a66 Moved lnurld from my general ansible roles repo to the btc specific repo.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    26
    path: "{{lnurld_srv_dir}}"
562b76293a66 Moved lnurld from my general ansible roles repo to the btc specific repo.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    27
    mode: "0755"
562b76293a66 Moved lnurld from my general ansible roles repo to the btc specific repo.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    28
    state: "directory"
562b76293a66 Moved lnurld from my general ansible roles repo to the btc specific repo.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    29
  when: not build_file.stat.exists
562b76293a66 Moved lnurld from my general ansible roles repo to the btc specific repo.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    30
562b76293a66 Moved lnurld from my general ansible roles repo to the btc specific repo.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    31
- name: copy bin to build server dir
562b76293a66 Moved lnurld from my general ansible roles repo to the btc specific repo.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    32
  become: yes
562b76293a66 Moved lnurld from my general ansible roles repo to the btc specific repo.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    33
  copy:
562b76293a66 Moved lnurld from my general ansible roles repo to the btc specific repo.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    34
    remote_src: yes
562b76293a66 Moved lnurld from my general ansible roles repo to the btc specific repo.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    35
    src: "{{lnurld_build_dir}}/lnurld"
562b76293a66 Moved lnurld from my general ansible roles repo to the btc specific repo.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    36
    dest: "{{lnurld_srv_dir}}/lnurld"
562b76293a66 Moved lnurld from my general ansible roles repo to the btc specific repo.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    37
  when: not build_file.stat.exists