Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automate the cleanup steps on Jenkins deployment #2041

Merged
merged 3 commits into from
Jan 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 4 additions & 24 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ pipeline {
pollSCM('H/5 * * * *')
}
parameters {
booleanParam(name: 'CLEAN_INTEGRATION', defaultValue: false, description: 'Attention: Cleans the integration folder with all branches completely.')
booleanParam(name: 'CODESIGN', defaultValue: false, description: 'Sign the artifacts.')
booleanParam(name: 'PUBLISH_PRODUCTS', defaultValue: false, description: 'Copy to the compiled products for Windows, macOS and Linux')
}
Expand All @@ -24,7 +23,7 @@ pipeline {
buildDiscarder(logRotator(numToKeepStr: '5', artifactNumToKeepStr: '1'))
}
stages {
stage('build') {
stage('Build') {
steps {
sh """
mvn -B ${params.CODESIGN ? '-P eclipse-sign' : ''} \\
Expand All @@ -39,38 +38,19 @@ pipeline {
archiveArtifacts 'chemclipse/products/org.eclipse.chemclipse.rcp.compilation.community.product/target/products/*.zip,chemclipse/products/org.eclipse.chemclipse.rcp.compilation.community.product/target/products/*.tar.gz'
}
}
stage('clean integration') {
when {
environment name: 'CLEAN_INTEGRATION', value: 'true'
}
steps {
sshagent ( ['projects-storage.eclipse.org-bot-ssh']) {
sh "ssh [email protected] rm -rf /home/data/httpd/download.eclipse.org/chemclipse/integration/"
}
}
}
stage('clean deploy') {
when {
environment name: 'CLEAN_WORKSPACE', value: 'true'
}
steps {
sshagent ( ['projects-storage.eclipse.org-bot-ssh']) {
sh "ssh [email protected] rm -rf /home/data/httpd/download.eclipse.org/chemclipse/integration/${BRANCH_NAME}"
}
}
}
stage('deploy') {
stage('Deploy') {
steps {
sshagent ( ['projects-storage.eclipse.org-bot-ssh']) {
sh '''
ssh [email protected] rm -rf /home/data/httpd/download.eclipse.org/chemclipse/integration/${BRANCH_NAME}
ssh [email protected] mkdir -p /home/data/httpd/download.eclipse.org/chemclipse/integration/${BRANCH_NAME}/repository
ssh [email protected] mkdir -p /home/data/httpd/download.eclipse.org/chemclipse/integration/${BRANCH_NAME}/downloads
scp -r chemclipse/sites/chemclipse/target/repository/* [email protected]:/home/data/httpd/download.eclipse.org/chemclipse/integration/${BRANCH_NAME}/repository
'''
}
}
}
stage('publish') {
stage('Publish') {
when {
environment name: 'PUBLISH_PRODUCTS', value: 'true'
}
Expand Down
Loading