From 0a4a0cce99e9392dff9f78b5b7a67ca2841b31eb Mon Sep 17 00:00:00 2001 From: Joe Stanley Date: Sun, 4 Sep 2022 20:20:14 -0700 Subject: [PATCH 1/8] initial updates - will this build? --- .gitignore | 6 +++++- Jenkinsfile | 4 ++-- README.md | 7 +++++++ main.spec | 44 ++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 58 insertions(+), 3 deletions(-) create mode 100644 main.spec diff --git a/.gitignore b/.gitignore index 5d381cc..1edf730 100644 --- a/.gitignore +++ b/.gitignore @@ -31,7 +31,11 @@ MANIFEST # Usually these files are written by a python script from a template # before PyInstaller builds the exe, so as to inject date/other infos into it. *.manifest -*.spec +#*.spec +# Normally, we wouldn't want these tracked - but here, we do! +# We need them, because the build-system will utilize them. +# See https://github.com/cdrx/docker-pyinstaller for more information. +# Joe Stanley - 09/04/2022 # Installer logs pip-log.txt diff --git a/Jenkinsfile b/Jenkinsfile index f86a307..621234d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,12 +13,12 @@ node ('master') { // Prep Stage - Clone the Repository and Configure System as Needed. stage('Prep') { - sh "echo nothing" + sh "docker pull cdrx/pyinstaller-windows:python3" } // Build Stage - Run the PyInstaller Steps to Generate an Executable. stage('Build') { - sh "echo \"build stage - todo\"" + sh """docker run -v "$(pwd):/src/" cdrx/pyinstaller-windows:python3""" } // Wrap Up - Archive the Generated Executables, Tear Down the Build System. diff --git a/README.md b/README.md index f625d70..3680c9f 100644 --- a/README.md +++ b/README.md @@ -8,3 +8,10 @@ Builds are generated by Stanley Solutions Jenkins; they can be accessed here: [S | **Branch** | **Build Status** | |------------|------------------| | Main | [![Master Branch Build Status](https://jenkins.stanleysolutionsnw.com/buildStatus/icon?job=Potlatch+Loggers+Organization%2FComputerKeeper%2Fmain)](https://jenkins.stanleysolutionsnw.com/job/Potlatch%20Loggers%20Organization/job/ComputerKeeper/job/main/) | + + +## PyInstaller Command + +```shell +pyinstaller --noconfirm --onefile --windowed "./main.py" +``` \ No newline at end of file diff --git a/main.spec b/main.spec new file mode 100644 index 0000000..dda2119 --- /dev/null +++ b/main.spec @@ -0,0 +1,44 @@ +# -*- mode: python ; coding: utf-8 -*- + + +block_cipher = None + + +a = Analysis( + ['./main.py'], + pathex=[], + binaries=[], + datas=[], + hiddenimports=[], + hookspath=[], + hooksconfig={}, + runtime_hooks=[], + excludes=[], + win_no_prefer_redirects=False, + win_private_assemblies=False, + cipher=block_cipher, + noarchive=False, +) +pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher) + +exe = EXE( + pyz, + a.scripts, + a.binaries, + a.zipfiles, + a.datas, + [], + name='main', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + upx_exclude=[], + runtime_tmpdir=None, + console=False, + disable_windowed_traceback=False, + argv_emulation=False, + target_arch=None, + codesign_identity=None, + entitlements_file=None, +) -- 2.45.2 From babe775d553e5fbd7f6f49f6b63145493fa10961 Mon Sep 17 00:00:00 2001 From: Joe Stanley Date: Sun, 4 Sep 2022 20:22:12 -0700 Subject: [PATCH 2/8] oh, yeah... can't use dollar-signs all willy-nilly --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 621234d..af2aeab 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -18,7 +18,7 @@ node ('master') { // Build Stage - Run the PyInstaller Steps to Generate an Executable. stage('Build') { - sh """docker run -v "$(pwd):/src/" cdrx/pyinstaller-windows:python3""" + sh """docker run -v "${WORKSPACE}:/src/" cdrx/pyinstaller-windows:python3""" } // Wrap Up - Archive the Generated Executables, Tear Down the Build System. -- 2.45.2 From 46fb9e102099f5ddc6153c48b61b00579be6a997 Mon Sep 17 00:00:00 2001 From: Joe Stanley Date: Sun, 4 Sep 2022 20:23:19 -0700 Subject: [PATCH 3/8] you mean, you can't read my mind? --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index af2aeab..3c574da 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,7 +9,7 @@ * Joe Stanley ******************************************************************************/ -node ('master') { +node ('x86-64-build') { // Prep Stage - Clone the Repository and Configure System as Needed. stage('Prep') { -- 2.45.2 From 28f8547b86773df1b201951bcb7ceb8b6c6311d5 Mon Sep 17 00:00:00 2001 From: Joe Stanley Date: Fri, 4 Nov 2022 02:16:21 +0000 Subject: [PATCH 4/8] Update 'Jenkinsfile' --- Jenkinsfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3c574da..bef0e6f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,21 +9,21 @@ * Joe Stanley ******************************************************************************/ -node ('x86-64-build') { +node ('windows') { // Prep Stage - Clone the Repository and Configure System as Needed. stage('Prep') { - sh "docker pull cdrx/pyinstaller-windows:python3" + bat "echo prep" } // Build Stage - Run the PyInstaller Steps to Generate an Executable. stage('Build') { - sh """docker run -v "${WORKSPACE}:/src/" cdrx/pyinstaller-windows:python3""" + bat "echo build" } // Wrap Up - Archive the Generated Executables, Tear Down the Build System. stage('Archive/Teardown') { - sh "echo teardown" + bat "echo teardown" } } \ No newline at end of file -- 2.45.2 From 9d7ac10e61414a2f83980b47675bdc3e4ce88f27 Mon Sep 17 00:00:00 2001 From: Joe Stanley Date: Sun, 6 Nov 2022 18:18:43 -0800 Subject: [PATCH 5/8] first shot on windows --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index bef0e6f..5e61e8a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,12 +13,12 @@ node ('windows') { // Prep Stage - Clone the Repository and Configure System as Needed. stage('Prep') { - bat "echo prep" + scm checkout } // Build Stage - Run the PyInstaller Steps to Generate an Executable. stage('Build') { - bat "echo build" + bat """pyinstaller --noconfirm --onefile --windowed "./main.py" """ } // Wrap Up - Archive the Generated Executables, Tear Down the Build System. -- 2.45.2 From 535706027dbd70f23c753145758f6b3fcd4efd57 Mon Sep 17 00:00:00 2001 From: Joe Stanley Date: Sun, 6 Nov 2022 18:21:23 -0800 Subject: [PATCH 6/8] whoops, order matters, doesn't it? --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5e61e8a..04ca2d0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,7 +13,7 @@ node ('windows') { // Prep Stage - Clone the Repository and Configure System as Needed. stage('Prep') { - scm checkout + checkout scm } // Build Stage - Run the PyInstaller Steps to Generate an Executable. -- 2.45.2 From afd0991910741575d78250eee1772d2ff9af9d4d Mon Sep 17 00:00:00 2001 From: Joe Stanley Date: Sun, 6 Nov 2022 18:25:26 -0800 Subject: [PATCH 7/8] add archive stage --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 04ca2d0..c38836e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -23,7 +23,7 @@ node ('windows') { // Wrap Up - Archive the Generated Executables, Tear Down the Build System. stage('Archive/Teardown') { - bat "echo teardown" + archiveArtifacts artifacts: "$WORKSPACE\\dist\\*.exe" } } \ No newline at end of file -- 2.45.2 From d9b5b9fe0926bb48953318dfe3bbae0261e075d2 Mon Sep 17 00:00:00 2001 From: Joe Stanley Date: Sun, 6 Nov 2022 18:26:37 -0800 Subject: [PATCH 8/8] fix the path --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index c38836e..05da1a9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -23,7 +23,7 @@ node ('windows') { // Wrap Up - Archive the Generated Executables, Tear Down the Build System. stage('Archive/Teardown') { - archiveArtifacts artifacts: "$WORKSPACE\\dist\\*.exe" + archiveArtifacts artifacts: "dist\\*.exe" } } \ No newline at end of file -- 2.45.2