add conan docker image and build docker image only if changes where made in its config
This commit is contained in:
		@@ -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
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										12
									
								
								Docker/Linux_Conan/.gitlab-ci.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								Docker/Linux_Conan/.gitlab-ci.yml
									
									
									
									
									
										Normal 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/*
 | 
				
			||||||
							
								
								
									
										11
									
								
								Docker/Linux_Conan/Dockerfile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								Docker/Linux_Conan/Dockerfile
									
									
									
									
									
										Normal 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"]
 | 
				
			||||||
							
								
								
									
										23
									
								
								Docker/Linux_Conan/build.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								Docker/Linux_Conan/build.sh
									
									
									
									
									
										Normal 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
 | 
				
			||||||
		Reference in New Issue
	
	Block a user