Created
August 4, 2020 08:02
-
-
Save jeffyin1/15c92f45a3c6b317be585f238367d069 to your computer and use it in GitHub Desktop.
Jenkinsfile can execute specific unity in docker on node
This file contains hidden or 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 clientPath = "" | |
pipeline { | |
agent { | |
node { | |
label "${params.NODE_NAME}" | |
} | |
} | |
environment{ | |
CLIENT_BRANCH = "${params.CLIENT_BRANCH}" | |
PLATFORM = "${params.PLATFORM}" | |
GIT_SSH_KEY = credentials('auth') | |
GIT_SSH_COMMAND = "ssh -i \"${env.GIT_SSH_KEY}\"" | |
} | |
stages { | |
stage('Init') { | |
steps { | |
script { | |
clientPath = "client-${env.PLATFORM}" | |
} | |
} | |
} | |
stage('Checkout-Project') { | |
steps { | |
script { | |
// Implement Checkout repo by yourself | |
dir(clientPath) { | |
// ubuntu need to ignorecase | |
sh "git config --local core.ignorecase true" | |
} | |
} | |
} | |
} | |
stage('Build Assetbundle') { | |
agent { | |
docker { | |
reuseNode true | |
image "${params.DOCKER_FULLNAME}" | |
args '-u root --privileged' | |
} | |
} | |
steps { | |
dir(clientPath) { | |
sh "/opt/Unity/Editor/Unity -accept-apiupdate -nographics -quit -batchmode -silent-crashes -logFile -executeMethod MyProject.BuildAssetbundle -projectPath ./ -buildTarget ${env.PLATFORM}" | |
} | |
} | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment