Skip to content

Commit

Permalink
Adds git-lfs to installdeps target
Browse files Browse the repository at this point in the history
Provides a convenient method for installing git-lfs, as part of the
install-required-dependencies step. Added a conditional check to ensure
that the wheels are indeed retrieved via git-lfs. This change is
required by developers only on first-run, thus the conditional, but
required in CI all the time, since the repo is cloned before deps are
installed.
  • Loading branch information
Conor Schaefer committed Jan 14, 2020
1 parent 9f51495 commit deba9e7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 31 deletions.
30 changes: 0 additions & 30 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,22 +99,6 @@ common-steps:
make $PKG_NAME
ls ~/debbuild/packaging/*.deb
- &installgitlfs
run:
name: Install Git LFS.
command: |
export GIT_LFS_VERSION=2.7.2
export GIT_LFS_CHECKSUM=89f5aa2c29800bbb71f5d4550edd69c5f83e3ee9e30f770446436dd7f4ef1d4c
wget https://github.com/git-lfs/git-lfs/releases/download/v$GIT_LFS_VERSION/git-lfs-linux-amd64-v$GIT_LFS_VERSION.tar.gz
sha256sum git-lfs-linux-amd64-v$GIT_LFS_VERSION.tar.gz | grep $GIT_LFS_CHECKSUM
tar xzf git-lfs-linux-amd64-v$GIT_LFS_VERSION.tar.gz
sudo mv git-lfs /usr/local/bin/git-lfs
git lfs install
# Re-fetch assets to resolve pointers to actual files
rm -r localwheels/
git checkout localwheels/
git lfs fetch
- &addsshkeys
add_ssh_keys:
fingerprints:
Expand Down Expand Up @@ -188,7 +172,6 @@ jobs:
- image: circleci/python:3.7-buster
steps:
- checkout
- *installgitlfs
- *installdeps
- *clonesecuredroplog
- *getlatestreleasedversion
Expand All @@ -200,14 +183,12 @@ jobs:
- image: circleci/python:3.7-buster
steps:
- checkout
- *installgitlfs
- *installdeps
- *clonesecuredroplog
- *getnightlyversion
- *makesourcetarball
- *updatedebianchangelog
- *builddebianpackage
- *installgitlfs
- *addsshkeys
- *commitworkstationdebs

Expand All @@ -216,7 +197,6 @@ jobs:
- image: circleci/python:3.7-buster
steps:
- checkout
- *installgitlfs
- *installdeps
- *clonesecuredropclient
- *getlatestreleasedversion
Expand All @@ -228,14 +208,12 @@ jobs:
- image: circleci/python:3.7-buster
steps:
- checkout
- *installgitlfs
- *installdeps
- *clonesecuredropclient
- *getnightlyversion
- *makesourcetarball
- *updatedebianchangelog
- *builddebianpackage
- *installgitlfs
- *addsshkeys
- *commitworkstationdebs

Expand All @@ -244,7 +222,6 @@ jobs:
- image: circleci/python:3.7-buster
steps:
- checkout
- *installgitlfs
- *installdeps
- *clonesecuredropproxy
- *getlatestreleasedversion
Expand All @@ -256,14 +233,12 @@ jobs:
- image: circleci/python:3.7-buster
steps:
- checkout
- *installgitlfs
- *installdeps
- *clonesecuredropproxy
- *getnightlyversion
- *makesourcetarball
- *updatedebianchangelog
- *builddebianpackage
- *installgitlfs
- *addsshkeys
- *commitworkstationdebs

Expand All @@ -272,7 +247,6 @@ jobs:
- image: circleci/python:3.7-buster
steps:
- checkout
- *installgitlfs
- *installdeps
- *clonesecuredropexport
- *getlatestreleasedversion
Expand All @@ -284,14 +258,12 @@ jobs:
- image: circleci/python:3.7-buster
steps:
- checkout
- *installgitlfs
- *installdeps
- *clonesecuredropexport
- *getnightlyversion
- *makesourcetarball
- *updatedebianchangelog
- *builddebianpackage
- *installgitlfs
- *addsshkeys
- *commitworkstationdebs

Expand All @@ -300,7 +272,6 @@ jobs:
- image: circleci/python:3.7-buster
steps:
- checkout
- *installgitlfs
- *installdeps
- *setsvsdispname
- *setmetapackageversion
Expand All @@ -311,7 +282,6 @@ jobs:
- image: circleci/python:3.7-buster
steps:
- checkout
- *installgitlfs
- *installdeps
- *setsdgrsecname
- *setmetapackageversion
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ make install-deps
**Note:** either run `make install-deps` each time you start your debian packaging AppVM, or make
sure that you install them into the template for your debian packaging AppVM.

The install target will configure [git-lfs](https://git-lfs.github.com/), used for storing
binary wheel files.

## Updating Python wheels

Maintainers of `securedrop-client` and `securedrop-proxy` must ensure that
Expand Down
16 changes: 15 additions & 1 deletion scripts/install-deps
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
# Installs required dependencies for building SecureDrop Worsktation packages.
# Assumes a Debian 9 machine, ideally a Qubes AppVM.
# Assumes a Debian 10 machine, ideally a Qubes AppVM.

sudo apt-get update
sudo apt-get install \
Expand All @@ -10,7 +10,21 @@ sudo apt-get install \
dh-make \
dh-python \
dh-virtualenv \
git-lfs \
libffi-dev \
libssl-dev \
python3-all \
python3-setuptools


# Inspect the wheel files present locally. If repo was cloned
# without git-lfs, they'll be "text/plain", rather than "application/zip".
wheel_mime_types="$(find localwheels/ -type f -iname '*.whl' -exec file --mime-type {} + | perl -F':\s+' -lanE 'say $F[-1]' | sort -u)"
if [[ "$wheel_mime_types" != "application/zip" ]]; then
echo "Re-fetching git-lfs assets..."
git lfs install
# Re-fetch assets to resolve pointers to actual files
rm -r localwheels/
git checkout localwheels/
git lfs fetch
fi

0 comments on commit deba9e7

Please sign in to comment.