1
0
mirror of https://github.com/ostreedev/ostree-go.git synced 2026-02-05 06:47:23 +01:00

tests: try to build Skopeo and pull an image

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
Giuseppe Scrivano
2018-08-27 14:38:39 +02:00
parent d44161b4df
commit 6cb628a263
2 changed files with 28 additions and 2 deletions

View File

@@ -5,6 +5,14 @@ services:
matrix:
fast_finish: true
allow_failures:
- env: TEST=skopeo
env:
global:
matrix:
- TEST=integration
- TEST=skopeo
# Don't send out emails
notifications:
@@ -12,8 +20,9 @@ notifications:
before_script:
- docker pull registry.fedoraproject.org/fedora:latest
- docker run -e GOPATH=/opt --cidfile=/tmp/cidfile registry.fedoraproject.org/fedora:latest /bin/bash -c "dnf install -y make golang go-compilers-golang-compiler findutils ostree ostree-devel"
- docker run -e GOPATH=/opt --cidfile=/tmp/cidfile registry.fedoraproject.org/fedora:latest /bin/bash -c "dnf install -y make golang go-compilers-golang-compiler findutils ostree ostree-devel gpgme-devel libassuan-devel btrfs-progs-devel device-mapper-devel"
- docker commit `cat /tmp/cidfile` go-ostree/test
script:
- docker run --rm -e GOPATH=/opt -v ${PWD}:/opt/src/github.com/ostreedev/ostree-go go-ostree/test /bin/bash -c "cd /opt/src/github.com/ostreedev/ostree-go && make install-tools && PATH=$PATH:/opt/bin make deps && PATH=$PATH:/opt/bin make lint && PATH=$PATH:/opt/bin make test"
- if [ $TEST == 'integration' ]; then docker run --rm -e GOPATH=/opt -v ${PWD}:/opt/src/github.com/ostreedev/ostree-go go-ostree/test /bin/bash -c "cd /opt/src/github.com/ostreedev/ostree-go && make install-tools && PATH=$PATH:/opt/bin make deps && PATH=$PATH:/opt/bin make lint && PATH=$PATH:/opt/bin make test"; fi
- if [ $TEST == 'skopeo' ]; then docker run --rm -e GOPATH=/opt -v ${PWD}:/ostree-go go-ostree/test /ostree-go/scripts/travis/test_skopeo.sh; fi

17
scripts/travis/test_skopeo.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/bash
set -euo pipefail
go get github.com/LK4D4/vndr
mkdir -p $GOPATH/src/github.com/containers
cd $GOPATH/src/github.com/containers
git clone https://github.com/containers/skopeo
cd skopeo
sed -i -e 's|^github.com/ostreedev/ostree-go.*$|github.com/ostreedev/ostree-go HEAD /ostree-go|g' vendor.conf
$GOPATH/bin/vndr
make binary-local
mkdir -p /ostree/repo
ostree --repo=/ostree/repo init --mode=bare-user
mkdir -p /etc/containers/
cp -u default-policy.json /etc/containers/policy.json
./skopeo copy docker://docker.io/fedora ostree:docker.io/fedora@/ostree/repo