Skip to content

Commit

Permalink
add snap tests
Browse files Browse the repository at this point in the history
  • Loading branch information
casperdcl committed Jan 19, 2020
1 parent 430b9bb commit 39ef3db
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jobs:
- sudo /snap/bin/lxd init --auto
install:
script:
- sudo snapcraft --use-lxd
- ./scripts/build_snap.sh
after_failure:
- sudo journalctl -u snapd

Expand Down
27 changes: 13 additions & 14 deletions scripts/build_package.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
#!/bin/bash

set -e
set -x

if [ ! -d "dvc" ]; then
echo "Please run this script from repository root"
exit 1
echo "Please run this script from repository root"
exit 1
fi

echo 'PKG = "pip"' > dvc/utils/build.py
Expand All @@ -15,15 +14,15 @@ python setup.py bdist_wheel --universal

# Make sure we have a correct version
if [[ -n "$TRAVIS_TAG" ]]; then
pip uninstall -y dvc
if which dvc; then
echo "ERROR: dvc command still exists! Unable to verify dvc version."
exit 1
fi
pip install dist/dvc-*.whl
if [[ "$(dvc --version)" != "$TRAVIS_TAG" ]]; then
echo "ERROR: 'dvc --version'$(dvc -V) doesn't match '$TRAVIS_TAG'"
exit 1
fi
pip uninstall -y dvc
pip uninstall -y dvc
if which dvc; then
echo "ERROR: dvc command still exists! Unable to verify dvc version." >&2
exit 1
fi
pip install dist/dvc-*.whl
if [[ "$(dvc --version)" != "$TRAVIS_TAG" ]]; then
echo "ERROR: 'dvc --version'$(dvc -V) doesn't match '$TRAVIS_TAG'" >&2
exit 1
fi
pip uninstall -y dvc
fi
27 changes: 27 additions & 0 deletions scripts/build_snap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash
set -e
set -x

if [ ! -d "dvc" ]; then
echo "Please run this script from repository root"
exit 1
fi

sudo snapcraft --use-lxd

# Make sure we have a correct version
if [[ -n "$TRAVIS_TAG" ]]; then
pip uninstall -y dvc
if which dvc; then
echo "ERROR: dvc command still exists! Unable to verify dvc version." >&2
exit 1
fi
sudo snap install --dangerous --classic dvc_*.snap
if [[ "$(dvc --version)" != "$TRAVIS_TAG" ]]; then
echo "ERROR: 'dvc --version'$(dvc -V) doesn't match '$TRAVIS_TAG'" >&2
exit 1
fi
dvc version
dvc get https://github.com/iterative/dvc scripts/innosetup/dvc.ico
sudo snap remove dvc
fi

0 comments on commit 39ef3db

Please sign in to comment.