prepare a cycling build script and all... let's see how well this works

This commit is contained in:
ThePhD 2018-01-08 00:02:36 -05:00
parent 44e87cedda
commit 866ff08165
5 changed files with 83 additions and 97 deletions

View File

@ -20,94 +20,8 @@
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# Python (Bytecode)
*.pyc
# Ignore literally everything
**
# ninja files
*.ninja
# Visual Studio
*.props
*.user
.vs/
Debug/
Release/
x64/
x86/
*.pyproj
*.vcxproj
*.vcxproj.filters
*.tlog
*.lastbuildstate
*.idb
*.sln
*.gitattributes
# VSCode
.vscode/
# CMake
build/
build-sol2/
CMakeCache.txt
CMakeFiles/
# Compiler outputs
obj/*
bin/*
main.exe
main.o
lua53.dll
lua-5.3.4.dll
main.ilk
main.pdb
# Dropbox interference
.dropbox*
# QtCreator
*.creator.user.*
*.config
*.creator
*.files
*.includes
# Scratchpad Files
m.lua
catch_mock.hpp
main_aux.cpp
main.hpp
main2.cpp
main.cpp
# Local Lua Testbeds
lua-5.3.4-cxx/
lua-5.3.4/
lua-5.3.2/
lua-5.3.1/
lua-5.3.0/
lua-5.2.4/
lua-5.2.2/
lua-5.2.3/
lua-5.1.5/
LuaJIT-2.1.0/
luajit-2.0.5/
luajit-2.0.3/
include/
liblua.a
lib/liblua5.2.a
# Docs Artefacts
docs/build/
# Sublime Text
*.sublime-workspace
*.sublime-project
# Windows Crap
desktop.ini
*.db
# Miscellaneous
external/
# Except the script directory
!scripts/

View File

@ -34,7 +34,7 @@ before_install:
script:
- sudo docker image pull ThePhD/sol2:gcc-${GCC_VERSION}_llvm-${LLVM_VERSION}
- sudo docker run --rm --name "sol2.test" --tty --env "CI=${CI}" --env "LUA_VERSION=${LUA_VERSION}" --env "GCC_VERSION=${GCC_VERSION}" --env "LLVM_VERSION=${LLVM_VERSION}" sol2:gcc-${GCC_VERSION}_llvm-${LLVM_VERSION}
- sudo docker run --rm --tty --name "sol2.test" --env "CI=${CI}" --env "LUA_VERSION=${LUA_VERSION}" --env "GCC_VERSION=${GCC_VERSION}" --env "LLVM_VERSION=${LLVM_VERSION}" sol2:gcc-${GCC_VERSION}_llvm-${LLVM_VERSION}
- sudo docker rm $(sudo docker ps -a -q)
- sudo docker rmi $(sudo docker image ls -q)
@ -72,7 +72,7 @@ env:
ALLOW_FAILURE=true
- LUA_VERSION=5.3.4
LLVM_VERSION=3.9.0
LLVM_VERSION=3.9.1
CI=true
ALLOW_FAILURE=true

View File

@ -23,7 +23,8 @@
# Start from the ubuntu:xenial image
FROM ubuntu:xenial
# owner
LABEL maintainer="phdofthehouse@gmail.com"
LABEL author="ThePhD <phdofthehouse@gmail.com>"
LABEL maintainer="ThePhD <phdofthehouse@gmail.com>"
# We want our working directory to be the home directory
WORKDIR /root

71
scripts/build.linux.sh Normal file
View File

@ -0,0 +1,71 @@
#!/usr/bin/env zsh
# # # # sol2
# The MIT License (MIT)
#
# Copyright (c) 2013-2017 Rapptz, ThePhD, and contributors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
# the Software, and to permit persons to whom the Software is furnished to do so,
# subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
CI=true
declare -a gcc_versions
gcc_versions=(
7
6
5
4.9
)
declare -r gcc_versions
declare -a llvm_versions
llvm_versions=(
3.6.2
3.7.1
3.8.1
3.9.1
4.0.1
5.0.1
)
declare -r llvm_versions
if [ -z "${DOCKER_USERNAME}" ]
then
docker_username=
else
docker_username=${DOCKER_USERNAME}/
fi
for i in $gcc_versions; do
GCC_VERSION=$i
unset LLVM_VERSION
docker build --tag ${docker_username}sol2:gcc-${GCC_VERSION}_llvm-${LLVM_VERSION} --build-arg GCC_VERSION=${GCC_VERSION} --build-arg LLVM_VERSION=${LLVM_VERSION} --build-arg CI=${CI} "${SOL2_DIR}"
docker push ${docker_username}sol2:gcc-${GCC_VERSION}_llvm-${LLVM_VERSION}
done
for i in $llvm_versions; do
LLVM_VERSION=$i
unset GCC_VERSION
docker build --tag ${docker_username}sol2:gcc-${GCC_VERSION}_llvm-${LLVM_VERSION} --build-arg GCC_VERSION=${GCC_VERSION} --build-arg LLVM_VERSION=${LLVM_VERSION} --build-arg CI=${CI} "${SOL2_DIR}"
docker push ${docker_username}sol2:gcc-${GCC_VERSION}_llvm-${LLVM_VERSION}
done
unset LLVM_VERSION
unset GCC_VERSION
docker build --tag ${docker_username}sol2:gcc-${GCC_VERSION}_llvm-${LLVM_VERSION} --build-arg GCC_VERSION=${GCC_VERSION} --build-arg LLVM_VERSION=${LLVM_VERSION} --build-arg CI=${CI} "${SOL2_DIR}"
docker push ${docker_username}sol2:gcc-${GCC_VERSION}_llvm-${LLVM_VERSION}

View File

@ -49,16 +49,16 @@ then
download_version=16.04
#sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
#sudo apt-get -y update
if [ $major -le 3 ]
if [ ${major} -le 3 ]
then
if [ $minor -le 8 ] && [ $minor -ge 5 ];
if [ ${major} -eq 3 ] && [ ${minor} -le 8 ] && [ ${minor} -ge 5 ];
then
download_llvm=false
download_version=16.04
apt-get -y install clang-3.${minor}
export CC=clang-3.${minor}
export CXX=clang++-3.${minor}
elif [ $minor -le 4 ]
elif [ ${minor} -le 4 ]
then
download_llvm=true
download_version=14.04
@ -67,7 +67,7 @@ then
if [ ${download_llvm} = true ]
then
export LLVM_ARCHIVE_PATH=${build_dir}/clang+llvm.tar.xz
export CLANG_PREFIX=${build_dir}/clang-$LLVM_VERSION
export CLANG_PREFIX=${build_dir}/clang-${LLVM_VERSION}
export PATH=$CLANG_PREFIX/bin:$PATH
export LD_LIBRARY_PATH=$CLANG_PREFIX/lib:$LD_LIBRARY_PATH
echo "export LLVM_ARCHIVE_PATH=${build_dir}/clang+llvm.tar.xz\nexport CLANG_PREFIX=${build_dir}/clang-$LLVM_VERSION\nexport PATH=$CLANG_PREFIX/bin:$PATH\nexport LD_LIBRARY_PATH=$CLANG_PREFIX/lib:$LD_LIBRARY_PATH\n" >> "sol2.compiler.vars"