forked from multiarch/qemu-user-static
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
60 lines (60 loc) · 2.34 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
dist: xenial
services: docker
language: bash
addons:
apt:
config:
retries: true
update: true
sources:
# Install rpm2cpio (4.14.1+dfsg1-2) and
# cpio (2.12+dfsg-6) packages for bionic,
# the error "cpio: Malformed number" happens
# for qemu-user-static-4.1.0-1.fc31.x86_64.rpm,
# with rpm2cpio (4.12.0.1+dfsg1-3build3) and
# cpio (2.11+dfsg-5ubuntu1) and rpm2cpio for xenial.
# https://packages.ubuntu.com/bionic/cpio
- sourceline: "deb http://archive.ubuntu.com/ubuntu bionic main universe"
packages:
- jq
- rpm2cpio
- cpio
env:
global:
- MAJOR_VERSION=5
- MINOR_VERSION=1
- PATCH_VERSION=0
- RELEASE_VERSION=2
- VERSION=$MAJOR_VERSION.$MINOR_VERSION.$PATCH_VERSION-$RELEASE_VERSION
# Container tag version string.
# Set it here to give a flexibility of the value such as "X.Y".
- TAG_VER=$VERSION
# See qemu-user-static's RPM spec file on Fedora to check the new version.
# https://src.fedoraproject.org/rpms/qemu/blob/master/f/qemu.spec
- DOCKER_SERVER=docker.io
# - DOCKER_SERVER=quay.io
# Git repository
- REPO=multiarch/qemu-user-static
# Container repository
- DOCKER_REPO=$DOCKER_SERVER/multiarch/qemu-user-static
# - DOCKER_REPO=$DOCKER_SERVER/your_username/qemu-user-static
- PACKAGE_URI="https://kojipkgs.fedoraproject.org/packages/qemu/5.1.0/2.eln103/x86_64/qemu-user-static-5.1.0-2.eln103.x86_64.rpm"
- PACKAGE_FILENAME=$(basename "$PACKAGE_URI")
before_script:
- wget --content-disposition $PACKAGE_URI
- rpm2cpio $PACKAGE_FILENAME | cpio -dimv
script:
- ./generate_tarballs.sh
- |
if [[ $TRAVIS_BRANCH == 'master' && $TRAVIS_PULL_REQUEST == 'false' ]]; then
./publish.sh -v "$VERSION" -t "$GITHUB_TOKEN" -r "$REPO"
fi
- ./update.sh -v "$VERSION" -t "$TAG_VER" -r "$REPO" -d "$DOCKER_REPO"
- docker images
- ./test.sh -d "$DOCKER_REPO"
after_success:
- |
if [[ $TRAVIS_BRANCH == 'master' && $TRAVIS_PULL_REQUEST == 'false' ]]; then
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" "$DOCKER_SERVER" && \
docker push "$DOCKER_REPO"
fi