add conan docker image and build docker image only if changes where made in its config

This commit is contained in:
Lukas Heiligenbrunner 2020-10-31 21:07:34 +01:00
parent deb54c4f3a
commit 220275a617
4 changed files with 53 additions and 7 deletions

View File

@ -1,18 +1,18 @@
stages: include: '/Docker/Linux_Conan/.gitlab-ci.yml'
- conan
- cmake
- build
- post
- cleanup
image: conanio/gcc9:latest image: conanio/gcc9:latest
stages:
- docker
- build
- packageing
cache: cache:
paths: paths:
- .conan/ - .conan/
conan: conan:
stage: conan stage: build
script: script:
- export CONAN_USER_HOME=$PWD/.conan #define .conan folder to be inside of project - export CONAN_USER_HOME=$PWD/.conan #define .conan folder to be inside of project
- conan profile new default --detect --force # Generates default profile detecting GCC and sets old ABI - conan profile new default --detect --force # Generates default profile detecting GCC and sets old ABI

View File

@ -0,0 +1,12 @@
# trigger docker rebuild if chages where made
Linux_Conan:
stage: docker
image: docker:latest
services:
- docker:dind
script:
- docker build -t test .
only:
changes:
- Docker/Linux_Conan/*

View File

@ -0,0 +1,11 @@
FROM gcc:latest
ENV PATH=/usr/local/texlive/bin/x86_64-linuxmusl:$PATH
COPY ./build.sh /tmp/
RUN bash /tmp/build.sh
# Expose /home as workin dir
WORKDIR /home
VOLUME ["/home"]

View File

@ -0,0 +1,23 @@
#!/bin/bash
apt-get update
apt-get install cmake python3-pip -y -qq
pip3 install conan
git clone https://gitlab.heili.eu/lukas/dynuiprefresher.git
cd dynuiprefresher || exit
git checkout conansupport
conan profile new default --detect --force # Generates default profile detecting GCC and sets old ABI
conan profile update settings.compiler.libcxx=libstdc++11 default # Sets libcxx to C++11 ABI
conan remote add bintray https://api.bintray.com/conan/lheili/LibConfig --force
conan remote add bincrafters https://api.bintray.com/conan/bincrafters/public-conan --force
mkdir -p build # create build folder
CONAN_SYSREQUIRES_MODE=enabled CONAN_SYSREQUIRES_SUDO=0 conan install . --build=missing -g none
# cleanup
cd ..
rm -Rf ./dynuiprefresher
rm -rf /var/lib/apt/lists/*
rm /tmp/build.sh