Browse Source

New script for running dockerized build environment.

Yao Wei Tjong 姚伟忠 7 years ago
parent
commit
434dcafb9a
3 changed files with 111 additions and 1 deletions
  1. 72 0
      .env-file
  2. 2 1
      Rakefile
  3. 37 0
      script/dockerized.sh

+ 72 - 0
.env-file

@@ -0,0 +1,72 @@
+RPI
+WIN32
+WEB
+IOS
+TVOS
+URHO3D_64BIT
+URHO3D_ANGELSCRIPT
+URHO3D_LUA
+URHO3D_LUAJIT
+URHO3D_LUAJIT_AMALG
+URHO3D_SAFE_LUA
+URHO3D_LUA_RAW_SCRIPT_LOADER
+URHO3D_IK
+URHO3D_NETWORK
+URHO3D_PHYSICS
+URHO3D_NAVIGATION
+URHO3D_URHO2D
+URHO3D_PLAYER
+URHO3D_SAMPLES
+URHO3D_TOOLS
+URHO3D_EXTRAS
+URHO3D_DOCS
+URHO3D_DOCS_QUIET
+URHO3D_PCH
+URHO3D_DATABASE_ODBC
+URHO3D_DATABASE_SQLITE
+URHO3D_WEBP
+URHO3D_MMX
+URHO3D_3DNOW
+URHO3D_SSE
+URHO3D_MINIDUMPS
+URHO3D_FILEWATCHER
+URHO3D_HASH_DEBUG
+URHO3D_PACKAGING
+URHO3D_PROFILING
+URHO3D_LOGGING
+URHO3D_THREADING
+URHO3D_TESTING
+URHO3D_TEST_TIMEOUT
+URHO3D_OPENGL
+URHO3D_D3D11
+URHO3D_STATIC_RUNTIME
+URHO3D_WIN32_CONSOLE
+URHO3D_MACOSX_BUNDLE
+URHO3D_LIB_TYPE
+URHO3D_SCP_TO_TARGET
+URHO3D_UPDATE_SOURCE_TREE
+URHO3D_USE_LIB64_RPM
+URHO3D_USE_LIB_DEB
+URHO3D_HOME
+URHO3D_DEPLOYMENT_TARGET
+CMAKE_BUILD_TYPE
+CMAKE_INSTALL_PREFIX
+CMAKE_OSX_DEPLOYMENT_TARGET
+IPHONEOS_DEPLOYMENT_TARGET
+APPLETVOS_DEPLOYMENT_TARGET
+MINGW_PREFIX
+MINGW_SYSROOT
+RPI_PREFIX
+RPI_SYSROOT
+RPI_ABI
+ARM_PREFIX
+ARM_SYSROOT
+ARM_ABI_FLAGS
+EMSCRIPTEN_ROOT_PATH
+EMSCRIPTEN_SYSROOT
+EMSCRIPTEN_WASM
+EMSCRIPTEN_AUTO_SHELL
+EMSCRIPTEN_ALLOW_MEMORY_GROWTH
+EMSCRIPTEN_TOTAL_MEMORY
+EMSCRIPTEN_SHARE_DATA
+EMSCRIPTEN_EMRUN_BROWSER

+ 2 - 1
Rakefile

@@ -532,7 +532,8 @@ task :ci_site_update do
     puts "Updating source tree...\n\n"
     # Supply GIT credentials to push source tree changes to urho3d/Urho3D.git
     system 'git config user.name $GIT_NAME && git config user.email $GIT_EMAIL && git remote set-url --push origin https://[email protected]/$TRAVIS_REPO_SLUG.git'
-    system "git add Source && git commit -qm 'Travis CI: source tree update at #{Time.now.utc}.' >/dev/null 2>&1"   # Use extra quiet mode as there could be no changes at all
+    system %Q(grep -Pzo '(?s)\|Build Option.*?(?=\n\n)' Docs/GettingStarted.dox |tail -n +3 |cut -d'|' -f2 |tr -d [:blank:] >.env-file)
+    system "git add .build-options Source && git commit -qm 'Travis CI: source tree update at #{Time.now.utc}.' >/dev/null 2>&1"   # Use extra quiet mode as there could be no changes at all
     if /2008-([0-9]{4}) the Urho3D project/.match(File.read('Rakefile'))[1].to_i != Time.now.year
       # Automatically bump copyright when crossing a new year and give instruction to clear the cache if so since the cache is of no use anyway because of massive changes
       system "git add #{bump_copyright_year.join ' '} && if git commit -qm 'Travis CI: bump copyright to #{Time.now.year}.\n[cache clear]'; then git push origin HEAD:#{ENV['TRAVIS_BRANCH']} -q >/dev/null 2>&1 && echo Bumped copyright - Happy New Year!; fi" or abort "Failed to push copyright update for #{ENV['TRAVIS_BRANCH']}"

+ 37 - 0
script/dockerized.sh

@@ -0,0 +1,37 @@
+#!/usr/bin/env bash
+#
+# Copyright (c) 2008-2018 the Urho3D project.
+#
+# 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.
+#
+
+if [[ $# -eq 0 ]]; then echo "Usage: dockerized.sh native|mingw|android|rpi|arm"; exit 1; fi
+
+PROJECT_DIR=$(cd ${0%/*}/..; pwd)
+PLATFORM=$1; shift
+
+docker run -it --rm -h fishtank \
+    -e HOST_UID=$(id -u) -e HOST_GID=$(id -g) \
+    --env-file $PROJECT_DIR/.env-file \
+    --mount type=bind,source=$PROJECT_DIR,target=/project_dir \
+    --mount source=ccache_dir,target=/ccache_dir \
+    --name dockerized-$PLATFORM \
+    urho3d/dockerized-$PLATFORM $@
+
+# vi: set ts=4 sw=4 expandtab: