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

Commit

Permalink
Optionally install uStreamer from Debian package (#110)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
jdeanwallace authored May 24, 2023
1 parent b1017f8 commit 02f37b8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
4 changes: 4 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
---
# Specifies the filesystem path or URL of a Debian package that installs
# uStreamer.
ustreamer_debian_package_path: null

ustreamer_repo: https://github.com/pikvm/ustreamer.git
ustreamer_repo_version: master

Expand Down
11 changes: 10 additions & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@
name: "{{ ustreamer_packages }}"
state: present

- name: install uStreamer Debian package
apt:
deb: "{{ ustreamer_debian_package_path }}"
when: ustreamer_debian_package_path != None

- name: create uStreamer folder
file:
path: "{{ ustreamer_dir }}"
Expand All @@ -125,6 +130,7 @@
# to set the correct directory ownership that allows git to sync.
# Issue: https://github.com/tiny-pilot/tinypilot/issues/963
- molecule-idempotence-notest
when: ustreamer_debian_package_path == None

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

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

- name: build uStreamer
make:
Expand All @@ -159,6 +167,7 @@
- restart uStreamer
tags:
- molecule-idempotence-notest
when: ustreamer_debian_package_path == None

- name: fix uStreamer folder permissions
file:
Expand Down Expand Up @@ -212,7 +221,7 @@
dest: "{{ ustreamer_janus_plugins_dir }}"
notify:
- restart Janus
when: ustreamer_install_janus
when: ustreamer_debian_package_path == None and ustreamer_install_janus

- name: install uStreamer launcher
import_tasks: install_launcher.yml

0 comments on commit 02f37b8

Please sign in to comment.