From 7fb00175b95ab93493fbbea248e99da8df3a148d Mon Sep 17 00:00:00 2001 From: Jake Bauer Date: Mon, 27 Nov 2023 18:24:19 +0100 Subject: [PATCH] Set repository up for compilation with crdx/pyinstaller According to: https://github.com/cdrx/docker-pyinstaller/blob/master/README.md --- .gitignore | 1 - Jenkinsfile | 5 ++--- fenen.spec | 44 ++++++++++++++++++++++++++++++++++++++++++++ requirements.txt | 1 + 4 files changed, 47 insertions(+), 4 deletions(-) create mode 100644 fenen.spec create mode 100644 requirements.txt diff --git a/.gitignore b/.gitignore index c227f6e..8ff6d1b 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,3 @@ feeds.* # Build artifacts build/ dist/ -fenen.spec diff --git a/Jenkinsfile b/Jenkinsfile index a290c8a..c6ac6ba 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -12,7 +12,7 @@ pipeline { } steps { sh 'python -m py_compile *.py' - stash(name: 'compiled-results', includes: '*.py*') + stash(name: 'compiled-results', includes: '*.py*, fenen.spec, requirements.txt') } } stage('Deliver') { @@ -24,8 +24,7 @@ pipeline { steps { dir(path: env.BUILD_ID) { unstash(name: 'compiled-results') - sh label: "Install Dependencies", script: "pip install feedparser" - sh label: "Invoke PyInstaller", script: "docker run --rm -v ${VOLUME} ${IMAGE} 'pyinstaller --onefile fenen.py'" + sh "docker run --rm -v ${VOLUME} ${IMAGE} 'pyinstaller --onefile fenen.py'" } } post { diff --git a/fenen.spec b/fenen.spec new file mode 100644 index 0000000..cec4efd --- /dev/null +++ b/fenen.spec @@ -0,0 +1,44 @@ +# -*- mode: python ; coding: utf-8 -*- + + +block_cipher = None + + +a = Analysis( + ['fenen.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='fenen', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + upx_exclude=[], + runtime_tmpdir=None, + console=True, + disable_windowed_traceback=False, + argv_emulation=False, + target_arch=None, + codesign_identity=None, + entitlements_file=None, +) diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..5c30c78 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +feedparser==6.0.10