From 251a621a5d6b26f85295cb810a6b7e091f625d1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Otter?= Date: Tue, 11 Mar 2025 21:47:57 +0100 Subject: [PATCH 1/9] Fix removing trailing Slashes --- Build Automation.xojo_code | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Build Automation.xojo_code b/Build Automation.xojo_code index ed66213..6d2536a 100644 --- a/Build Automation.xojo_code +++ b/Build Automation.xojo_code @@ -68,7 +68,7 @@ Var sPROJECT_PATH As String = DoShellCommand("echo $PROJECT_PATH", 0).Trim If sPROJECT_PATH.Right(1) = "/" Then 'no trailing / - sPROJECT_PATH = sPROJECT_PATH.Middle(1, sPROJECT_PATH.Length - 1) + sPROJECT_PATH = sPROJECT_PATH.Left(sPROJECT_PATH.Length - 1) End If Var sBUILD_LOCATION As String = CurrentBuildLocation.ReplaceAll("\", "") 'don't escape Path Var sBUILD_APPNAME As String = CurrentBuildAppName @@ -185,7 +185,7 @@ Var sPROJECT_PATH As String = DoShellCommand("echo $PROJECT_PATH", 0).Trim If sPROJECT_PATH.Right(1) = "/" Then 'no trailing / - sPROJECT_PATH = sPROJECT_PATH.Middle(1, sPROJECT_PATH.Length - 1) + sPROJECT_PATH = sPROJECT_PATH.Left(sPROJECT_PATH.Length - 1) End If Var sBUILD_LOCATION As String = CurrentBuildLocation.ReplaceAll("\", "") 'don't escape Path Var sBUILD_APPNAME As String = CurrentBuildAppName @@ -329,11 +329,11 @@ Var sPROJECT_PATH As String = DoShellCommand("echo $PROJECT_PATH", 0).Trim If sPROJECT_PATH.Right(1) = "/" Then 'No trailing / - sPROJECT_PATH = sPROJECT_PATH.Middle(1, sPROJECT_PATH.Length-1) + sPROJECT_PATH = sPROJECT_PATH.Left(sPROJECT_PATH.Length - 1) End If Var sBUILD_LOCATION As String = CurrentBuildLocation.ReplaceAll("\", "") 'don't escape Path Var sBUILD_APPNAME As String = CurrentBuildAppName 'Xojo 2022r1 adds .app - If (sBUILD_APPNAME.Right(4) = ".app") Then sBUILD_APPNAME = sBUILD_APPNAME.Left(sBUILD_APPNAME.Length-4) + If (sBUILD_APPNAME.Right(4) = ".app") Then sBUILD_APPNAME = sBUILD_APPNAME.Left(sBUILD_APPNAME.Length - 4) If (sBUILD_LOCATION.Right(9) = "Universal") Then 'Xojo does not add the folder of the Console/Web App in Universal Builds to the Constant :( @@ -489,7 +489,7 @@ Var sPROJECT_PATH As String = DoShellCommand("echo $PROJECT_PATH", 0).Trim If sPROJECT_PATH.Right(1) = "/" Then 'no trailing / - sPROJECT_PATH = sPROJECT_PATH.Middle(1, sPROJECT_PATH.Length - 1) + sPROJECT_PATH = sPROJECT_PATH.Left(sPROJECT_PATH.Length - 1) End If Var sBUILD_LOCATION As String = CurrentBuildLocation.ReplaceAll("\", "") 'don't escape Path Var sBUILD_APPNAME As String = CurrentBuildAppName From 1b777940edbf0017158ff40cd48e51bc2dd99db4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Otter?= Date: Tue, 11 Mar 2025 21:51:37 +0100 Subject: [PATCH 2/9] Update Windows - CreateZIP --- Build Automation.xojo_code | 113 ++++++++++++++++++++++++------------- 1 file changed, 74 insertions(+), 39 deletions(-) diff --git a/Build Automation.xojo_code b/Build Automation.xojo_code index 6d2536a..3d498dc 100644 --- a/Build Automation.xojo_code +++ b/Build Automation.xojo_code @@ -445,70 +445,105 @@ FolderItem = Li4vc2NyaXB0cy9MYXVuY2guYmF0 End Begin IDEScriptBuildStep CreateZIP , AppliesTo = 2, Architecture = 0, Target = 0 - '****************************** - 'Create .zip for Windows Builds - '****************************** + '************************************************** + ' Create .zip for Windows Builds + '************************************************** - 'Post Build Script is for Builds on macOS - If (Not TargetMacOS) Then + If DebugBuild Then Return 'don't create .zip for DebugRuns + + ' bSILENT=True : don't show any error messages + Var bSILENT As Boolean = False + + 'Check Build Target + Select Case CurrentBuildTarget + Case 3 'Windows (Intel, 32Bit) + Case 19 'Windows (Intel, 64Bit) + Case 25 'Windows(ARM, 64Bit) + Else + If (Not bSILENT) Then Print "CreateZIP: Unsupported Build Target" Return + End Select + + 'Xojo Project Settings + Var sPROJECT_PATH As String + Var sBUILD_LOCATION As String = CurrentBuildLocation + Var sAPP_NAME As String = CurrentBuildAppName + If (sAPP_NAME.Right(4) = ".exe") Then + sAPP_NAME = sAPP_NAME.Left(sAPP_NAME.Length - 4) + End If + Var sCHAR_FOLDER_SEPARATOR As String + If TargetWindows Then 'Xojo IDE is running on Windows + sPROJECT_PATH = DoShellCommand("echo %PROJECT_PATH%", 0).Trim + sCHAR_FOLDER_SEPARATOR = "\" + ElseIf TargetMacOS Or TargetLinux Then 'Xojo IDE running on macOS or Linux + sPROJECT_PATH = DoShellCommand("echo $PROJECT_PATH", 0).Trim + If sPROJECT_PATH.Right(1) = "/" Then + 'no trailing / + sPROJECT_PATH = sPROJECT_PATH.Left(sPROJECT_PATH.Length - 1) + End If + If sBUILD_LOCATION.Right(1) = "/" Then + 'no trailing / + sBUILD_LOCATION = sBUILD_LOCATION.Left(sBUILD_LOCATION.Length - 1) + End If + sBUILD_LOCATION = sBUILD_LOCATION.ReplaceAll("\", "") 'don't escape Path + sCHAR_FOLDER_SEPARATOR = "/" End If - 'Check Build - If DebugBuild Then + If (sPROJECT_PATH = "") Then + If (Not bSILENT) Then Print "CreateZIP: Could not get the Environment Variable PROJECT_PATH from the Xojo IDE." + EndOfLine + EndOfLine + "Unfortunately, it's empty.... try again after re-launching the Xojo IDE and/or rebooting your machine." Return End If - 'Check Stage Code - Var sStageCodeInfo As String + 'Check Stage Code for ZIP Filename + Var sSTAGECODE_SUFFIX As String Select Case PropertyValue("App.StageCode") Case "0" 'Development - sStageCodeInfo = "-dev" + sSTAGECODE_SUFFIX = "-dev" Case "1" 'Alpha - sStageCodeInfo = "-alpha" + sSTAGECODE_SUFFIX = "-alpha" Case "2" 'Beta - sStageCodeInfo = "-beta" + sSTAGECODE_SUFFIX = "-beta" Case "3" 'Final 'not used in filename End Select - 'Check Build Target - Var sZIPFilename As String + 'Build ZIP Filename + Var sZIP_FILENAME As String Select Case CurrentBuildTarget Case 3 'Windows (Intel, 32Bit) - sZIPFilename = "cubeSQLWebAdmin" + sStageCodeInfo + "_Windows_Intel_32Bit.zip" + sZIP_FILENAME = sAPP_NAME.ReplaceAll(" ", "_") + sSTAGECODE_SUFFIX + "_Windows_Intel_32Bit.zip" Case 19 'Windows (Intel, 64Bit) - sZIPFilename = "cubeSQLWebAdmin" + sStageCodeInfo + "_Windows_Intel_64Bit.zip" + sZIP_FILENAME = sAPP_NAME.ReplaceAll(" ", "_") + sSTAGECODE_SUFFIX + "_Windows_Intel_64Bit.zip" Case 25 'Windows(ARM, 64Bit) - sZIPFilename = "cubeSQLWebAdmin" + sStageCodeInfo + "_Windows_ARM_64Bit.zip" + sZIP_FILENAME = sAPP_NAME.ReplaceAll(" ", "_") + sSTAGECODE_SUFFIX + "_Windows_ARM_64Bit.zip" Else Return End Select - 'Xojo Project Settings - Var sPROJECT_PATH As String = DoShellCommand("echo $PROJECT_PATH", 0).Trim - If sPROJECT_PATH.Right(1) = "/" Then - 'no trailing / - sPROJECT_PATH = sPROJECT_PATH.Left(sPROJECT_PATH.Length - 1) + 'Create .zip + Var sPATH_PARTS() As String = sBUILD_LOCATION.Split(sCHAR_FOLDER_SEPARATOR) + Var sAPP_FOLDERNAME As String = sPATH_PARTS(sPATH_PARTS.LastIndex) + sPATH_PARTS.RemoveAt(sPATH_PARTS.LastIndex) + Var sFOLDER_BASE As String = String.FromArray(sPATH_PARTS, sCHAR_FOLDER_SEPARATOR) + + If TargetWindows Then 'Xojo IDE is running on Windows + Var sPOWERSHELL_COMMAND As String = "cd """ + sFOLDER_BASE + """; Compress-Archive -Path .\* -DestinationPath ""..\" + sZIP_FILENAME + """ -Force" + Var iPOWERSHELL_RESULT As Integer + Var sPOWERSHELL_OUTPUT As String = DoShellCommand("powershell -command """ + sPOWERSHELL_COMMAND.ReplaceAll("""", "'") + """", 0, iPOWERSHELL_RESULT) + If (iPOWERSHELL_RESULT <> 0) Then + If (Not bSILENT) Then Print "CreateZIP Error" + EndOfLine + EndOfLine + _ + sPOWERSHELL_OUTPUT.Trim + EndOfLine + _ + "[ExitCode: " + iPOWERSHELL_RESULT.ToString + "]" + End If + ElseIf TargetMacOS Or TargetLinux Then 'Xojo IDE running on macOS or Linux + Var iZIP_RESULT As Integer + Var sZIP_OUTPUT As String = DoShellCommand("cd """ + sFOLDER_BASE + """ && zip -r ""../" + sZIP_FILENAME + """ ""./" + sAPP_FOLDERNAME + """", 0, iZIP_RESULT) + If (iZIP_RESULT <> 0) Then + If (Not bSILENT) Then Print "CreateZIP Error" + EndOfLine + EndOfLine + _ + sZIP_OUTPUT.Trim + EndOfLine + _ + "[ExitCode: " + iZIP_RESULT.ToString + "]" End If - Var sBUILD_LOCATION As String = CurrentBuildLocation.ReplaceAll("\", "") 'don't escape Path - Var sBUILD_APPNAME As String = CurrentBuildAppName - - If (sPROJECT_PATH = "") Then - Print "Xojo PostBuild Script CreateZIP requires to get the Environment Variable $PROJECT_PATH from the Xojo IDE." + EndOfLine + EndOfLine + "Unfortunately, it's empty.... try again after re-launching the Xojo IDE and/or rebooting your machine." - Return End If - - 'Make sure the ShellScripts are executable: - Call DoShellCommand("chmod 755 """ + sBUILD_LOCATION + "/Launch.sh""", 0) - - 'Create .zip - Var pathParts() As String = sBUILD_LOCATION.Split("/") - Var foldernameApp As String = pathParts(pathParts.LastIndex) - pathParts.RemoveAt(pathParts.LastIndex) - Var baseFolder As String = String.FromArray(pathParts, "/") - - Call DoShellCommand("cd """ + baseFolder + """ && zip -r ../" + sZIPFilename + " ./" + foldernameApp, 0) End End From a1c16a61edcbca0563fb5b7adc989773ee0d7073 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Otter?= Date: Tue, 11 Mar 2025 21:54:50 +0100 Subject: [PATCH 3/9] macOS Xojo2PKG: no hardcoded PKG filename --- Build Automation.xojo_code | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Build Automation.xojo_code b/Build Automation.xojo_code index 3d498dc..a8edf9f 100644 --- a/Build Automation.xojo_code +++ b/Build Automation.xojo_code @@ -359,11 +359,11 @@ Var sPKG_FILENAME As String Select Case CurrentBuildTarget Case 16 'macOS: Intel 64Bit - sPKG_FILENAME = "cubeSQLWebAdmin" + sStageCodeInfo + "_macOS_Intel_64Bit.pkg" + sPKG_FILENAME = sBUILD_APPNAME + sStageCodeInfo + "_macOS_Intel_64Bit.pkg" Case 24 'macOS: ARM 64Bit - sPKG_FILENAME = "cubeSQLWebAdmin" + sStageCodeInfo + "_macOS_ARM_64Bit.pkg" + sPKG_FILENAME = sBUILD_APPNAME + sStageCodeInfo + "_macOS_ARM_64Bit.pkg" Case 9 'macOS: Universal (Intel 64Bit, ARM 64Bit) - sPKG_FILENAME = "cubeSQLWebAdmin" + sStageCodeInfo + "_macOS_Universal.pkg" + sPKG_FILENAME = sBUILD_APPNAME + sStageCodeInfo + "_macOS_Universal.pkg" Else Return End Select From 6cc5ccbb22c7d59ea42297deb7dc45eae545ab82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Otter?= Date: Tue, 11 Mar 2025 21:56:41 +0100 Subject: [PATCH 4/9] Add Windows - Azure Trusted Signing --- Build Automation.xojo_code | 150 +++++++++++++++++++++++++++++++++++++ 1 file changed, 150 insertions(+) diff --git a/Build Automation.xojo_code b/Build Automation.xojo_code index a8edf9f..028a3f1 100644 --- a/Build Automation.xojo_code +++ b/Build Automation.xojo_code @@ -444,6 +444,156 @@ Subdirectory = FolderItem = Li4vc2NyaXB0cy9MYXVuY2guYmF0 End + Begin IDEScriptBuildStep AzureTrustedSigning , AppliesTo = 2, Architecture = 0, Target = 0 + '************************************************** + ' CodeSign | Azure Trusted Signing | Docker + '************************************************** + ' https://github.com/jo-tools/ats-codesign + '************************************************** + ' Requirements + '************************************************** + ' 1. Set up Azure Trusted Signing + ' 2. Have Docker up and running + ' 3. Read the comments in this Post Build Script, + ' 4. Modify it according to your needs. + ' + ' Especially look out for sDOCKER_EXE + ' You might need to set the full path to the executable + '************************************************** + ' 5. If it's working for you: + ' Do you like it? Does it help you? Has it saved you time and money? + ' You're welcome - it's free... + ' If you want to say thanks I appreciate a message or a small donation. + ' Contact: xojo@jo-tools.ch + ' PayPal: https://paypal.me/jotools + '************************************************** + + '************************************************** + ' Note: Xojo IDE running on Linux + '************************************************** + ' Make sure that docker can be run without requiring 'sudo': + ' More information e.g. in this article: + ' https://medium.com/devops-technical-notes-and-manuals/how-to-run-docker-commands-without-sudo-28019814198f + ' 1. sudo groupadd docker + ' 2. sudo gpasswd -a $USER docker + ' 3. (reboot) + '************************************************** + + If DebugBuild Then Return 'don't CodeSign DebugRun's + + ' bSILENT=True : don't show any messages until checking configuration + ' once .json required files are found: expect Docker and codesign to work + Var bSILENT As Boolean = True + + 'Check Build Target + Select Case CurrentBuildTarget + Case 3 'Windows (Intel, 32Bit) + Case 19 'Windows (Intel, 64Bit) + Case 25 'Windows(ARM, 64Bit) + Else + If (Not bSILENT) Then Print "AzureTrustedSigning: Unsupported Build Target" + Return + End Select + + 'Don't CodeSign Development and Alpha Builds + Select Case PropertyValue("App.StageCode") + Case "0" 'Development + If (Not bSILENT) Then Print "AzureTrustedSigning: Not enabled for Development Builds" + Return + Case "1" 'Alpha + If (Not bSILENT) Then Print "AzureTrustedSigning: Not enabled for Alpha Builds" + Return + Case "2" 'Beta + Case "3" 'Final + End Select + + 'Configure what to be CodeSigned + Var sSIGN_FILES() As String + + Select Case PropertyValue("App.StageCode") + Case "3" 'Final + 'sign all .exe's and all .dll's + sSIGN_FILES.Add("""./**/*.exe""") 'recursively all .exe's + sSIGN_FILES.Add("""./**/*.dll""") 'recursively all .dll's + Else + 'only sign all .exe's for Beta/Alpha/Development builds + sSIGN_FILES.Add("""./**/*.exe""") 'recursively all .exe's + End Select + + Var sDOCKER_IMAGE As String = "jotools/ats-codesign" + Var sFILE_ACS_JSON As String = "" + Var sFILE_AZURE_JSON As String = "" + Var sBUILD_LOCATION As String = CurrentBuildLocation + + 'Check Environment + Var sDOCKER_EXE As String = "docker" + If TargetWindows Then 'Xojo IDE is running on Windows + sFILE_ACS_JSON = DoShellCommand("if exist %USERPROFILE%\.ats-codesign\acs.json echo %USERPROFILE%\.ats-codesign\acs.json").Trim + sFILE_AZURE_JSON = DoShellCommand("if exist %USERPROFILE%\.ats-codesign\azure.json echo %USERPROFILE%\.ats-codesign\azure.json").Trim + ElseIf TargetMacOS Or TargetLinux Then 'Xojo IDE running on macOS or Linux + sDOCKER_EXE = DoShellCommand("[ -f /usr/local/bin/docker ] && echo /usr/local/bin/docker").Trim + If (sDOCKER_EXE = "") Then sDOCKER_EXE = DoShellCommand("[ -f /snap/bin/docker ] && echo /snap/bin/docker").Trim + sFILE_ACS_JSON = DoShellCommand("[ -f ~/.ats-codesign/acs.json ] && echo ~/.ats-codesign/acs.json").Trim + sFILE_AZURE_JSON = DoShellCommand("[ -f ~/.ats-codesign/azure.json ] && echo ~/.ats-codesign/azure.json").Trim + sBUILD_LOCATION = sBUILD_LOCATION.ReplaceAll("\", "") 'don't escape Path + Else + If (Not bSILENT) Then Print "AzureTrustedSigning: Xojo IDE running on unknown Target" + Return + End If + + If (sFILE_ACS_JSON = "") Or (sFILE_AZURE_JSON = "") Then + If (Not bSILENT) Then Print "AzureTrustedSigning: acs.json and azure.json not found in [UserHome]-[.ats-codesign]-[acs|azure.json]" + Return + End If + + 'Check Docker + Var iCHECK_DOCKER_RESULT As Integer + Var sCHECK_DOCKER_EXE As String = DoShellCommand(sDOCKER_EXE + " --version", 0, iCHECK_DOCKER_RESULT).Trim + If (iCHECK_DOCKER_RESULT <> 0) Or (Not sCHECK_DOCKER_EXE.Contains("Docker")) Or (Not sCHECK_DOCKER_EXE.Contains("version")) Or (Not sCHECK_DOCKER_EXE.Contains("build "))Then + Print "AzureTrustedSigning: Docker not available" + Return + End If + + Var sCHECK_DOCKER_PROCESS As String = DoShellCommand(sDOCKER_EXE + " ps", 0, iCHECK_DOCKER_RESULT).Trim + If (iCHECK_DOCKER_RESULT <> 0) Then + Print "AzureTrustedSigning: Docker not running" + Return + End If + + 'CodeSign in Docker Container + For i As Integer = sSIGN_FILES.LastIndex DownTo 0 + sSIGN_FILES(i) = sSIGN_FILES(i).ReplaceAll("""", "\""") + Next + + Var sSIGN_COMMAND As String = _ + sDOCKER_EXE + " run " + _ + "--rm " + _ + "-v """ + sFILE_ACS_JSON + """:/etc/ats-codesign/acs.json " + _ + "-v """ + sFILE_AZURE_JSON + """:/etc/ats-codesign/azure.json " + _ + "-v """ + sBUILD_LOCATION + """:/data " + _ + "-w /data " + _ + sDOCKER_IMAGE + " " + _ + "/bin/sh -c ""ats-codesign.sh " + String.FromArray(sSIGN_FILES, " ")+ """" + + Var iSIGN_RESULT As Integer + Var sSIGN_OUTPUT As String = DoShellCommand(sSIGN_COMMAND, 0, iSIGN_RESULT) + + If (iSIGN_RESULT <> 0) Then + Clipboard = sSIGN_OUTPUT + Print "AzureTrustedSigning: ats-codesign.sh Error" + EndOfLine + _ + "[ExitCode: " + iSIGN_RESULT.ToString + "]" + EndOfLine + EndOfLine + _ + "Note: Shell Output is available in Clipboard." + + If (iSIGN_RESULT <> 125) Then + Var iCHECK_DOCKERIMAGE_RESULT As Integer + Var sCHECK_DOCKERIMAGE_OUTPUT As String = DoShellCommand(sDOCKER_EXE + " image inspect " + sDOCKER_IMAGE, 0, iCHECK_DOCKERIMAGE_RESULT) + If (iCHECK_DOCKERIMAGE_RESULT <> 0) Then + Print "AzureTrustedSigning: Docker Image '" + sDOCKER_IMAGE + "' not available" + End If + End If + End If + + End Begin IDEScriptBuildStep CreateZIP , AppliesTo = 2, Architecture = 0, Target = 0 '************************************************** ' Create .zip for Windows Builds From 83ceec7f781f2eb63d3cb9296a9ebb111e4bc51b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Otter?= Date: Tue, 11 Mar 2025 21:59:15 +0100 Subject: [PATCH 5/9] Update Linux - CreateTGZ --- Build Automation.xojo_code | 107 +++++++++++++++++++++++-------------- 1 file changed, 68 insertions(+), 39 deletions(-) diff --git a/Build Automation.xojo_code b/Build Automation.xojo_code index 028a3f1..b99e0ce 100644 --- a/Build Automation.xojo_code +++ b/Build Automation.xojo_code @@ -11,8 +11,8 @@ FolderItem = Li4vc2NyaXB0cy9MYXVuY2guc2g= End Begin IDEScriptBuildStep ChmodLaunchSh , AppliesTo = 2, Architecture = 0, Target = 0 - 'Post Build Script is for Builds on macOS - If (Not TargetMacOS) Then + 'Post Build Script is for Builds on macOS or Linux + If (Not TargetMacOS) And (Not TargetLinux) Then Return End If @@ -22,69 +22,98 @@ End Begin IDEScriptBuildStep CreateTGZ , AppliesTo = 2, Architecture = 0, Target = 0 - '**************************** - 'Create .tgz for Linux Builds - '**************************** + '************************************************** + ' Create .tgz for Linux Builds + '************************************************** - 'Post Build Script is for Builds on macOS - If (Not TargetMacOS) Then + If DebugBuild Then Return 'don't create .tgz for DebugRuns + + ' bSILENT=True : don't show any error messages + Var bSILENT As Boolean = False + + 'Check Build Target + Select Case CurrentBuildTarget + Case 4 'Linux (Intel, 32Bit) + Case 17 'Linux (Intel, 64Bit) + Case 18 'Linux (ARM, 32Bit) + Case 26 'Linux (ARM, 64Bit) + Else + If (Not bSILENT) Then Print "CreateTGZ: Unsupported Build Target" Return + End Select + + 'Xojo Project Settings + Var sPROJECT_PATH As String + Var sBUILD_LOCATION As String = CurrentBuildLocation + Var sAPP_NAME As String = CurrentBuildAppName + Var sCHAR_FOLDER_SEPARATOR As String + If TargetWindows Then 'Xojo IDE is running on Windows + sPROJECT_PATH = DoShellCommand("echo %PROJECT_PATH%", 0).Trim + sCHAR_FOLDER_SEPARATOR = "\" + ElseIf TargetMacOS Or TargetLinux Then 'Xojo IDE running on macOS or Linux + sPROJECT_PATH = DoShellCommand("echo $PROJECT_PATH", 0).Trim + If sPROJECT_PATH.Right(1) = "/" Then + 'no trailing / + sPROJECT_PATH = sPROJECT_PATH.Left(sPROJECT_PATH.Length - 1) + End If + If sBUILD_LOCATION.Right(1) = "/" Then + 'no trailing / + sBUILD_LOCATION = sBUILD_LOCATION.Left(sBUILD_LOCATION.Length - 1) + End If + sBUILD_LOCATION = sBUILD_LOCATION.ReplaceAll("\", "") 'don't escape Path + sCHAR_FOLDER_SEPARATOR = "/" End If - 'Check Build - If DebugBuild Then + If (sPROJECT_PATH = "") Then + If (Not bSILENT) Then Print "CreateTGZ: Could not get the Environment Variable PROJECT_PATH from the Xojo IDE." + EndOfLine + EndOfLine + "Unfortunately, it's empty.... try again after re-launching the Xojo IDE and/or rebooting your machine." Return End If - 'Check Stage Code - Var sStageCodeInfo As String + 'Check Stage Code for TGZ Filename + Var sSTAGECODE_SUFFIX As String Select Case PropertyValue("App.StageCode") Case "0" 'Development - sStageCodeInfo = "-dev" + sSTAGECODE_SUFFIX = "-dev" Case "1" 'Alpha - sStageCodeInfo = "-alpha" + sSTAGECODE_SUFFIX = "-alpha" Case "2" 'Beta - sStageCodeInfo = "-beta" + sSTAGECODE_SUFFIX = "-beta" Case "3" 'Final 'not used in filename End Select - 'Check Build Target - Var sTGZFilename As String + 'Build TGZ Filename + Var sTGZ_FILENAME As String Select Case CurrentBuildTarget Case 4 'Linux (Intel, 32Bit) - sTGZFilename = "cubeSQLWebAdmin" + sStageCodeInfo + "_Linux_Intel_32Bit.tgz" + sTGZ_FILENAME = sAPP_NAME.ReplaceAll(" ", "_") + sSTAGECODE_SUFFIX + "_Linux_Intel_32Bit.tgz" Case 17 'Linux (Intel, 64Bit) - sTGZFilename = "cubeSQLWebAdmin" + sStageCodeInfo + "_Linux_Intel_64Bit.tgz" + sTGZ_FILENAME = sAPP_NAME.ReplaceAll(" ", "_") + sSTAGECODE_SUFFIX + "_Linux_Intel_64Bit.tgz" Case 18 'Linux (ARM, 32Bit) - sTGZFilename = "cubeSQLWebAdmin" + sStageCodeInfo + "_Linux_ARM_32Bit.tgz" + sTGZ_FILENAME = sAPP_NAME.ReplaceAll(" ", "_") + sSTAGECODE_SUFFIX + "_Linux_ARM_32Bit.tgz" Case 26 'Linux (ARM, 64Bit) - sTGZFilename = "cubeSQLWebAdmin" + sStageCodeInfo + "_Linux_ARM_64Bit.tgz" + sTGZ_FILENAME = sAPP_NAME.ReplaceAll(" ", "_") + sSTAGECODE_SUFFIX + "_Linux_ARM_64Bit.tgz" Else Return End Select - 'Xojo Project Settings - Var sPROJECT_PATH As String = DoShellCommand("echo $PROJECT_PATH", 0).Trim - If sPROJECT_PATH.Right(1) = "/" Then - 'no trailing / - sPROJECT_PATH = sPROJECT_PATH.Left(sPROJECT_PATH.Length - 1) - End If - Var sBUILD_LOCATION As String = CurrentBuildLocation.ReplaceAll("\", "") 'don't escape Path - Var sBUILD_APPNAME As String = CurrentBuildAppName - - If (sPROJECT_PATH = "") Then - Print "Xojo PostBuild Script CreateTGZ requires to get the Environment Variable $PROJECT_PATH from the Xojo IDE." + EndOfLine + EndOfLine + "Unfortunately, it's empty.... try again after re-launching the Xojo IDE and/or rebooting your machine." - Return - End If - 'Create .tgz - Var pathParts() As String = sBUILD_LOCATION.Split("/") - Var foldernameApp As String = pathParts(pathParts.LastIndex) - pathParts.RemoveAt(pathParts.LastIndex) - Var baseFolder As String = String.FromArray(pathParts, "/") + Var sPATH_PARTS() As String = sBUILD_LOCATION.Split(sCHAR_FOLDER_SEPARATOR) + Var sAPP_FOLDERNAME As String = sPATH_PARTS(sPATH_PARTS.LastIndex) + If TargetWindows Then sAPP_FOLDERNAME = sAPP_NAME 'on Windows, BuildLocation is short shell path (e.g. APPNAM~1) + sPATH_PARTS.RemoveAt(sPATH_PARTS.LastIndex) + Var sFOLDER_BASE As String = String.FromArray(sPATH_PARTS, sCHAR_FOLDER_SEPARATOR) - Call DoShellCommand("cd """ + baseFolder + """ && tar -c -z -v --no-mac-metadata --no-xattrs -f ../" + sTGZFilename + " ./" + foldernameApp, 0) + Var sTGZ_PARAMS_MACOS As String = If(TargetMacOS, "--no-mac-metadata --no-xattrs", "") + Var sTGZ_COMMAND As String = "cd """ + sFOLDER_BASE + """ && tar -c -z -v " + sTGZ_PARAMS_MACOS + " -f "".." + sCHAR_FOLDER_SEPARATOR + sTGZ_FILENAME + """ ""." + sCHAR_FOLDER_SEPARATOR + sAPP_FOLDERNAME + """" + + Var iTGZ_RESULT As Integer + Var sTGZ_OUTPUT As String = DoShellCommand(sTGZ_COMMAND, 0, iTGZ_RESULT) + If (iTGZ_RESULT <> 0) Then + If (Not bSILENT) Then Print "CreateTGZ Error" + EndOfLine + EndOfLine + _ + sTGZ_OUTPUT.Trim + EndOfLine + _ + "[ExitCode: " + iTGZ_RESULT.ToString + "]" + End If End Begin IDEScriptBuildStep Xojo2Docker , AppliesTo = 3, Architecture = 0, Target = 0 From 06877b0be4420eb49a20f9e21498e5f52f29f058 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Otter?= Date: Wed, 12 Mar 2025 22:42:29 +0100 Subject: [PATCH 6/9] Xojo2PGK: Notify missing DeveloperID --- Build Automation.xojo_code | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Build Automation.xojo_code b/Build Automation.xojo_code index b99e0ce..4522bfd 100644 --- a/Build Automation.xojo_code +++ b/Build Automation.xojo_code @@ -408,6 +408,11 @@ Var sCODESIGN_IDENT_INSTALLER As String = "" Var sCODESIGN_ENTITLEMENTS As String = sPROJECT_PATH + sFolderScripts + "/entitlements.plist" + If (sCODESIGN_IDENT_APPLICATION = "") Or (sCODESIGN_IDENT_INSTALLER = "") Then + Print "Xojo2PKG requires the DeveloperID information for CodeSign and Notarization" + Return + End If + '********************* 'Notarization by Apple From bc7acd50617afd9f01c48d08c3ad5dbfe45dea41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Otter?= Date: Wed, 12 Mar 2025 23:11:34 +0100 Subject: [PATCH 7/9] Dockerfile: Fix SecretsUsedInArgOrEnv --- scripts/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/Dockerfile b/scripts/Dockerfile index ebe41c8..ecff905 100644 --- a/scripts/Dockerfile +++ b/scripts/Dockerfile @@ -15,7 +15,7 @@ ENV CUBESQL_HOSTNAME=host.docker.internal ENV CUBESQL_PORT=4430 ENV CUBESQL_ENCRYPTION=AES256 ENV CUBESQL_USERNAME=admin -ENV CUBESQL_PASSWORD= +#ENV CUBESQL_PASSWORD= #INSTALL REQUIRED LIBRARIES ARG DEBIAN_FRONTEND=noninteractive From 641fd910fa97511146bcf2269844ed55de367b48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Otter?= Date: Sat, 29 Mar 2025 22:02:31 +0100 Subject: [PATCH 8/9] ATS CodeSign 1.2.0 --- Build Automation.xojo_code | 175 +++++++++++++++++++++++++------------ 1 file changed, 117 insertions(+), 58 deletions(-) diff --git a/Build Automation.xojo_code b/Build Automation.xojo_code index 4522bfd..131903a 100644 --- a/Build Automation.xojo_code +++ b/Build Automation.xojo_code @@ -478,64 +478,38 @@ Subdirectory = FolderItem = Li4vc2NyaXB0cy9MYXVuY2guYmF0 End - Begin IDEScriptBuildStep AzureTrustedSigning , AppliesTo = 2, Architecture = 0, Target = 0 - '************************************************** - ' CodeSign | Azure Trusted Signing | Docker - '************************************************** - ' https://github.com/jo-tools/ats-codesign - '************************************************** - ' Requirements - '************************************************** - ' 1. Set up Azure Trusted Signing - ' 2. Have Docker up and running - ' 3. Read the comments in this Post Build Script, - ' 4. Modify it according to your needs. - ' - ' Especially look out for sDOCKER_EXE - ' You might need to set the full path to the executable - '************************************************** - ' 5. If it's working for you: - ' Do you like it? Does it help you? Has it saved you time and money? - ' You're welcome - it's free... - ' If you want to say thanks I appreciate a message or a small donation. - ' Contact: xojo@jo-tools.ch - ' PayPal: https://paypal.me/jotools - '************************************************** - - '************************************************** - ' Note: Xojo IDE running on Linux - '************************************************** - ' Make sure that docker can be run without requiring 'sudo': - ' More information e.g. in this article: - ' https://medium.com/devops-technical-notes-and-manuals/how-to-run-docker-commands-without-sudo-28019814198f - ' 1. sudo groupadd docker - ' 2. sudo gpasswd -a $USER docker - ' 3. (reboot) - '************************************************** + Begin IDEScriptBuildStep CodeSign , AppliesTo = 2, Architecture = 0, Target = 0 + '********************************************************************************************* + ' CodeSign | Azure Trusted Signing | PFX | Docker + '********************************************************************************************* + ' https://github.com/jo-tools/ats-codesign-innosetup + '********************************************************************************************* If DebugBuild Then Return 'don't CodeSign DebugRun's - ' bSILENT=True : don't show any messages until checking configuration - ' once .json required files are found: expect Docker and codesign to work + 'bSILENT=True : don't show any messages until checking configuration + ' once .json required files are found: expect Docker and codesign to work + ' use this e.g. in Open Source projects so that your builds will be codesigned, + ' but if others are building the project it won't show messages to them Var bSILENT As Boolean = True 'Check Build Target Select Case CurrentBuildTarget - Case 3 'Windows (Intel, 32Bit) + Case 3 'Windows (Intel, 32Bit) Case 19 'Windows (Intel, 64Bit) Case 25 'Windows(ARM, 64Bit) Else - If (Not bSILENT) Then Print "AzureTrustedSigning: Unsupported Build Target" + If (Not bSILENT) Then Print "Codesign: Unsupported Build Target" Return End Select 'Don't CodeSign Development and Alpha Builds Select Case PropertyValue("App.StageCode") Case "0" 'Development - If (Not bSILENT) Then Print "AzureTrustedSigning: Not enabled for Development Builds" + If (Not bSILENT) Then Print "Codesign: Not enabled for Development Builds" Return Case "1" 'Alpha - If (Not bSILENT) Then Print "AzureTrustedSigning: Not enabled for Alpha Builds" + If (Not bSILENT) Then Print "Codesign: Not enabled for Alpha Builds" Return Case "2" 'Beta Case "3" 'Final @@ -546,17 +520,24 @@ Select Case PropertyValue("App.StageCode") Case "3" 'Final - 'sign all .exe's and all .dll's + ' sign all .exe's and all .dll's sSIGN_FILES.Add("""./**/*.exe""") 'recursively all .exe's sSIGN_FILES.Add("""./**/*.dll""") 'recursively all .dll's Else - 'only sign all .exe's for Beta/Alpha/Development builds + ' only sign all .exe's for Beta/Alpha/Development builds sSIGN_FILES.Add("""./**/*.exe""") 'recursively all .exe's End Select - Var sDOCKER_IMAGE As String = "jotools/ats-codesign" - Var sFILE_ACS_JSON As String = "" - Var sFILE_AZURE_JSON As String = "" + 'Note: In your project use jotools/codesign if you are not using the InnoSetup Build Step. + ' It's a smaller Docker Image... + ' Should your project use the Post Build Script 'InnoSetup' too, then change here to use jotools/innosetup. + ' InnoSetup includes codesign, too. So you don't need having two different Docker Images taking up space on your machine. + Var sDOCKER_IMAGE As String = "jotools/codesign" 'or: "jotools/innosetup" + + Var sFILE_ACS_JSON As String = "" 'will be searched in ~/.ats-codesign + Var sFILE_AZURE_JSON As String = "" 'will be searched in ~/.ats-codesign + Var sFILE_PFX_JSON As String = "" 'will be searched in ~/.pfx-codesign + Var sFILE_PFX_CERTIFICATE As String = "" 'will be searched in ~/.pfx-codesign Var sBUILD_LOCATION As String = CurrentBuildLocation 'Check Environment @@ -564,19 +545,30 @@ If TargetWindows Then 'Xojo IDE is running on Windows sFILE_ACS_JSON = DoShellCommand("if exist %USERPROFILE%\.ats-codesign\acs.json echo %USERPROFILE%\.ats-codesign\acs.json").Trim sFILE_AZURE_JSON = DoShellCommand("if exist %USERPROFILE%\.ats-codesign\azure.json echo %USERPROFILE%\.ats-codesign\azure.json").Trim + sFILE_PFX_JSON = DoShellCommand("if exist %USERPROFILE%\.pfx-codesign\pfx.json echo %USERPROFILE%\.pfx-codesign\pfx.json").Trim + sFILE_PFX_CERTIFICATE = DoShellCommand("if exist %USERPROFILE%\.pfx-codesign\certificate.pfx echo %USERPROFILE%\.pfx-codesign\certificate.pfx").Trim ElseIf TargetMacOS Or TargetLinux Then 'Xojo IDE running on macOS or Linux sDOCKER_EXE = DoShellCommand("[ -f /usr/local/bin/docker ] && echo /usr/local/bin/docker").Trim If (sDOCKER_EXE = "") Then sDOCKER_EXE = DoShellCommand("[ -f /snap/bin/docker ] && echo /snap/bin/docker").Trim sFILE_ACS_JSON = DoShellCommand("[ -f ~/.ats-codesign/acs.json ] && echo ~/.ats-codesign/acs.json").Trim sFILE_AZURE_JSON = DoShellCommand("[ -f ~/.ats-codesign/azure.json ] && echo ~/.ats-codesign/azure.json").Trim sBUILD_LOCATION = sBUILD_LOCATION.ReplaceAll("\", "") 'don't escape Path + sFILE_PFX_JSON = DoShellCommand("[ -f ~/.pfx-codesign/pfx.json ] && echo ~/.pfx-codesign/pfx.json").Trim + sFILE_PFX_CERTIFICATE = DoShellCommand("[ -f ~/.pfx-codesign/certificate.pfx ] && echo ~/.pfx-codesign/certificate.pfx").Trim Else - If (Not bSILENT) Then Print "AzureTrustedSigning: Xojo IDE running on unknown Target" + If (Not bSILENT) Then Print "Codesign: Xojo IDE running on unknown Target" Return End If - If (sFILE_ACS_JSON = "") Or (sFILE_AZURE_JSON = "") Then - If (Not bSILENT) Then Print "AzureTrustedSigning: acs.json and azure.json not found in [UserHome]-[.ats-codesign]-[acs|azure.json]" + Var bCODESIGN_ATS As Boolean = (sFILE_ACS_JSON <> "") And (sFILE_AZURE_JSON <> "") + Var bCODESIGN_PFX As Boolean = (sFILE_PFX_JSON <> "") And (sFILE_PFX_CERTIFICATE <> "") + + If (Not bCODESIGN_ATS) And (Not bCODESIGN_PFX) Then + If (Not bSILENT) Then + Print "Codesign:" + EndOfLine + _ + "acs.json and azure.json not found in [UserHome]-[.ats-codesign]-[acs|azure.json]" + EndOfLine + _ + "pfx.json and certificate.pfx not found in [UserHome]-[.pfx-codesign]-[pfx.json|certificate.pfx]" + End If Return End If @@ -584,37 +576,104 @@ Var iCHECK_DOCKER_RESULT As Integer Var sCHECK_DOCKER_EXE As String = DoShellCommand(sDOCKER_EXE + " --version", 0, iCHECK_DOCKER_RESULT).Trim If (iCHECK_DOCKER_RESULT <> 0) Or (Not sCHECK_DOCKER_EXE.Contains("Docker")) Or (Not sCHECK_DOCKER_EXE.Contains("version")) Or (Not sCHECK_DOCKER_EXE.Contains("build "))Then - Print "AzureTrustedSigning: Docker not available" + Print "Codesign: Docker not available" Return End If Var sCHECK_DOCKER_PROCESS As String = DoShellCommand(sDOCKER_EXE + " ps", 0, iCHECK_DOCKER_RESULT).Trim If (iCHECK_DOCKER_RESULT <> 0) Then - Print "AzureTrustedSigning: Docker not running" + Print "Codesign: Docker not running" Return End If - 'CodeSign in Docker Container - For i As Integer = sSIGN_FILES.LastIndex DownTo 0 - sSIGN_FILES(i) = sSIGN_FILES(i).ReplaceAll("""", "\""") - Next + 'Get Credential from Secure Storage + Var bENV_ATS_CREDENTIAL As Boolean + Var bENV_PFX_CREDENTIAL As Boolean + + If bCODESIGN_ATS Or bCODESIGN_PFX Then + Var SFILE_CREDENTIAL As String + Var sCREDENTIAL_COMMAND As String - Var sSIGN_COMMAND As String = _ + If TargetWindows Then 'Xojo IDE is running on Windows + If bCODESIGN_ATS Then + SFILE_CREDENTIAL = DoShellCommand("if exist %USERPROFILE%\.ats-codesign\ats-codesign-credential.ps1 echo %USERPROFILE%\.ats-codesign\ats-codesign-credential.ps1").Trim + ElseIf bCODESIGN_PFX Then + SFILE_CREDENTIAL = DoShellCommand("if exist %USERPROFILE%\.pfx-codesign\pfx-codesign-credential.ps1 echo %USERPROFILE%\.pfx-codesign\pfx-codesign-credential.ps1").Trim + End If + If (SFILE_CREDENTIAL <> "") Then + sCREDENTIAL_COMMAND = "powershell """ + SFILE_CREDENTIAL + """" + End If + ElseIf TargetMacOS Or TargetLinux Then 'Xojo IDE running on macOS or Linux + If bCODESIGN_ATS Then + SFILE_CREDENTIAL = DoShellCommand("[ -f ~/.ats-codesign/ats-codesign-credential.sh ] && echo ~/.ats-codesign/ats-codesign-credential.sh").Trim + ElseIf bCODESIGN_PFX Then + SFILE_CREDENTIAL = DoShellCommand("[ -f ~/.pfx-codesign/pfx-codesign-credential.sh ] && echo ~/.pfx-codesign/pfx-codesign-credential.sh").Trim + End If + If (SFILE_CREDENTIAL <> "") Then + Call DoShellCommand("chmod 755 """ + SFILE_CREDENTIAL + """") 'just to make sure it's executable + sCREDENTIAL_COMMAND = SFILE_CREDENTIAL + End If + End If + + If (sCREDENTIAL_COMMAND <> "") Then + 'Once the Credential Helper Script is in place, we expect to get a value from it + Var iCREDENTIAL_RESULT As Integer + Var sCREDENTIAL As String = DoShellCommand(sCREDENTIAL_COMMAND, 0, iCREDENTIAL_RESULT).Trim + If (iCREDENTIAL_RESULT <> 0) Or (sCREDENTIAL = "") Then + Print "Codesign: Could not retrieve " + If(bCODESIGN_ATS, "ATS", "PFX") + " Credential" + Return + End If + + 'Use Environment Variable + If bCODESIGN_ATS Then + EnvironmentVariable("AZURE_CLIENT_SECRET") = sCREDENTIAL + bENV_ATS_CREDENTIAL = True + ElseIf bCODESIGN_PFX Then + EnvironmentVariable("PFX_PASSWORD") = sCREDENTIAL + bENV_PFX_CREDENTIAL = True + End If + End If + End If + + 'CodeSign in Docker Container + Var sSIGN_COMMAND As String + Var sSIGN_ENTRYPOINT As String + If bCODESIGN_ATS Then + 'CodeSign using Azure Trusted Signing + sSIGN_ENTRYPOINT = "ats-codesign.sh" + sSIGN_COMMAND = _ sDOCKER_EXE + " run " + _ "--rm " + _ "-v """ + sFILE_ACS_JSON + """:/etc/ats-codesign/acs.json " + _ "-v """ + sFILE_AZURE_JSON + """:/etc/ats-codesign/azure.json " + _ + If(bENV_ATS_CREDENTIAL, "-e AZURE_CLIENT_SECRET ", "") + _ "-v """ + sBUILD_LOCATION + """:/data " + _ "-w /data " + _ + "--entrypoint " + sSIGN_ENTRYPOINT + " " + _ sDOCKER_IMAGE + " " + _ - "/bin/sh -c ""ats-codesign.sh " + String.FromArray(sSIGN_FILES, " ")+ """" + String.FromArray(sSIGN_FILES, " ") + ElseIf bCODESIGN_PFX Then + 'CodeSign using .pfx + sSIGN_ENTRYPOINT = "pfx-codesign.sh" + sSIGN_COMMAND = _ + sDOCKER_EXE + " run " + _ + "--rm " + _ + "-v """ + sFILE_PFX_JSON + """:/etc/pfx-codesign/pfx.json " + _ + "-v """ + sFILE_PFX_CERTIFICATE + """:/etc/pfx-codesign/certificate.pfx " + _ + If(bENV_PFX_CREDENTIAL, "-e PFX_PASSWORD ", "") + _ + "-v """ + sBUILD_LOCATION + """:/data " + _ + "-w /data " + _ + "--entrypoint " + sSIGN_ENTRYPOINT + " " + _ + sDOCKER_IMAGE + " " + _ + String.FromArray(sSIGN_FILES, " ") + End If Var iSIGN_RESULT As Integer Var sSIGN_OUTPUT As String = DoShellCommand(sSIGN_COMMAND, 0, iSIGN_RESULT) If (iSIGN_RESULT <> 0) Then Clipboard = sSIGN_OUTPUT - Print "AzureTrustedSigning: ats-codesign.sh Error" + EndOfLine + _ + Print "Codesign: " + sSIGN_ENTRYPOINT + " Error" + EndOfLine + _ "[ExitCode: " + iSIGN_RESULT.ToString + "]" + EndOfLine + EndOfLine + _ "Note: Shell Output is available in Clipboard." @@ -622,7 +681,7 @@ Var iCHECK_DOCKERIMAGE_RESULT As Integer Var sCHECK_DOCKERIMAGE_OUTPUT As String = DoShellCommand(sDOCKER_EXE + " image inspect " + sDOCKER_IMAGE, 0, iCHECK_DOCKERIMAGE_RESULT) If (iCHECK_DOCKERIMAGE_RESULT <> 0) Then - Print "AzureTrustedSigning: Docker Image '" + sDOCKER_IMAGE + "' not available" + Print "Codesign: Docker Image '" + sDOCKER_IMAGE + "' not available" End If End If End If From 8beb678cb10e7f0ce1c2de851994527aec002e8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Otter?= Date: Wed, 2 Apr 2025 22:13:11 +0200 Subject: [PATCH 9/9] Update Comments --- Build Automation.xojo_code | 69 +++++--------------------------------- 1 file changed, 9 insertions(+), 60 deletions(-) diff --git a/Build Automation.xojo_code b/Build Automation.xojo_code index 131903a..158af64 100644 --- a/Build Automation.xojo_code +++ b/Build Automation.xojo_code @@ -117,54 +117,11 @@ End Begin IDEScriptBuildStep Xojo2Docker , AppliesTo = 3, Architecture = 0, Target = 0 - '************************************************************* - 'Xojo Web App 2 Docker - How to use with your Xojo-built .app? - '************************************************************* - '1. copy the folder 'scripts' to your project folder. - '2. Edit the file 'Dockerfile' in your favourite Text Editor. - ' 1. Look for the last line: CMD /app/CRCCalculatorWeb - ' Make sure the App Name is the same as in your Xojo - ' project in Build Settings -> Linux - ' 2. Look for the line: EXPOSE 80 - ' Make sure the App Name is the same as in your Xojo - ' project in Build Settings -> Shared: Build (Port) - '3. Create a PostBuild Copy File Step 'CopyDockerfile' - ' Copy the file 'resources/Dockerfile' to 'App Parent Folder' - '4. create a PostBuild Script, place it after the - ' build step and copy-and-paste this one. - '5. Add/Modify the Constant App.constDockerTag to fit your - ' Company/App - '6. Read the Comments in the PostBuild Script, - ' modify according to your needs. - '************************************************** - - '************************************************** - 'Setup Xojo Web App 2 Docker - Post Build Script - '************************************************** - '1. Read the comments in this PostBuild Script - '2. Edit the values according to your needs - '************************************************** - '3. If it's working for you: Do you like it? Does it help you? Has it saved you time and money? - ' You're welcome - it's free... - ' If you want to say thanks I appreciate a message or a small donation. - ' Contact: xojo@jo-tools.ch - ' PayPal: https://paypal.me/jotools - '************************************************** - - - '************************************************** - 'Requires Docker Installation - '************************************************** - 'Download, install and run Docker.app: - 'https://docs.docker.com/docker-for-mac/install/ - '************************************************** - 'Note: Error creating MultiArch Images - 'https://github.com/docker/for-win/issues/14011 - 'Try re-setting qemu. Execute this in Terminal: - 'docker run --rm --privileged multiarch/qemu-user-Static --reset -p yes -c yes - 'This should effectively pull multiarch/qemu-user-Static, re-setup qemu-user-Static With :latest - 'to be properly installed and configured - '************************************************** + '****************************************** + 'Xojo Web App 2 Docker + '****************************************** + 'https://github.com/jo-tools/crccalculator + '****************************************** 'Configuration '------------- @@ -341,15 +298,7 @@ '************************************************** 'Setup Xojo2DMG - Post Build Script '************************************************** - '1. Read the comments in this PostBuild Script - '2. Edit the values according to your needs - '************************************************** - '3. If it's working for you: - ' Do you like it? Does it help you? Has it saved you time and money? - ' You're welcome - it's free... - ' If you want to say thanks I appreciate a message or a small donation. - ' Contact: xojo@jo-tools.ch - ' PayPal: https://paypal.me/jotools + 'https://github.com/jo-tools/xojo2dmg '************************************************** '******************************* @@ -479,11 +428,11 @@ FolderItem = Li4vc2NyaXB0cy9MYXVuY2guYmF0 End Begin IDEScriptBuildStep CodeSign , AppliesTo = 2, Architecture = 0, Target = 0 - '********************************************************************************************* + '**************************************************** ' CodeSign | Azure Trusted Signing | PFX | Docker - '********************************************************************************************* + '**************************************************** ' https://github.com/jo-tools/ats-codesign-innosetup - '********************************************************************************************* + '**************************************************** If DebugBuild Then Return 'don't CodeSign DebugRun's