diff --git a/craft/pipeline-templates/appimage.pipeline b/craft/pipeline-templates/appimage.pipeline index 52b2840..09791bf 100644 --- a/craft/pipeline-templates/appimage.pipeline +++ b/craft/pipeline-templates/appimage.pipeline @@ -1,80 +1,80 @@ // 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( "Appimage" ) { // 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') { // Grab our tooling which we will need in a few moments checkout changelog: false, poll: false, scm: [ $class: 'GitSCM', branches: [[name: 'master']], extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'bf-tooling/']], userRemoteConfigs: [[url: 'https://anongit.kde.org/sysadmin/binary-factory-tooling']] ] // Make sure the Git checkouts are up to date sh """ python3 "$WORKSPACE/bf-tooling/craft/checkout-repository.py" --repository git://anongit.kde.org/craftmaster --into ~/Craft/BinaryFactory/ """ // Update Craft itself sh """ cd ~/Craft/BinaryFactory/ - python3 craftmaster/Craftmaster.py --config craftmaster/config/CraftBinaryCache.ini --target ${craftPlatform} -c ${craftOptions} -i craft + python3 craftmaster/Craftmaster.py --config craftmaster/config/CraftBinaryCache.ini --target ${craftPlatform} -c -i craft """ } 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/ python3 craftmaster/Craftmaster.py --config craftmaster/config/CraftBinaryCache.ini --target ${craftPlatform} -c ${craftOptions} ${craftProjectParams} --install-deps ${craftBuildBlueprint} """ } stage('Building') { // Actually build the application now sh """ cd ~/Craft/BinaryFactory/ python3 craftmaster/Craftmaster.py --config craftmaster/config/CraftBinaryCache.ini --target ${craftPlatform} -c ${craftOptions} --no-cache ${craftProjectParams} ${craftRebuildBlueprint} """ } stage('Packaging') { // Now generate the appimage for it sh """ cd ~/Craft/BinaryFactory/ // If Craft knew how to generate Appimages we could just run the below... //python3 craftmaster/Craftmaster.py --config craftmaster/config/CraftBinaryCache.ini --target ${craftPlatform} -c ${craftOptions} ${craftProjectParams} --package ${craftBuildBlueprint} // Instead we'll have to ask Craft to stage all the resources like it normally would, then we can run the necessary external tools to generate the appimage """ // Now copy it to the Jenkins workspace so it can be grabbed from there sh """ cd ~/Craft/BinaryFactory/ packageDir=\$(python3 "craftmaster/Craftmaster.py" --config "craftmaster/config/CraftBinaryCache.ini" --target ${craftPlatform} -c ${craftOptions} -q --get "packageDestinationDir()" virtual/base) cp -vf \$packageDir/* \$WORKSPACE/ """ } stage('Capturing Package') { // Then we ask Jenkins to capture the generated installers as an artifact archiveArtifacts artifacts: '*.appimage, *.sha256', onlyIfSuccessful: true } } } } diff --git a/craft/pipeline-templates/macos.pipeline b/craft/pipeline-templates/macos.pipeline index 180d407..de65852 100644 --- a/craft/pipeline-templates/macos.pipeline +++ b/craft/pipeline-templates/macos.pipeline @@ -1,103 +1,103 @@ // 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 we start with a clean slate deleteDir() // Grab our tooling which we will need in a few moments checkout changelog: false, poll: false, scm: [ $class: 'GitSCM', branches: [[name: 'master']], extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'bf-tooling/']], userRemoteConfigs: [[url: 'https://anongit.kde.org/sysadmin/binary-factory-tooling']] ] // Make sure the Git checkouts are up to date sh """ /usr/local/bin/python3 "$WORKSPACE/bf-tooling/craft/checkout-repository.py" --repository git://anongit.kde.org/craftmaster --into ~/Craft/BinaryFactory/ --branch stable """ // Update Craft itself sh """ cd ~/Craft/BinaryFactory/ - /usr/local/bin/python3 craftmaster/Craftmaster.py --config craftmaster/config/CraftBinaryCache.ini --target ${craftPlatform} -c ${craftOptions} -i craft + /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 ${craftOptions} -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 ${craftOptions} ${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 ${craftOptions} ${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 ${craftOptions} --no-cache ${craftProjectParams} ${craftRebuildBlueprint} """ } 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 ${craftOptions} ${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 ${craftOptions} -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() } } diff --git a/craft/pipeline-templates/win64.pipeline b/craft/pipeline-templates/win64.pipeline index 627e333..328b044 100644 --- a/craft/pipeline-templates/win64.pipeline +++ b/craft/pipeline-templates/win64.pipeline @@ -1,112 +1,112 @@ // 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( "WindowsMSVC" ) { // 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 we start with a clean slate deleteDir() // Grab our tooling which we will need in a few moments checkout changelog: false, poll: false, scm: [ $class: 'GitSCM', branches: [[name: 'master']], extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'bf-tooling/']], userRemoteConfigs: [[url: 'https://anongit.kde.org/sysadmin/binary-factory-tooling']] ] // Make sure that Craftmaster is up to date bat """ python "%WORKSPACE%\\bf-tooling\\craft\\checkout-repository.py" --repository git://anongit.kde.org/craftmaster --into "C:/Craft/BinaryFactory/" --branch stable """ // Update Craft itself and make sure NSIS is installed bat """ cd "C:\\Craft\\BinaryFactory\\" - python craftmaster/Craftmaster.py --config craftmaster/config/CraftBinaryCache.ini --target ${craftPlatform} -c ${craftOptions} -i craft + python craftmaster/Craftmaster.py --config craftmaster/config/CraftBinaryCache.ini --target ${craftPlatform} -c -i craft if errorlevel 1 exit /b %errorlevel% python craftmaster/Craftmaster.py --config craftmaster/config/CraftBinaryCache.ini --target ${craftPlatform} -c ${craftOptions} nsis if errorlevel 1 exit /b %errorlevel% """ } stage('Cleaning Up Prior Builds') { // Ensure we have nothing left behind in the packaging workspace used by Craft powershell """ cd "C:/Craft/BinaryFactory/" \$CRAFT_TMPDIR = python "craftmaster/Craftmaster.py" --config "craftmaster/config/CraftBinaryCache.ini" --target ${craftPlatform} -c ${craftOptions} -q --get "packageDestinationDir()" virtual/base rm "\$CRAFT_TMPDIR/*" """ // Make sure the build environment for this application is clean bat """ cd "C:\\Craft\\BinaryFactory\\" python craftmaster/Craftmaster.py --config craftmaster/config/CraftBinaryCache.ini --target ${craftPlatform} -c ${craftOptions} ${craftProjectParams} --unmerge ${craftRebuildBlueprint} if errorlevel 1 exit /b %errorlevel% """ } stage('Installing Dependencies') { // Ask Craftmaster to ensure all the dependencies are installed for this application we are going to be building bat """ cd "C:\\Craft\\BinaryFactory\\" python craftmaster/Craftmaster.py --config craftmaster/config/CraftBinaryCache.ini --target ${craftPlatform} -c ${craftOptions} ${craftProjectParams} --install-deps ${craftBuildBlueprint} if errorlevel 1 exit /b %errorlevel% """ } stage('Building') { // Actually build the application now bat """ cd "C:\\Craft\\BinaryFactory\\" python craftmaster/Craftmaster.py --config craftmaster/config/CraftBinaryCache.ini --target ${craftPlatform} -c ${craftOptions} --no-cache ${craftProjectParams} ${craftRebuildBlueprint} if errorlevel 1 exit /b %errorlevel% """ } stage('Packaging') { // Now generate an installer for it powershell """ cd "C:/Craft/BinaryFactory/" python craftmaster/Craftmaster.py --config craftmaster/config/CraftBinaryCache.ini --target ${craftPlatform} -c ${craftOptions} ${craftProjectParams} --package ${craftBuildBlueprint} if(\$LASTEXITCODE -ne 0) {exit \$LASTEXITCODE} if (\$${craftPackageAppx}) { python craftmaster/Craftmaster.py --config craftmaster/config/CraftBinaryCache.ini --target ${craftPlatform} -c ${craftOptions} --options "[Packager]PackageType=AppxPackager" ${craftProjectParams} --package ${craftBuildBlueprint} } if(\$LASTEXITCODE -ne 0) {exit \$LASTEXITCODE} """ // Copy it to the Jenkins workspace so it can be grabbed from there powershell """ cd "C:/Craft/BinaryFactory/" \$CRAFT_TMPDIR = python "craftmaster/Craftmaster.py" --config "craftmaster/config/CraftBinaryCache.ini" --target ${craftPlatform} -c ${craftOptions} -q --get "packageDestinationDir()" virtual/base copy "\$CRAFT_TMPDIR/*" "\$env:WORKSPACE" rm "\$CRAFT_TMPDIR/*" """ } stage('Capturing Package') { // Then we ask Jenkins to capture the generated installers as an artifact archiveArtifacts artifacts: '*.appx, *.exe, *.7z, *.sha256', onlyIfSuccessful: true } } // As the Windows Slaves are permanent ones, we erase the Workspace as the last thing we do deleteDir() } }