Skip to content

Commit c4f9d6b

Browse files
committed
Allow to build a Ubuntu18.04 version on Travis
1 parent c66bbe7 commit c4f9d6b

File tree

2 files changed

+40
-17
lines changed

2 files changed

+40
-17
lines changed

.travis.yml

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,28 @@ branches:
88
services:
99
- docker
1010

11-
#env:
12-
#global:
13-
#secure: X7BkOUOR2nt35IxLFFmpTPAVcgQ/SuSbuanXAheDj1tY4F+7MgEl/kDa+QV0mNG3EIvRhkY4+pmcBjgux8SF4MfPiFPD7XG7V0LPbHRWEWfzLIzJkVeErA8IAqwI0/IWQXEOOmQ9ElRygaKX1Tdot1piV99DSw+eGhtLnGIedKo=
14-
15-
#matrix:
16-
#include:
17-
#- os: linux
18-
#env: DISTRIB=ubuntu16.04
19-
#- os: linux
20-
#env: DISTRIB=debian9.4
21-
22-
23-
#script: docker build --tag $DISTRIB --build-arg JOB_NUMBER=$TRAVIS_JOB_NUMBER
24-
#-f ./Dockerfile-$DISTRIB .
25-
2611
jobs:
2712
include:
2813
- stage: test
14+
script: docker build --tag ubuntu18.04 --build-arg JOB_NUMBER=$TRAVIS_JOB_NUMBER -f ./Dockerfile-ubuntu18.04 . && docker run -t -d ubuntu18.04 && docker cp $(docker ps -n 1 -q):/usr/share/apps/qhttpserver/packages/ $HOME && ls $HOME/packages/
15+
before_deploy:
16+
git config --local user.name "Gael de Chalendar"
17+
git config --local user.email "[email protected]"
18+
git tag "$(git log --date=iso -1 | grep Date | sed -e 's/Date:\ *//' -e 's/\+.*//' -e 's/[- :]//g')-$(git log --format=%h --abbrev=8 -1)" || true
19+
deploy:
20+
provider: releases
21+
api_key:
22+
secure: $GITHUBKEY
23+
file_glob: true
24+
file: $HOME/packages/*.deb
25+
skip_cleanup: true
26+
on:
27+
repo: aymara/qhttpserver
28+
tags: false
29+
branches:
30+
except:
31+
- /^\d\d\d\d\d\d\d\d\d\d\d\d\d\d-[\da-f]+$/
32+
-
2933
script: docker build --tag ubuntu16.04 --build-arg JOB_NUMBER=$TRAVIS_JOB_NUMBER -f ./Dockerfile-ubuntu16.04 . && docker run -t -d ubuntu16.04 && docker cp $(docker ps -n 1 -q):/usr/share/apps/qhttpserver/packages/ $HOME && ls $HOME/packages/
3034
before_deploy:
3135
git config --local user.name "Gael de Chalendar"
@@ -34,7 +38,7 @@ jobs:
3438
deploy:
3539
provider: releases
3640
api_key:
37-
secure: F16J7J9a+VNEBwSiAksWxnF7c1M8Zg0+Tg8WGRRYy2p5aqR83Gj8/3M+SIPNw/Dzxj8+Sid1QkIZ42jISzoDKO3bJ0cX7ymqGy3bwqMMsue6l2TAa/heJKpaGroyLtjZRgD2pGtHigC8W1BOEz+5KhVBwWAYDF92TpluvyklGoA=
41+
secure: $GITHUBKEY
3842
file_glob: true
3943
file: $HOME/packages/*.deb
4044
skip_cleanup: true
@@ -53,7 +57,7 @@ jobs:
5357
deploy:
5458
provider: releases
5559
api_key:
56-
secure: F16J7J9a+VNEBwSiAksWxnF7c1M8Zg0+Tg8WGRRYy2p5aqR83Gj8/3M+SIPNw/Dzxj8+Sid1QkIZ42jISzoDKO3bJ0cX7ymqGy3bwqMMsue6l2TAa/heJKpaGroyLtjZRgD2pGtHigC8W1BOEz+5KhVBwWAYDF92TpluvyklGoA=
60+
secure: $GITHUBKEY
5761
file_glob: true
5862
file: $HOME/packages/*.deb
5963
skip_cleanup: true

Dockerfile-ubuntu18.04

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM ubuntu:18.04
2+
3+
# Setup
4+
RUN apt-get update -y -qq
5+
RUN apt-get install -y apt-utils wget bzip2 git gcc g++ cmake cmake-data ninja-build qt5-default qtbase5-dev-tools qtdeclarative5-dev -qq
6+
RUN mkdir -p /src/
7+
RUN git clone https://github.com/aymara/qhttpserver /src/qhttpserver
8+
9+
RUN mkdir -p /src/qhttpserver/build
10+
11+
# Build
12+
WORKDIR /src/qhttpserver/build
13+
RUN cmake -G Ninja -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release ..
14+
RUN ninja package
15+
RUN install -D /src/qhttpserver/build/qhttpserver-0.0.1-Linux.deb /usr/share/apps/qhttpserver/packages/qhttpserver-0.0.1-ubuntu16.04.deb
16+
17+
## install github-release to be able to deploy packages
18+
#RUN wget https://github.com/aktau/github-release/releases/download/v0.7.2/linux-amd64-github-release.tar.bz2 && tar xjf linux-amd64-github-release.tar.bz2 && cp bin/linux/amd64/github-release /usr/bin
19+

0 commit comments

Comments
 (0)