Skip to content

Commit

Permalink
Confirm local debs are present for upgrade scenario
Browse files Browse the repository at this point in the history
If the upgrade scenario is used with the local debs strategy (i.e.,
QA_APT_TEST env var is not set), we should fail fast without the
required local deb files. Previously, the scenario would proceed all the
way to the local apt server configuration and only fail when attempting
to sign the Release file with a test key.

Now, the role will fail almost immediately without local debs present.
Hat tip to @zenmonkeykstop for flagging during review.
  • Loading branch information
Conor Schaefer committed Jan 4, 2019
1 parent da63bb1 commit 6c837ff
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions molecule/upgrade/playbook.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,30 @@
---
- name: Confirm local debs present if required
hosts: localhost
gather_facts: no
vars:
molecule_dir: "{{ lookup('env', 'MOLECULE_SCENARIO_DIRECTORY') }}"
tasks:
# Before running apt-server logic, confirm we have local
# debs built.
- name: Establish QA strategy
set_fact:
QA_APTTEST: "{{ lookup('env','QA_APTTEST')|bool }}"

- name: Find local deb files
find:
paths: "{{ molecule_dir }}/../../build/"
patterns: "*.deb"
register: _upgrade_scenario_find_debs_result
when: not QA_APTTEST

- name: Ensure debs were found
assert:
that:
- "_upgrade_scenario_find_debs_result.files|length >= 8"
msg: "No local debs found, run 'make build-debs'"
when: not QA_APTTEST

- name: Re-run original tor role
hosts: securedrop
max_fail_percentage: 0
Expand Down

0 comments on commit 6c837ff

Please sign in to comment.