-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#19 - create the pipeline to do presto stable releases
- Loading branch information
Linsong Wang
authored and
Linsong Wang
committed
Oct 31, 2022
1 parent
7ac6685
commit e25507f
Showing
101 changed files
with
150 additions
and
10,504 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
pipeline { | ||
|
||
agent { | ||
kubernetes { | ||
defaultContainer 'maven' | ||
yamlFile 'agent.yaml' | ||
} | ||
} | ||
|
||
environment { | ||
AWS_CREDENTIAL_ID = 'aws-jenkins' | ||
AWS_DEFAULT_REGION = 'us-east-1' | ||
AWS_ECR = credentials('aws-ecr-private-registry') | ||
AWS_S3_PREFIX = 's3://oss-jenkins/artifact/presto' | ||
} | ||
|
||
options { | ||
disableConcurrentBuilds() | ||
buildDiscarder(logRotator(numToKeepStr: '500')) | ||
timeout(time: 1, unit: 'HOURS') | ||
} | ||
|
||
parameters { | ||
booleanParam(name: 'RELEASE_DRYRUN', | ||
defaultValue: true, | ||
description: 'dryrun without creating a PR to update master branch' | ||
) | ||
} | ||
|
||
triggers { | ||
cron('0 19 1-7 * 2') | ||
} | ||
|
||
stages { | ||
stage ('Setup') { | ||
steps { | ||
sh 'apt update && apt install -y awscli git tree' | ||
} | ||
} | ||
|
||
stage ('Load Scripts') { | ||
steps { | ||
checkout $class: 'GitSCM', | ||
branches: [[name: '*/master']], | ||
doGenerateSubmoduleConfigurations: false, | ||
extensions: [[ | ||
$class: 'RelativeTargetDirectory', | ||
relativeTargetDir: 'presto-release-tools' | ||
],[ | ||
$class: 'CloneOption', | ||
shallow: true, | ||
noTags: true, | ||
depth: 1, | ||
timeout: 10 | ||
]], | ||
submoduleCfg: [], | ||
userRemoteConfigs: [[ | ||
credentialsId: 'github-personal-token-wanglinsong', | ||
url: 'https://github.com/prestodb/presto-release-tools' | ||
]] | ||
} | ||
} | ||
stage ('Load Presto Source') { | ||
steps { | ||
checkout $class: 'GitSCM', | ||
branches: [[name: '*/master']], | ||
doGenerateSubmoduleConfigurations: false, | ||
extensions: [[ | ||
$class: 'RelativeTargetDirectory', | ||
relativeTargetDir: 'presto' | ||
],[ | ||
$class: 'CloneOption', | ||
shallow: true, | ||
noTags: true, | ||
depth: 1, | ||
timeout: 10 | ||
]], | ||
submoduleCfg: [], | ||
userRemoteConfigs: [[ | ||
credentialsId: 'github-personal-token-wanglinsong', | ||
url: 'https://github.com/prestodb/presto' | ||
]] | ||
sh 'unset MAVEN_CONFIG && cd presto/ && ./mvnw versions:set -DremoveSnapshot' | ||
script { | ||
env.PRESTO_RELEASE_VERSION = sh( | ||
script: 'unset MAVEN_CONFIG && cd presto/ && ./mvnw org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout', | ||
returnStdout: true).trim() | ||
} | ||
echo "Presto release version ${PRESTO_RELEASE_VERSION}" | ||
} | ||
} | ||
|
||
stage ('Search Artifacts') { | ||
steps { | ||
echo "query for presto docker images with release version ${PRESTO_RELEASE_VERSION}" | ||
withCredentials([[ | ||
$class: 'AmazonWebServicesCredentialsBinding', | ||
credentialsId: "${AWS_CREDENTIAL_ID}", | ||
accessKeyVariable: 'AWS_ACCESS_KEY_ID', | ||
secretKeyVariable: 'AWS_SECRET_ACCESS_KEY']]) { | ||
script { | ||
env.DOCKER_IMAGE_TAG = sh( | ||
script: 'scripts/get-releasable-docker-image-tag.sh', | ||
returnStdout: true).trim() | ||
env.PRESTO_BUILD_VERSION = env.DOCKER_IMAGE_TAG.substring(0, env.DOCKER_IMAGE_TAG.lastIndexOf('-')); | ||
env.PRESTO_RELEASE_SHA = env.PRESTO_BUILD_VERSION.substring(env.DOCKER_IMAGE_TAG.lastIndexOf('-') + 1); | ||
''' | ||
} | ||
sh 'printenv | sort' | ||
echo "${AWS_S3_PREFIX}/${PRESTO_BUILD_VERSION}/presto-server-${PRESTO_RELEASE_VERSION}.tar.gz" | ||
echo "${AWS_ECR}/oss-presto/presto:${DOCKER_IMAGE_TAG}" | ||
} | ||
} | ||
} | ||
post { | ||
cleanup { | ||
cleanWs() | ||
} | ||
} | ||
} |
Oops, something went wrong.