Compare commits

...

4 Commits

Author SHA1 Message Date
Nicolas De Loof
d0899ca124 remove py27 testing, 1.26 and later drop python 2 support
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-01-08 17:20:02 +01:00
Nicolas De Loof
94c41848cb Attempt to fix release process
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-01-08 15:00:50 +01:00
Nicolas De Loof
540e5da903 bake github release API json payload in groovy
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-01-08 14:06:24 +01:00
Nicolas De Loof
3f4920cdf5 run release on tag by Jenkinsfile
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-01-08 12:27:47 +01:00

View File

@@ -2,7 +2,7 @@
def dockerVersions = ['19.03.5', '18.09.9']
def baseImages = ['alpine', 'debian']
def pythonVersions = ['py27', 'py37']
def pythonVersions = ['py37']
pipeline {
agent none
@@ -75,7 +75,7 @@ pipeline {
steps {
checkout scm
sh './script/setup/osx'
sh 'tox -e py27,py37 -- tests/unit'
sh 'tox -e py37 -- tests/unit'
sh './script/build/osx'
dir ('dist') {
checksum('docker-compose-Darwin-x86_64')
@@ -112,7 +112,7 @@ pipeline {
}
steps {
checkout scm
bat 'tox.exe -e py27,py37 -- tests/unit'
bat 'tox.exe -e py37 -- tests/unit'
powershell '.\\script\\build\\windows.ps1'
dir ('dist') {
checksum('docker-compose-Windows-x86_64.exe')
@@ -177,19 +177,14 @@ pipeline {
}
steps {
checkout scm
withCredentials([[$class: "FileBinding", credentialsId: 'pypirc-docker-dsg-cibot', variable: 'PYPIRC']]) {
withCredentials([file(credentialsId: 'pypirc-docker-dsg-cibot', variable: 'PYPIRC')]) {
sh """
virtualenv venv-publish
source venv-publish/bin/activate
pip install --user twine wheel
python setup.py sdist bdist_wheel
pip install twine
twine upload --config-file ${PYPIRC} ./dist/docker-compose-${env.TAG_NAME}.tar.gz ./dist/docker_compose-${env.TAG_NAME}-py2.py3-none-any.whl
"""
}
}
post {
sh 'deactivate; rm -rf venv-publish'
}
}
}
}
@@ -268,7 +263,6 @@ def buildRuntimeImage(baseImage) {
def pushRuntimeImage(baseImage) {
unstash "compose-${baseImage}"
sh 'echo -n "${DOCKERHUB_CREDS_PSW}" | docker login --username "${DOCKERHUB_CREDS_USR}" --password-stdin'
sh "docker load -i dist/docker-compose-${baseImage}.tar"
withDockerRegistry(credentialsId: 'dockerbuildbot-hub.docker.com') {
sh "docker push docker/compose:${baseImage}-${env.TAG_NAME}"
@@ -283,18 +277,23 @@ def githubRelease() {
withCredentials([string(credentialsId: 'github-compose-release-test-token', variable: 'GITHUB_TOKEN')]) {
def prerelease = !( env.TAG_NAME ==~ /v[0-9\.]+/ )
changelog = readFile "CHANGELOG.md"
def data = """{
\"tag_name\": \"${env.TAG_NAME}\",
\"name\": \"${env.TAG_NAME}\",
\"draft\": true,
\"prerelease\": ${prerelease},
\"body\" : \"${changelog}\"
"""
echo $data
def info = [:]
info.tag_name = env.TAG_NAME
info.name = env.TAG_NAME
info.draft = true
info.prerelease = prerelease
info.body = changelog
writeFile file: 'release.json', text: groovy.json.JsonOutput.toJson(info)
// debug
sh("cat release.json")
def url = "https://api.github.com/repos/docker/compose/releases"
def upload_url = sh(returnStdout: true, script: """
curl -sSf -H 'Authorization: token ${GITHUB_TOKEN}' -H 'Accept: application/json' -H 'Content-type: application/json' -X POST -d '$data' $url") \\
curl -sSf -H 'Authorization: token ${GITHUB_TOKEN}' -H 'Accept: application/json' -H 'Content-type: application/json' -X POST --data-binary '@release.json' $url) \\
| jq '.upload_url | .[:rindex("{")]'
""")
sh("""