diff --git a/.dockerignore b/.dockerignore index c4b73b8b..71a71abb 100644 --- a/.dockerignore +++ b/.dockerignore @@ -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/ diff --git a/.travis.yml b/.travis.yml index ed6ab425..de40a709 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/Dockerfile b/Dockerfile index f09db6e1..303903b2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,7 +23,8 @@ # Start from the ubuntu:xenial image FROM ubuntu:xenial # owner -LABEL maintainer="phdofthehouse@gmail.com" +LABEL author="ThePhD " +LABEL maintainer="ThePhD " # We want our working directory to be the home directory WORKDIR /root diff --git a/scripts/build.linux.sh b/scripts/build.linux.sh new file mode 100644 index 00000000..32bf35b7 --- /dev/null +++ b/scripts/build.linux.sh @@ -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} diff --git a/scripts/preparation.linux.sh b/scripts/preparation.linux.sh index 7702ec07..e1f0d65d 100644 --- a/scripts/preparation.linux.sh +++ b/scripts/preparation.linux.sh @@ -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"