Skip to content

Commit

Permalink
Merge pull request #3065 from freedomofpress/wip-dachary-wheelhouse-fail
Browse files Browse the repository at this point in the history
build: pip wheel must fail when it does not build a python module
  • Loading branch information
redshiftzero authored Feb 26, 2018
2 parents 8d8875a + 85c484d commit d49e865
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@
- include: sass.yml

- name: Create pip wheel archive for Debian package requirements.
command: >
pip wheel
-r {{ securedrop_code_filtered }}/requirements/securedrop-app-code-requirements.txt
-w {{ securedrop_app_code_deb_dir }}/var/securedrop/wheelhouse
shell: |
pip wheel \
-r {{ securedrop_code_filtered }}/requirements/securedrop-app-code-requirements.txt \
-w {{ securedrop_app_code_deb_dir }}/var/securedrop/wheelhouse 2>&1 | tee /tmp/w.out
! grep -i --quiet 'Failed to build' /tmp/w.out
tags: pip

- include: translations.yml
Expand Down
8 changes: 7 additions & 1 deletion molecule/builder/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
FROM ubuntu:14.04
ARG IMAGE
FROM $IMAGE

# additional meta-data makes it easier to clean up, find
ARG NAME
LABEL org="Freedom of the Press"
LABEL image_name="$NAME"

RUN apt-get -y update && apt-get install -y python rsync sudo bash \
devscripts git aptitude ipython libssl-dev ntp \
Expand Down
7 changes: 0 additions & 7 deletions molecule/builder/Dockerfile.j2

This file was deleted.

27 changes: 25 additions & 2 deletions molecule/builder/create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,36 @@
molecule_ephemeral_directory: "{{ lookup('env', 'MOLECULE_EPHEMERAL_DIRECTORY') }}"
molecule_scenario_directory: "{{ lookup('env', 'MOLECULE_SCENARIO_DIRECTORY') }}"
molecule_yml: "{{ lookup('file', molecule_file) | from_yaml }}"
docker_hash: "{{ lookup('file', '../docker_hashes.yml') | from_yaml }}"
tasks:
- name: Get hash of our molecule folder, plus dockerfile
stat:
path: "./{{ item }}"
get_md5: "no"
checksum_algorithm: sha256
register: file_hashes
with_items:
- Dockerfile
- molecule.yml

- name: Get a unique concatenated hash for docker tagging
set_fact:
docker_tag: "{{ docker_tag|default('') + item[0:8] }}"
with_items: "{{ file_hashes.results| map(attribute='stat.checksum') | list }}"

- name: Create builder image
docker_image:
name: "sd.local/{{ item.name }}:{{ docker_tag }}"
path: .
buildargs:
IMAGE: "{{ item.image }}"
NAME: "{{ item.name }}"
with_items: "{{ molecule_yml.platforms }}"

- name: Create molecule instance(s)
docker_container:
name: "{{ item.name }}"
hostname: "{{ item.name }}"
image: "{{ item.image }}@{{ docker_hash[item.hash_name] }}"
image: "sd.local/{{ item.name }}:{{ docker_tag }}"
state: started
recreate: True
command: "tail -f /dev/null"
Expand Down
6 changes: 3 additions & 3 deletions molecule/builder/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ driver:
lint:
name: yamllint
platforms:
- name: build
image: quay.io/freedomofpress/ubuntu:trusty
hash_name: ubuntu
- name: trusty-sd-builder
# Trusty from 2017-12-15
image: ubuntu@sha256:084989eb923bd86dbf7e706d464cf3587274a826b484f75b69468c19f8ae354c
groups:
- build
provisioner:
Expand Down
2 changes: 0 additions & 2 deletions molecule/docker_hashes.yml

This file was deleted.

0 comments on commit d49e865

Please sign in to comment.