From 9c3b16c879cf90b4ef2c82172d583681f8445fd3 Mon Sep 17 00:00:00 2001 From: Fabian Koller Date: Sun, 31 Jan 2021 11:25:39 +0100 Subject: [PATCH] Switch CI target to sha instead of ref --- ansible/molecule/default/converge.yml | 4 ++-- ansible/tasks/main.yml | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ansible/molecule/default/converge.yml b/ansible/molecule/default/converge.yml index f5f9b17c2..1ae260bac 100644 --- a/ansible/molecule/default/converge.yml +++ b/ansible/molecule/default/converge.yml @@ -2,9 +2,9 @@ - name: update previous release to newest release hosts: all tasks: - - name: set github ref as version when available + - name: set current github commit as version when available set_fact: - paperlessng_version: "{{ lookup('env', 'GITHUB_REF') | default('latest', True) }}" + paperlessng_version: "{{ lookup('env', 'GITHUB_SHA') | default('master', True) }}" - name: update to newest paperless-ng release include_role: name: ansible diff --git a/ansible/tasks/main.yml b/ansible/tasks/main.yml index f45747cb6..dba409549 100644 --- a/ansible/tasks/main.yml +++ b/ansible/tasks/main.yml @@ -114,6 +114,12 @@ paperlessng_version: "{{ latest_release.json['tag_name'] }}" when: paperlessng_version == "latest" +- name: check if version is ref + fail: + msg: "Specifying `paperlessng_version` as git ref may not work as expected!" + ignore_errors: True # Output failure (as warning), but don't consider play failed + when: paperlessng_version.startswith('refs/') + - block: - name: sanitize version string set_fact: