Skip to content
This repository was archived by the owner on Mar 7, 2025. It is now read-only.

Commit 8b8e154

Browse files
committed
Ombi: Revert to stable version when unstable one isn't available.
1 parent c0889cc commit 8b8e154

File tree

3 files changed

+52
-8
lines changed

3 files changed

+52
-8
lines changed

roles/ombi/tasks/main.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#########################################################################
2-
# Title: Cloudbox: Ombi Role #
2+
# Title: Cloudbox: Ombi #
33
# Author(s): RXWatcher1, l3uddz, desimaniac #
44
# URL: https://github.com/cloudbox/cloudbox #
55
# Docker Image: hotio/ombi #
@@ -21,8 +21,16 @@
2121
name: ombi
2222
state: absent
2323

24-
- name: Suitarr Migration Tasks
25-
import_tasks: "subtasks/suitarr_migration.yml"
24+
- name: Suitarr | Migration Tasks
25+
import_tasks: "subtasks/suitarr/migration.yml"
26+
27+
- name: Set 'ombi_version' variable
28+
set_fact:
29+
ombi_version: "{{ suitarr.version }}"
30+
31+
- name: Suitarr | Version Check Tasks
32+
include_tasks: "subtasks/suitarr/version.yml"
33+
when: (ombi_version == 'unstable')
2634

2735
- name: Create ombi directories
2836
file: "path={{ item }} state=directory mode=0775 owner={{ user.name }} group={{ user.name }}"
@@ -37,7 +45,7 @@
3745
published_ports:
3846
- "127.0.0.1:3579:5000"
3947
env:
40-
VERSION: "{{ suitarr.version }}"
48+
VERSION: "{{ ombi_version }}"
4149
BACKUP: "no"
4250
PUID: "{{ uid }}"
4351
PGID: "{{ gid }}"

roles/ombi/tasks/subtasks/suitarr_migration.yml renamed to roles/ombi/tasks/subtasks/suitarr/migration.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#########################################################################
2-
# Title: Ombi: Suitarr Migration Tasks #
2+
# Title: Cloudbox: Ombi | Suitarr | Migration Tasks #
33
# Author(s): desimaniac #
44
# URL: https://github.com/cloudbox/cloudbox #
55
# -- #
@@ -8,17 +8,17 @@
88
# GNU General Public License v3.0 #
99
#########################################################################
1010
---
11-
- name: Suitarr Migration | Check folder exists
11+
- name: Suitarr | Migration | Check folder exists
1212
stat:
1313
path: /opt/ombi
1414
register: folder
1515

16-
- name: Suitarr Migration | Check subfolder exists
16+
- name: Suitarr | Migration | Check subfolder exists
1717
stat:
1818
path: /opt/ombi/app
1919
register: subfolder
2020

21-
- name: Suitarr Migration | Move 'ombi' folder contents to 'app' subfolder
21+
- name: Suitarr | Migration | Move 'ombi' folder contents to 'app' subfolder
2222
shell: |
2323
mv /opt/ombi /tmp/app
2424
mkdir /opt/ombi
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#########################################################################
2+
# Title: Cloudbox: Ombi | Suitarr | Version Check Tasks #
3+
# Author(s): desimaniac #
4+
# URL: https://github.com/cloudbox/cloudbox #
5+
# -- #
6+
# Part of the Cloudbox project: https://cloudbox.works #
7+
#########################################################################
8+
# GNU General Public License v3.0 #
9+
#########################################################################
10+
---
11+
- name: Suitarr | Version Check | Fetch AppVeyor job info
12+
uri:
13+
url: "https://ci.appveyor.com/api/projects/tidusjar/requestplex/branch/develop"
14+
register: request
15+
16+
- name: Suitarr | Version Check | Check for available artificats
17+
uri:
18+
url: "https://ci.appveyor.com/api/buildjobs/{{ request.json.build.jobs[0].jobId }}/artifacts"
19+
register: request2
20+
21+
- name: Suitarr | Version Check | Set 'ombi_unstable_status' variable
22+
set_fact:
23+
ombi_unstable_status: "{{ (request2.json | length > 0) }}"
24+
25+
- name: Suitarr | Version Check | Tasks for when artifact is unavailable
26+
block:
27+
28+
- name: Suitarr | Version Check | Set 'ombi_version' to 'stable'
29+
set_fact:
30+
ombi_version: stable
31+
32+
- name: Suitarr | Version Check | Print new 'ombi_version' branch
33+
debug:
34+
msg: "The '{{ suitarr.version }}' version is unavailable. Using '{{ ombi_version }}' version instead."
35+
36+
when: (not ombi_unstable_status)

0 commit comments

Comments
 (0)