我是Python專案與Jenkins宣告式管道
的新手。如果您能幫助我解決這個問題,那將會很有幫助。 PS:我使用的是ubuntu 20.04
。uj5u.com熱心網友回復:
請看我的解決包裝問題的方法:
1- 我已經創建了 "包裝"。
1- 我已經創建了setup.py檔案
from distutils.core import setup
from setuptools import find_packages
設定(
name='PythonProject'。
版本='0.2dev'。
description='packaging for my first python app',
packages=find_packages()。
author='mohtadi.nasri',
url='https://github.com/*/Python-project'。
platforms='Ubuntu'
2- 改變了打包階段,如下圖所示
stage('Packaging') {
代理人 any
環境 {
//VOLUME = '$(pwd)/sources:/src'
VOLUME = '$PWD/sources:/src'/span>
IMAGE = 'cdrx/pyinstaller-linux:python3'。
}
步驟 {
dir(path: env.BUILD_ID) {
unstash(name: 'compiled-results')
//https://docs.python.org/3/distutils/builtdist.html
sh 'python3 setup.py bdist_dumb --format=zip'。
}
}
post {
成功 {
archiveArtifacts "${env.BUILD_ID}/dist/*"/span>
}
}
}
結果,該管道被成功構建
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/318098.html
標籤:


