diff --git a/craft/pipeline-templates/macos.pipeline b/craft/pipeline-templates/macos.pipeline index 221eba5..43c3add 100644 --- a/craft/pipeline-templates/macos.pipeline +++ b/craft/pipeline-templates/macos.pipeline @@ -1,99 +1,99 @@ // Define the Craft target to use def craftPlatform = "macos-64-clang" // Sometimes we need to include additional parameters to Craft which are specific to the project def craftProjectParams = "" // Determine if we need to build a specific version of this project if( craftTarget != '' ) { // If we have a specified version (Craft target) then we need to pass this along to Craft craftProjectParams = "--target ${craftTarget}" } // Request a node to be allocated to us node( "macOS" ) { // We want Timestamps on everything timestamps { // We want to catch any errors that occur to allow us to send out notifications (ie. emails) if needed catchError { // First we want to make sure Craft is ready to go stage('Preparing Craft') { // Make sure the Git checkouts are up to date sh """ cd ~/Craft/BinaryFactory/craftmaster/ git pull cd ~/Craft/BinaryFactory/tooling/ git pull """ // Update Craft itself sh """ cd ~/Craft/BinaryFactory/ - /usr/local/bin/python3 craftmaster/Craftmaster.py --config craftmaster/config/CraftBinaryCache.ini --target ${craftPlatform} -c -i craft || exit /b + /usr/local/bin/python3 craftmaster/Craftmaster.py --config craftmaster/config/CraftBinaryCache.ini --target ${craftPlatform} -c -i craft """ } stage('Cleaning Up Prior Builds') { // Cleanup our workspace deleteDir() // Ensure we have nothing left behind in the packaging workspace used by Craft sh """ cd ~/Craft/BinaryFactory/ packageDir=\$(/usr/local/bin/python3 "craftmaster/Craftmaster.py" --config "craftmaster/config/CraftBinaryCache.ini" --target ${craftPlatform} -c -q --get "packageDestinationDir()" virtual/base) rm -rf "\$packageDir" """ // Make sure the build environment for this application is clean sh """ cd ~/Craft/BinaryFactory/ /usr/local/bin/python3 craftmaster/Craftmaster.py --config craftmaster/config/CraftBinaryCache.ini --target ${craftPlatform} -c ${craftProjectParams} --unmerge ${craftRebuildBlueprint} """ } stage('Installing Dependencies') { // Ask Craftmaster to ensure all the dependencies are installed for this application we are going to be building sh """ cd ~/Craft/BinaryFactory/ /usr/local/bin/python3 craftmaster/Craftmaster.py --config craftmaster/config/CraftBinaryCache.ini --target ${craftPlatform} -c ${craftProjectParams} --install-deps ${craftBuildBlueprint} """ } stage('Building') { // Actually build the application now sh """ cd ~/Craft/BinaryFactory/ /usr/local/bin/python3 craftmaster/Craftmaster.py --config craftmaster/config/CraftBinaryCache.ini --target ${craftPlatform} -c ${craftProjectParams} ${craftBuildBlueprint} """ } stage('Packaging') { // Now generate an installer for it sh """ cd ~/Craft/BinaryFactory/ /usr/local/bin/python3 craftmaster/Craftmaster.py --config craftmaster/config/CraftBinaryCache.ini --target ${craftPlatform} -c ${craftProjectParams} --package ${craftBuildBlueprint} """ // Now copy it to the Jenkins workspace so it can be grabbed from there sh """ cd ~/Craft/BinaryFactory/ packageDir=\$(/usr/local/bin/python3 "craftmaster/Craftmaster.py" --config "craftmaster/config/CraftBinaryCache.ini" --target ${craftPlatform} -c -q --get "packageDestinationDir()" virtual/base) cp -vf \$packageDir/ \$WORKSPACE/ rm -rf "\$packageDir" """ } stage('Capturing Package') { // Then we ask Jenkins to capture the generated installers as an artifact archiveArtifacts artifacts: '*.dmg, *.sha256', onlyIfSuccessful: true } } // As the Mac Slaves are permanent ones, we erase the Workspace as the last thing we do deleteDir() } }