Skip to content

Commit 47650f2

Browse files
aline version
1 parent 3f8d0f2 commit 47650f2

File tree

1 file changed

+29
-65
lines changed

1 file changed

+29
-65
lines changed

Jenkinsfile

Lines changed: 29 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -36,77 +36,41 @@ pipeline {
3636
"""
3737
}
3838
}
39+
40+
3941
stage('Beta Release') {
42+
// when {
43+
// branch '*-beta'
44+
// }
4045
steps {
4146
script {
42-
sh '''
43-
# Install required Python packages
44-
pip install toml build
45-
46-
# Write Python code to a file (no indentation!)
47-
cat > update_name.py <<EOF
48-
import toml
49-
data = toml.load('pyproject.toml')
50-
data['project']['name'] = 'superclient-beta'
51-
with open('pyproject.toml', 'w') as f:
52-
toml.dump(data, f)
53-
EOF
54-
55-
# Run the Python script to update pyproject.toml
56-
python3 update_name.py
57-
58-
# Build the package using PEP 517
59-
python -m build
60-
61-
# Show artifacts
62-
ls -lh dist/
63-
'''
47+
def version = readFile('version-beta.conf').trim()
48+
env.versionTag = version
49+
echo "Using version from version-beta.conf: ${env.versionTag}"
6450
}
51+
sh """
52+
sed -i 's/version = "[0-9]\\+\\.[0-9]\\+\\.[0-9]\\+"/version = "${env.versionTag}"/g' pyproject.toml
53+
"""
54+
sh '''
55+
sed -i -E 's/^(name *= *")superclient(")/\\1superclient-beta\\2/' pyproject.toml
56+
'''
57+
58+
59+
60+
sh 'pip install build'
61+
sh 'python -m build'
62+
sh 'ls dist/'
63+
// withCredentials([usernamePassword(credentialsId: 'superstream-pypi', usernameVariable: 'USR', passwordVariable: 'PSW')]) {
64+
// sh """
65+
// python3 patch/patch.py --src "dist/superstream_confluent_kafka_beta-${env.versionTag}-cp311-cp311-linux_x86_64.whl" --output "dist/" --prefix "superstream_confluent_kafka_beta-${env.versionTag}"
66+
// """
67+
// sh"""
68+
// rm dist/superstream_confluent_kafka_beta-${env.versionTag}-cp311-cp311-linux_x86_64.whl
69+
// /tmp/.local/bin/pdm publish --no-build --username $USR --password $PSW
70+
// """
71+
// }
6572
}
6673
}
67-
68-
// stage('Beta Release') {
69-
// // when {
70-
// // branch '*-beta'
71-
// // }
72-
// steps {
73-
// script {
74-
// def version = readFile('version-beta.conf').trim()
75-
// env.versionTag = version
76-
// echo "Using version from version-beta.conf: ${env.versionTag}"
77-
// }
78-
// sh """
79-
// sed -i 's/version = "[0-9]\\+\\.[0-9]\\+\\.[0-9]\\+"/version = "${env.versionTag}"/g' pyproject.toml
80-
// """
81-
82-
// sh '''
83-
// pip install toml
84-
85-
// cat <<EOF > update_name.py
86-
// import toml
87-
// data = toml.load('pyproject.toml')
88-
// data['project']['name'] = 'superclient-beta'
89-
// with open('pyproject.toml', 'w') as f:
90-
// toml.dump(data, f)
91-
// EOF
92-
93-
// python3 update_name.py
94-
// '''
95-
96-
// sh 'pip install build'
97-
// sh 'python -m build'
98-
// sh 'ls dist/'
99-
// // withCredentials([usernamePassword(credentialsId: 'superstream-pypi', usernameVariable: 'USR', passwordVariable: 'PSW')]) {
100-
// // sh """
101-
// // python3 patch/patch.py --src "dist/superstream_confluent_kafka_beta-${env.versionTag}-cp311-cp311-linux_x86_64.whl" --output "dist/" --prefix "superstream_confluent_kafka_beta-${env.versionTag}"
102-
// // """
103-
// // sh"""
104-
// // rm dist/superstream_confluent_kafka_beta-${env.versionTag}-cp311-cp311-linux_x86_64.whl
105-
// // /tmp/.local/bin/pdm publish --no-build --username $USR --password $PSW
106-
// // """
107-
// // }
108-
// }
109-
// }
11074
// stage('Prod Release') {
11175
// when {
11276
// branch '2.4.0'

0 commit comments

Comments
 (0)