Last active
April 24, 2024 16:49
-
-
Save mikolasan/eaaa2b55ddf75da024639c05c5fada32 to your computer and use it in GitHub Desktop.
Jenkins pipelines for Godot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Reference | |
// if you want LTO then the last supported emsdk = 3.1.18 https://github.com/godotengine/godot/issues/80010 | |
def dockerFile = ''' | |
FROM ubuntu:18.04 | |
RUN apt-get update && \ | |
apt-get install --assume-yes --quiet \ | |
build-essential \ | |
pkg-config \ | |
libx11-dev \ | |
libxcursor-dev \ | |
libxinerama-dev \ | |
libgl1-mesa-dev \ | |
libglu-dev \ | |
libasound2-dev \ | |
libpulse-dev \ | |
libfreetype6-dev \ | |
libssl-dev \ | |
libudev-dev \ | |
libxi-dev \ | |
libxrandr-dev \ | |
mingw-w64 \ | |
python3 \ | |
python3-pip \ | |
ca-certificates \ | |
openssl \ | |
python3-certifi | |
ARG EMSDK_VERSION=3.1.14 | |
ADD https://github.com/emscripten-core/emsdk/archive/refs/tags/${EMSDK_VERSION}.tar.gz /emsdk.tar.gz | |
RUN tar xf /emsdk.tar.gz | |
WORKDIR /emsdk-${EMSDK_VERSION} | |
# Download and install the latest SDK tools. | |
RUN ./emsdk install ${EMSDK_VERSION} | |
# Make the "latest" SDK "active" for the current user. (writes .emscripten file) | |
RUN ./emsdk activate ${EMSDK_VERSION} | |
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.6 3 && \ | |
update-alternatives --set python /usr/bin/python3.6 | |
RUN pip3 install scons==4.4.0 | |
''' | |
def entrypointFile = ''' | |
#!/bin/bash | |
# Activate PATH and other environment variables in the current terminal | |
source "/emsdk-3.1.14/emsdk_env.sh" | |
export SCRIPT_AES256_ENCRYPTION_KEY=$(<godot.gdkey) | |
scons "$@" | |
''' | |
def customPyFile = ''' | |
module_arkit_enabled = "no" | |
module_assimp_enabled = "no" | |
module_bmp_enabled = "no" | |
module_bullet_enabled = "no" | |
module_csg_enabled = "no" | |
module_dds_enabled = "no" | |
module_enet_enabled = "no" | |
module_etc_enabled = "no" | |
module_gdnative_enabled = "no" | |
module_gridmap_enabled = "no" | |
module_hdr_enabled = "no" | |
module_jsonrpc_enabled = "no" | |
module_mbedtls_enabled = "no" | |
module_mobile_vr_enabled = "no" | |
module_pvr_enabled = "no" | |
module_recast_enabled = "no" | |
module_regex_enabled = "no" | |
module_squish_enabled = "no" | |
module_svg_enabled = "no" | |
module_tga_enabled = "no" | |
module_theora_enabled = "no" | |
module_tinyexr_enabled = "no" | |
module_upnp_enabled = "no" | |
module_vhacd_enabled = "no" | |
module_webrtc_enabled = "no" | |
module_xatlas_unwrap_enabled = "no" | |
''' | |
def frontendImage | |
pipeline { | |
agent { label 'docker' } | |
stages { | |
stage('Checkout') { | |
steps { | |
git credentialsId: '***', branch: '3.5', url: 'git@bitbucket.org:***' | |
} | |
} | |
stage('Image') { | |
steps { | |
script { | |
writeFile file: 'Dockerfile', text: dockerFile | |
writeFile file: 'entrypoint.sh', text: entrypointFile | |
writeFile file: 'custom.py', text: customPyFile | |
writeFile file: 'godot.gdkey', text: '***' | |
sh 'chmod +x entrypoint.sh' | |
frontendImage = docker.build('mikolasan/godot:html5') | |
} | |
} | |
} | |
stage('Build') { | |
steps { | |
script { | |
frontendImage.inside("""-u root:root --entrypoint=''""") { | |
ansiColor('xterm') { | |
sh 'python --version' | |
sh 'python3 --version' | |
sh 'scons --version' | |
sh 'gcc --version' | |
sh 'rm -rf bin/' | |
sh ''' | |
bash ./entrypoint.sh \ | |
platform=javascript \ | |
tools=false \ | |
target=release \ | |
threads_enabled=yes \ | |
disable_3d=yes \ | |
use_lto=yes \ | |
verbose=yes warnings=all werror=yes debug_symbols=no | |
''' | |
} | |
} | |
} | |
} | |
} | |
stage('Archive') { | |
steps { | |
archiveArtifacts artifacts: 'bin/godot*', fingerprint: true, onlyIfSuccessful: true | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node { | |
stage 'Checkout' | |
git credentialsId: '***', branch: '3.5', url: 'git@bitbucket.org:***' | |
stage 'Build' | |
docker.image('mikolasan/godot').inside { | |
ansiColor('xterm') { | |
sh 'rm -rf bin/' | |
sh 'GD_BUILD_TYPE=editor ./build.sh' | |
// def build = "${env.GD_BUILD_TYPE}" | |
// if (build == 'ALL') { | |
// sh 'GD_BUILD_TYPE=editor ./build.sh' | |
// sh 'GD_BUILD_TYPE=templates ./build.sh' | |
// sh 'GD_BUILD_TYPE=server ./build.sh' | |
// } else { | |
// sh './build.sh' | |
// } | |
} | |
} | |
stage 'Archive' | |
archiveArtifacts artifacts: 'bin/godot*', fingerprint: true, onlyIfSuccessful: true | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def dockerFile = $/ | |
FROM ubuntu:18.04 | |
RUN apt-get update && \ | |
apt-get install -y software-properties-common | |
RUN add-apt-repository ppa:ubuntu-toolchain-r/test | |
RUN apt-get update && \ | |
apt-get install --assume-yes --quiet \ | |
build-essential \ | |
g++-11 \ | |
scons \ | |
pkg-config \ | |
libx11-dev \ | |
libxcursor-dev \ | |
libxinerama-dev \ | |
libgl1-mesa-dev \ | |
libglu-dev \ | |
libasound2-dev \ | |
libpulse-dev \ | |
libfreetype6-dev \ | |
libssl-dev \ | |
libudev-dev \ | |
libxi-dev \ | |
libxrandr-dev \ | |
mingw-w64 | |
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 7 && \ | |
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 7 && \ | |
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 11 && \ | |
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 11 && \ | |
update-alternatives --set gcc /usr/bin/gcc-11 && \ | |
update-alternatives --set g++ /usr/bin/g++-11 | |
RUN sed "s/\/usr\/bin\/python/\/usr\/bin\/python3/" -i `which scons` | |
/$ | |
def frontendImage | |
pipeline { | |
agent { label 'docker' } | |
stages { | |
stage('Checkout') { | |
steps { | |
git credentialsId: '***', branch: '4.1', url: 'git@bitbucket.org:***' | |
} | |
} | |
stage('Image') { | |
steps { | |
dir('docker') { | |
script { | |
writeFile file: 'Dockerfile', text: dockerFile | |
frontendImage = docker.build('mikolasan/godot4') | |
} | |
} | |
} | |
} | |
stage('Build') { | |
steps { | |
script { | |
frontendImage.inside { | |
ansiColor('xterm') { | |
sh 'python --version' | |
sh 'python3 --version' | |
sh 'scons --version' | |
sh 'gcc --version' | |
sh 'rm -rf bin/' | |
sh 'export CC=/usr/bin/gcc-11; export CXX=/usr/bin/g++-11; scons platform=linuxbsd target=editor arch=x86_64 lto=full' | |
} | |
} | |
} | |
} | |
} | |
stage('Archive') { | |
steps { | |
archiveArtifacts artifacts: 'bin/godot*', fingerprint: true, onlyIfSuccessful: true | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def dockerFile = ''' | |
FROM ubuntu:18.04 | |
RUN apt-get update && \ | |
apt-get install --assume-yes --quiet build-essential scons pkg-config libx11-dev libxcursor-dev libxinerama-dev \ | |
libgl1-mesa-dev libglu-dev libasound2-dev libpulse-dev libfreetype6-dev libssl-dev libudev-dev \ | |
libxi-dev libxrandr-dev \ | |
mingw-w64 | |
''' | |
def frontendImage | |
pipeline { | |
agent { label 'docker' } | |
stages { | |
stage('Checkout') { | |
steps { | |
git credentialsId: '***', branch: '3.5', url: 'git@bitbucket.org:***' | |
} | |
} | |
stage('Image') { | |
steps { | |
dir('docker') { | |
script { | |
writeFile file: 'Dockerfile', text: dockerFile | |
frontendImage = docker.build('mikolasan/godot') | |
} | |
} | |
} | |
} | |
stage('Build') { | |
steps { | |
script { | |
frontendImage.inside { | |
ansiColor('xterm') { | |
sh 'rm -rf bin/' | |
sh 'GD_BUILD_TYPE=templates ./build.sh' | |
} | |
} | |
} | |
} | |
} | |
stage('Archive') { | |
steps { | |
archiveArtifacts artifacts: 'bin/godot*', fingerprint: true, onlyIfSuccessful: true | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def dockerFile = ''' | |
FROM ubuntu:18.04 | |
RUN apt-get update && \ | |
apt-get install --assume-yes --quiet build-essential scons pkg-config libx11-dev libxcursor-dev libxinerama-dev \ | |
libgl1-mesa-dev libglu-dev libasound2-dev libpulse-dev libfreetype6-dev libssl-dev libudev-dev \ | |
libxi-dev libxrandr-dev \ | |
mingw-w64 | |
RUN update-alternatives --set x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix | |
RUN update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix | |
''' | |
def frontendImage | |
pipeline { | |
agent { label 'docker' } | |
stages { | |
stage('Checkout') { | |
steps { | |
git credentialsId: '***', branch: '3.5', url: 'git@bitbucket.org:***' | |
} | |
} | |
stage('Image') { | |
steps { | |
dir('docker') { | |
script { | |
writeFile file: 'Dockerfile', text: dockerFile | |
frontendImage = docker.build('mikolasan/godot') | |
} | |
} | |
} | |
} | |
stage('Build') { | |
steps { | |
script { | |
frontendImage.inside { | |
ansiColor('xterm') { | |
sh 'rm -rf bin/' | |
sh 'GD_BUILD_TYPE=windows-templates ./build.sh' | |
} | |
} | |
} | |
} | |
} | |
stage('Archive') { | |
steps { | |
archiveArtifacts artifacts: 'bin/godot*', fingerprint: true, onlyIfSuccessful: true | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment