Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

Commit 02f37b8

Browse files
authored
Optionally install uStreamer from Debian package (#110)
Related #100 This PR only builds uStreamer from source if a uStreamer Debian package is not provided. This will allow TinyPilot to specify a uStreamer Debian package and avoid building uStreamer from source on every install/update. I've [tested these changes in CI](https://app.circleci.com/pipelines/github/tiny-pilot/ansible-role-ustreamer/371/workflows/f85d89d6-bf24-40e7-868b-692299e6c38e/jobs/962?invite=true#step-104-396) via 179fe04. I've also tested these changes on device via a [scratch TinyPilot Pro PR](tiny-pilot/tinypilot-pro#908). <a data-ca-tag href="https://codeapprove.com/pr/tiny-pilot/ansible-role-ustreamer/110"><img src="https://codeapprove.com/external/github-tag-allbg.png" alt="Review on CodeApprove" /></a>
1 parent b1017f8 commit 02f37b8

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

defaults/main.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
---
2+
# Specifies the filesystem path or URL of a Debian package that installs
3+
# uStreamer.
4+
ustreamer_debian_package_path: null
5+
26
ustreamer_repo: https://github.com/pikvm/ustreamer.git
37
ustreamer_repo_version: master
48

tasks/main.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,11 @@
113113
name: "{{ ustreamer_packages }}"
114114
state: present
115115

116+
- name: install uStreamer Debian package
117+
apt:
118+
deb: "{{ ustreamer_debian_package_path }}"
119+
when: ustreamer_debian_package_path != None
120+
116121
- name: create uStreamer folder
117122
file:
118123
path: "{{ ustreamer_dir }}"
@@ -125,6 +130,7 @@
125130
# to set the correct directory ownership that allows git to sync.
126131
# Issue: https://github.com/tiny-pilot/tinypilot/issues/963
127132
- molecule-idempotence-notest
133+
when: ustreamer_debian_package_path == None
128134

129135
- name: get uStreamer repo
130136
# Don't escalate privileges because only the directory owner can use git.
@@ -139,6 +145,7 @@
139145
# idempotency test on the previous task that allows git to sync.
140146
# Issue: https://github.com/tiny-pilot/tinypilot/issues/963
141147
- molecule-idempotence-notest
148+
when: ustreamer_debian_package_path == None
142149

143150
# We always need to clean and build uStreamer to ensure that the uStreamer
144151
# service is in sync with its dependencies installed on the device.
@@ -149,6 +156,7 @@
149156
target: clean
150157
tags:
151158
- molecule-idempotence-notest
159+
when: ustreamer_debian_package_path == None
152160

153161
- name: build uStreamer
154162
make:
@@ -159,6 +167,7 @@
159167
- restart uStreamer
160168
tags:
161169
- molecule-idempotence-notest
170+
when: ustreamer_debian_package_path == None
162171

163172
- name: fix uStreamer folder permissions
164173
file:
@@ -212,7 +221,7 @@
212221
dest: "{{ ustreamer_janus_plugins_dir }}"
213222
notify:
214223
- restart Janus
215-
when: ustreamer_install_janus
224+
when: ustreamer_debian_package_path == None and ustreamer_install_janus
216225

217226
- name: install uStreamer launcher
218227
import_tasks: install_launcher.yml

0 commit comments

Comments
 (0)