Update to 2022-01-30 13:00

This commit is contained in:
Daniel Berteaud
2022-01-30 13:00:05 +01:00
parent 1c2a883ec4
commit 03f70d2e98
11 changed files with 86 additions and 4 deletions

View File

@@ -0,0 +1,8 @@
---
# Babashka version to deploy
bb_version: 0.7.4
# URL of the archive
bb_archive_url: https://github.com/babashka/babashka/releases/download/v{{ bb_version }}/babashka-{{ bb_version }}-linux-amd64-static.tar.gz
# Expected sha256sum of the archive
bb_archive_sha256: 707aab21b40921d0d3323e24ebc7330680e650e6bb3aab6ba67abdcf4f2f146c

View File

@@ -0,0 +1,4 @@
---
dependencies:
- role: clojure

View File

@@ -0,0 +1,8 @@
---
- name: Remove tmp and obsolete files
file: path={{ item }} state=absent
loop:
- /tmp/babashka-{{ bb_version }}-linux-amd64-static.tar.gz
- /tmp/bb
tags: bb

View File

@@ -0,0 +1,30 @@
---
- name: Set default install mode
set_fact: bb_install_mode='none'
tags: bb
- name: Check if bb is installed
stat: path=/usr/local/bin/bb
register: bb_bin
changed_when: False
tags: bb
- name: Set install mode to install
set_fact: bb_install_mode='install'
when: not bb_bin.stat.exists
tags: bb
- name: Detect installed version
block:
- shell: bb --version | perl -ne 'm/babashka\s+v(\d+(\.\d+)*)/ && print "$1"'
changed_when: False
register: bb_current_version
- set_fact: bb_current_version={{ bb_current_version.stdout }}
tags: bb
- name: Set install mode to upgrade
set_fact: bb_install_mode='upgrade'
when: bb_current_version != bb_version
tags: bb

View File

@@ -0,0 +1,25 @@
---
- when: bb_install_mode != 'none'
block:
- name: Download babashka archive
get_url:
url: "{{ bb_archive_url }}"
dest: /tmp/
checksum: sha256:{{ bb_archive_sha256 }}
- name: Extract archive
unarchive:
src: /tmp/babashka-{{ bb_version }}-linux-amd64-static.tar.gz
dest: /tmp/
remote_src: True
- name: Install babashka binary
copy:
src: /tmp/bb
dest: /usr/local/bin/bb
remote_src: True
mode: 755
tags: bb

View File

@@ -0,0 +1,5 @@
---
- include: facts.yml
- include: install.yml
- include: cleanup.yml