Merge pull request #2956 from casperdcl/snap

add snap tests
This commit is contained in:
Ruslan Kuprieiev
2020-01-19 21:36:47 +02:00
committed by GitHub
6 changed files with 43 additions and 7 deletions
+2 -2
View File
@@ -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
@@ -135,7 +135,7 @@ deploy:
stage: build
- provider: snap
snap: dvc_*.snap
channel: ${TRAVIS_TAG:+stable}${TRAVIS_TAG:-edge}
channel: $SNAP_CHANNEL
skip_cleanup: true
on:
all_branches: true
+3 -3
View File
@@ -4,7 +4,7 @@ set -e
set -x
if [ ! -d "dvc" ]; then
echo "Please run this script from repository root"
echo "Please run this script from repository root" >&2
exit 1
fi
@@ -17,12 +17,12 @@ python setup.py bdist_wheel --universal
if [[ -n "$TRAVIS_TAG" ]]; then
pip uninstall -y dvc
if which dvc; then
echo "ERROR: dvc command still exists! Unable to verify dvc version."
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'"
echo "ERROR: 'dvc --version'$(dvc -V) doesn't match '$TRAVIS_TAG'" >&2
exit 1
fi
pip uninstall -y dvc
+1 -1
View File
@@ -29,7 +29,7 @@ fi
print_error()
{
echo -e "\e[31m$1\e[0m"
echo -e "\e[31m$1\e[0m" >&2
}
if [ ! -d "dvc" ]; then
+30
View File
@@ -0,0 +1,30 @@
#!/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
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 [[ -n "$TRAVIS_TAG" ]]; then
# Make sure we have a correct version
if [[ "$(dvc --version)" != "$TRAVIS_TAG" ]]; then
echo "ERROR: 'dvc --version'$(dvc -V) doesn't match '$TRAVIS_TAG'" >&2
exit 1
fi
fi
# ensure basic commands can run
# N.B.: cannot run `dvc get` on travis (#2956)
dvc version
dvc.git status
dvc.git fetch --all
sudo snap remove dvc
+6
View File
@@ -50,3 +50,9 @@ elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
ln -s -f /usr/local/bin/python3 /usr/local/bin/python
ln -s -f /usr/local/bin/pip3 /usr/local/bin/pip
fi
if [[ -n "$TRAVIS_TAG" ]]; then
echo "export SNAP_CHANNEL=stable" >> env.sh
else
echo "export SNAP_CHANNEL=edge" >> env.sh
fi
+1 -1
View File
@@ -3,7 +3,7 @@ summary: Data Version Control
description: Git for Data & Models https://dvc.org
adopt-info: dvc
grade: stable
confinement: classic # for same reasons as snap `git-ubuntu`
confinement: classic # for `dvc run`ning external binaries
base: core18
license: Apache-2.0
layout: