Skip to content

Commit

Permalink
use azure pipelines for docker image building
Browse files Browse the repository at this point in the history
  • Loading branch information
therecipe committed Nov 7, 2018
1 parent 308a4f1 commit e36f161
Show file tree
Hide file tree
Showing 43 changed files with 307 additions and 239 deletions.
3 changes: 3 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
jobs:
-
template: internal/docker/docker_pipelines_template.yml
7 changes: 6 additions & 1 deletion internal/cmd/setup/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ func Test(target string, docker, vagrant bool, vagrantsystem string) {

"sailfish": []string{"listview", "listview_variant"},

"showcases": []string{"sia"},

"sql": []string{"masterdetail", "masterdetail_qml", "querymodel"},

"uitools": []string{"calculator"},
Expand Down Expand Up @@ -146,7 +148,10 @@ func Test(target string, docker, vagrant bool, vagrantsystem string) {
}

if (target == "js" || target == "wasm") &&
cat == "charts" || cat == "uitools" || cat == "sql" {
cat == "charts" || cat == "uitools" || cat == "sql" ||
cat == "androidextras" || cat == "qt3d" || cat == "webchannel" ||
(cat == "widgets" && strings.HasPrefix(example, "treeview")) ||
example == "video_player" {
continue
}

Expand Down
11 changes: 11 additions & 0 deletions internal/docker/docker_job_template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
jobs:
-
job: '${{ parameters.tag }}'
pool:
vmImage: ubuntu-16.04
dependsOn: '${{ parameters.dep }}'
steps:
-
script: 'docker build -f internal/docker/${{ parameters.file }} -t therecipe/qt:${{ parameters.tag }} .'
-
script: 'docker login -u therecipe -p $(DOCKER_PASSWORD) && docker push therecipe/qt:${{ parameters.tag }} && docker logout'
221 changes: 221 additions & 0 deletions internal/docker/docker_pipelines_template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,221 @@
jobs:
-
template: docker_job_template.yml
parameters:
file: android/Dockerfile
tag: android
dep: linux
-
template: docker_job_template.yml
parameters:
file: js/Dockerfile
tag: js
dep:
- js_base
- linux
-
template: docker_job_template.yml
parameters:
file: js/Dockerfile.base
tag: js_base
-
template: docker_job_template.yml
parameters:
file: js/Dockerfile.wasm
tag: wasm
dep:
- js_base
- linux
-
template: docker_job_template.yml
parameters:
file: linux/Dockerfile
tag: linux
-
template: docker_job_template.yml
parameters:
file: linux/Dockerfile.56
tag: linux_56
-
template: docker_job_template.yml
parameters:
file: linux/Dockerfile.59
tag: linux_59
-
template: docker_job_template.yml
parameters:
file: linux/Dockerfile.arch
tag: linux_arch
-
template: docker_job_template.yml
parameters:
file: linux/Dockerfile.ubuntu_16_04
tag: linux_ubuntu_16_04
-
template: docker_job_template.yml
parameters:
file: linux/Dockerfile.ubuntu_18_04
tag: linux_ubuntu_18_04
-
template: docker_job_template.yml
parameters:
file: sailfish/Dockerfile
tag: sailfish
-
template: docker_job_template.yml
parameters:
file: ubports/Dockerfile.64_vivid
tag: ubports_64_vivid
dep: linux
-
template: docker_job_template.yml
parameters:
file: ubports/Dockerfile.64_xenial
tag: ubports_64_xenial
dep: linux
-
template: docker_job_template.yml
parameters:
file: ubports/Dockerfile.arm_vivid
tag: ubports_arm_vivid
dep: linux
-
template: docker_job_template.yml
parameters:
file: ubports/Dockerfile.arm_xenial
tag: ubports_arm_xenial
dep: linux
-
template: docker_job_template.yml
parameters:
file: windows_32_shared/Dockerfile
tag: windows_32_shared
dep:
- windows_32_shared_base
- linux
-
template: docker_job_template.yml
parameters:
file: windows_32_shared/Dockerfile.base
tag: windows_32_shared_base
-
template: docker_job_template.yml
parameters:
file: windows_32_static/Dockerfile
tag: windows_32_static
dep:
- windows_32_static_base
- linux
-
template: docker_job_template.yml
parameters:
file: windows_32_static/Dockerfile.base
tag: windows_32_static_base
-
template: docker_job_template.yml
parameters:
file: windows_64_shared/Dockerfile
tag: windows_64_shared
dep:
- windows_64_shared_base
- linux
-
template: docker_job_template.yml
parameters:
file: windows_64_shared/Dockerfile.base
tag: windows_64_shared_base
-
template: docker_job_template.yml
parameters:
file: windows_64_static/Dockerfile
tag: windows_64_static
dep:
- windows_64_static_base
- linux
-
template: docker_job_template.yml
parameters:
file: windows_64_static/Dockerfile.base
tag: windows_64_static_base
-
template: docker_job_template.yml
parameters:
file: windows_legacy/Dockerfile.32_shared
tag: windows_32_shared_legacy
dep: linux
-
template: docker_job_template.yml
parameters:
file: windows_legacy/Dockerfile.32_static
tag: windows_32_static_legacy
dep: linux
-
template: docker_job_template.yml
parameters:
file: windows_legacy/Dockerfile.64_shared
tag: windows_64_shared_legacy
dep: linux
-
template: docker_job_template.yml
parameters:
file: windows_legacy/Dockerfile.64_static
tag: windows_64_static_legacy
dep: linux
-
template: docker_job_template.yml
parameters:
file: wine/Dockerfile
tag: windows_32_shared_wine
dep: wine_base
-
template: docker_job_template.yml
parameters:
file: wine/Dockerfile.32_shared
tag: windows_32_shared_msys2
dep: wine_base
-
template: docker_job_template.yml
parameters:
file: wine/Dockerfile.32_static
tag: windows_32_static_msys2
dep: wine_base
-
template: docker_job_template.yml
parameters:
file: wine/Dockerfile.56
tag: windows_32_shared_56
dep: wine_base
-
template: docker_job_template.yml
parameters:
file: wine/Dockerfile.56_xp
tag: windows_32_shared_56_xp
dep: wine_base_xp
-
template: docker_job_template.yml
parameters:
file: wine/Dockerfile.59
tag: windows_32_shared_59
dep: wine_base
-
template: docker_job_template.yml
parameters:
file: wine/Dockerfile.64_shared
tag: windows_64_shared_msys2
dep: wine_base
-
template: docker_job_template.yml
parameters:
file: wine/Dockerfile.64_static
tag: windows_64_static_msys2
dep: wine_base
-
template: docker_job_template.yml
parameters:
file: wine/Dockerfile.base
tag: wine_base
-
template: docker_job_template.yml
parameters:
file: wine/Dockerfile.base_xp
tag: wine_base_xp
6 changes: 3 additions & 3 deletions internal/docker/js/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ COPY --from=therecipe/qt:linux $GOPATH/bin $GOPATH/bin
COPY --from=therecipe/qt:linux $GOPATH/src/github.com/therecipe/qt $GOPATH/src/github.com/therecipe/qt
COPY --from=therecipe/qt:linux /opt/Qt/5.11.1/gcc_64/include /opt/Qt/5.11.1/gcc_64/include
COPY --from=therecipe/qt:linux /opt/Qt/Docs /opt/Qt/Docs
COPY --from=therecipe/qt:js_base_4 $HOME/emsdk $HOME/emsdk
COPY --from=therecipe/qt:js_base_4 $HOME/.emscripten $HOME/.emscripten
COPY --from=therecipe/qt:js_base_4 /usr/local/Qt-5.12.0 /usr/local/Qt-5.12.0
COPY --from=therecipe/qt:js_base $HOME/emsdk $HOME/emsdk
COPY --from=therecipe/qt:js_base $HOME/.emscripten $HOME/.emscripten
COPY --from=therecipe/qt:js_base /usr/local/Qt-5.12.0 /usr/local/Qt-5.12.0

RUN apt-get -qq update && apt-get --no-install-recommends -qq -y install git && apt-get -qq clean
RUN apt-get -qq update && apt-get --no-install-recommends -qq -y install python2.7 nodejs cmake default-jre && apt-get -qq clean
Expand Down
50 changes: 50 additions & 0 deletions internal/docker/js/Dockerfile.base
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
FROM ubuntu:16.04
LABEL maintainer therecipe

ENV USER user
ENV HOME /home/$USER

RUN apt-get -qq update && apt-get --no-install-recommends -qq -y install build-essential git

RUN apt-get -qq update && apt-get --no-install-recommends -qq -y install python2.7 nodejs cmake default-jre
RUN ln -s /usr/bin/python2.7 /usr/bin/python
RUN git clone https://github.com/juj/emsdk.git $HOME/emsdk && cd $HOME/emsdk && ./emsdk install latest && ./emsdk activate latest

RUN git clone -b 5.12.0 https://code.qt.io/qt/qtbase.git /opt/qtbase
RUN echo "#!/bin/bash\nsource $HOME/emsdk/emsdk_env.sh \
&& cd /opt/qtbase && ./configure -xplatform wasm-emscripten -nomake tests -nomake examples -confirm-license -opensource && make && make install" > $HOME/build.sh \
&& chmod +x $HOME/build.sh && $HOME/build.sh

RUN git clone -b 5.12.0 https://code.qt.io/qt/qtdeclarative.git /opt/qtdeclarative
RUN git clone -b 5.12.0 https://code.qt.io/qt/qtwebsockets.git /opt/qtwebsockets
RUN git clone -b 5.12.0 https://code.qt.io/qt/qtgraphicaleffects.git /opt/qtgraphicaleffects

RUN echo "#!/bin/bash\nsource $HOME/emsdk/emsdk_env.sh \
&& cd /opt/qtdeclarative && /usr/local/Qt-5.12.0/bin/qmake *.pro && make && make install \
&& cd /opt/qtwebsockets && /usr/local/Qt-5.12.0/bin/qmake *.pro && make && make install \
&& cd /opt/qtgraphicaleffects && /usr/local/Qt-5.12.0/bin/qmake *.pro && make && make install" > $HOME/build.sh \
&& chmod +x $HOME/build.sh && $HOME/build.sh

RUN git clone -b 5.12.0 https://code.qt.io/qt/qtquickcontrols.git /opt/qtquickcontrols
RUN git clone -b 5.12.0 https://code.qt.io/qt/qtquickcontrols2.git /opt/qtquickcontrols2
RUN git clone -b 5.12.0 https://code.qt.io/qt/qtsvg.git /opt/qtsvg

RUN echo "#!/bin/bash\nsource $HOME/emsdk/emsdk_env.sh \
&& cd /opt/qtquickcontrols && /usr/local/Qt-5.12.0/bin/qmake *.pro && make && make install \
&& cd /opt/qtquickcontrols2 && /usr/local/Qt-5.12.0/bin/qmake *.pro && make && make install\
&& cd /opt/qtsvg && /usr/local/Qt-5.12.0/bin/qmake *.pro && make && make install" > $HOME/build.sh \
&& chmod +x $HOME/build.sh && $HOME/build.sh

RUN git clone -b 5.12.0 https://code.qt.io/qt/qtcharts.git /opt/qtcharts
RUN git clone -b 5.12.0 https://code.qt.io/qt/qtxmlpatterns.git /opt/qtxmlpatterns
RUN git clone -b 5.12.0 https://code.qt.io/qt/qtcanvas3d.git /opt/qtcanvas3d
RUN git clone -b 5.12.0 https://code.qt.io/qt/qtdatavis3d.git /opt/qtdatavis3d
RUN git clone -b 5.12.0 https://code.qt.io/qt/qtmultimedia.git /opt/qtmultimedia

RUN echo "#!/bin/bash\nsource $HOME/emsdk/emsdk_env.sh \
&& cd /opt/qtcharts && /usr/local/Qt-5.12.0/bin/qmake *.pro && make && make install \
&& cd /opt/qtxmlpatterns && /usr/local/Qt-5.12.0/bin/qmake *.pro && make && make install \
&& cd /opt/qtcanvas3d && /usr/local/Qt-5.12.0/bin/qmake *.pro && make && make install \
&& cd /opt/qtdatavis3d && /usr/local/Qt-5.12.0/bin/qmake *.pro && make && make install \
&& cd /opt/qtmultimedia && /usr/local/Qt-5.12.0/bin/qmake *.pro && make && make install" > $HOME/build.sh \
&& chmod +x $HOME/build.sh && $HOME/build.sh
16 changes: 0 additions & 16 deletions internal/docker/js/Dockerfile.base_1

This file was deleted.

12 changes: 0 additions & 12 deletions internal/docker/js/Dockerfile.base_2

This file was deleted.

12 changes: 0 additions & 12 deletions internal/docker/js/Dockerfile.base_3

This file was deleted.

16 changes: 0 additions & 16 deletions internal/docker/js/Dockerfile.base_4

This file was deleted.

6 changes: 3 additions & 3 deletions internal/docker/js/Dockerfile.wasm
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ COPY --from=therecipe/qt:linux $GOPATH/bin $GOPATH/bin
COPY --from=therecipe/qt:linux $GOPATH/src/github.com/therecipe/qt $GOPATH/src/github.com/therecipe/qt
COPY --from=therecipe/qt:linux /opt/Qt/5.11.1/gcc_64/include /opt/Qt/5.11.1/gcc_64/include
COPY --from=therecipe/qt:linux /opt/Qt/Docs /opt/Qt/Docs
COPY --from=therecipe/qt:js_base_4 $HOME/emsdk $HOME/emsdk
COPY --from=therecipe/qt:js_base_4 $HOME/.emscripten $HOME/.emscripten
COPY --from=therecipe/qt:js_base_4 /usr/local/Qt-5.12.0 /usr/local/Qt-5.12.0
COPY --from=therecipe/qt:js_base $HOME/emsdk $HOME/emsdk
COPY --from=therecipe/qt:js_base $HOME/.emscripten $HOME/.emscripten
COPY --from=therecipe/qt:js_base /usr/local/Qt-5.12.0 /usr/local/Qt-5.12.0

RUN apt-get -qq update && apt-get --no-install-recommends -qq -y install python2.7 nodejs cmake default-jre && apt-get -qq clean
RUN ln -s /usr/bin/python2.7 /usr/bin/python
Expand Down
Loading

0 comments on commit e36f161

Please sign in to comment.