From 60ab939f5887778253f8a69eae547f7366f2fd01 Mon Sep 17 00:00:00 2001 From: Reguel Wermelinger Date: Fri, 15 Nov 2024 15:31:52 +0100 Subject: [PATCH] XIVY-15201 push pages using native GIT cli --- Jenkinsfile | 56 ++++++++++++++++++++++++++++++++++++++++++----------- pom.xml | 34 +------------------------------- 2 files changed, 46 insertions(+), 44 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4d21ab20..320aff2d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -22,20 +22,54 @@ pipeline { } stages { - stage('build') { + // stage('build') { + // steps { + // script { + // setupGPGEnvironment() + // withCredentials([string(credentialsId: 'gpg.password', variable: 'GPG_PWD')]) { + // def phase = isReleaseOrMasterBranch() ? 'deploy' : 'verify' + // maven cmd: "clean verify " + + // "-Dgpg.skip=false " + + // "-Dgpg.project-build.password='${env.GPG_PWD}' " + + // "-Divy.engine.list.url=${params.engineListUrl} " + + // "-Dmaven.test.failure.ignore=true" + // } + // collectBuildArtifacts() + // } + // } + // } + stage('deploy-site') { + // when { + // expression { !params.skipGitHubSite && isReleaseOrMasterBranch() } + // } steps { script { - setupGPGEnvironment() - withCredentials([string(credentialsId: 'gpg.password', variable: 'GPG_PWD')]) { - def phase = isReleaseOrMasterBranch() ? 'deploy site-deploy' : 'verify' - maven cmd: "clean ${phase} " + - "-Dgpg.skip=false " + - "-Dgpg.project-build.password='${env.GPG_PWD}' " + - "-Dgithub.site.skip=${params.skipGitHubSite} " + - "-Divy.engine.list.url=${params.engineListUrl} " + - "-Dmaven.test.failure.ignore=true" + maven cmd: "clean site " + + "-Divy.engine.list.url=${params.engineListUrl} " + + withEnv(['GIT_SSH_COMMAND=ssh -o StrictHostKeyChecking=no']) { + sshagent(credentials: ['github-axonivy']) { + def branch = "pages_$BRANCH_NAME-$BUILD_NUMBER" + def message = "Update site (${env.BRANCH_NAME})" + withCredentials([file(credentialsId: 'github-ivyteam-token-repo-manager', variable: 'tokenFile')]) { + sh """ + git config --global user.name 'ivy-team' + git config --global user.email 'info@ivyteam.ch' + gh auth login --with-token < ${tokenFile} + + git clone -b gh-pages git@github.com:axonivy/project-build-plugin.git target/site-deployer + cd target/site-deployer + git checkout -b ${branch} + cd ../site + cp -r -v . ../site-deployer + cd ../site-deployer + git add . + git commit -m '${message}' + git push origin HEAD:${branch} + """ + } + } } - collectBuildArtifacts() } } } diff --git a/pom.xml b/pom.xml index c9cc0b1e..eca01d52 100644 --- a/pom.xml +++ b/pom.xml @@ -49,7 +49,6 @@ Stable true UTF-8 - true @@ -295,37 +294,6 @@ - - com.github.github - site-maven-plugin - 0.12 - - - deploy.mojo.description.to.github - site - site-deploy - - update maven plugin mojo description - ${site.path}/${pluginVersion.majorVersion}.${pluginVersion.minorVersion} - - - - deploy.site.redirect.to.github - site - site-deploy - - update maven plugin mojo redirect - ${site.path} - ${project.build.directory}/site-redirect - - - - - github.ivy-team.oauth - true - ${github.site.skip} - - @@ -352,7 +320,7 @@ v@{project.version} release - deploy site-deploy + deploy site