From a2e3e722af9668cce40246b36210c3f38db6abe7 Mon Sep 17 00:00:00 2001 From: Reguel Wermelinger Date: Fri, 15 Nov 2024 14:53:46 +0100 Subject: [PATCH 1/2] XIVY-15201 craft new site-contents into a single dir --- pom.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0d1c8286..1e6caff2 100644 --- a/pom.xml +++ b/pom.xml @@ -284,7 +284,7 @@ gh-pages.redirect.page - + @@ -341,6 +341,9 @@ + + ${project.build.directory}/site/${site.path}/${pluginVersion.majorVersion}.${pluginVersion.minorVersion} + org.apache.maven.plugins From aa746d2647b34a125a7f56db5b17c9cad05fbc39 Mon Sep 17 00:00:00 2001 From: Reguel Wermelinger Date: Fri, 15 Nov 2024 15:31:52 +0100 Subject: [PATCH 2/2] XIVY-15201 refactor: push pages using scm-publish-plugin --- Jenkinsfile | 27 +++++++++++++++++------ build/release/Jenkinsfile | 2 ++ pom.xml | 45 +++++++++++---------------------------- 3 files changed, 36 insertions(+), 38 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4d21ab20..84cfa2aa 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -12,10 +12,6 @@ pipeline { } parameters { - booleanParam(name: 'skipGitHubSite', - description: 'If checked the plugin documentation on GitHub will NOT be updated', - defaultValue: true) - string(name: 'engineListUrl', description: 'Engine to use for build', defaultValue: 'https://product.ivyteam.io') @@ -27,11 +23,10 @@ pipeline { script { setupGPGEnvironment() withCredentials([string(credentialsId: 'gpg.password', variable: 'GPG_PWD')]) { - def phase = isReleaseOrMasterBranch() ? 'deploy site-deploy' : 'verify' + def phase = isReleaseOrMasterBranch() ? '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" } @@ -39,6 +34,26 @@ pipeline { } } } + stage('deploy-site') { + when { + expression { isReleaseOrMasterBranch() } + } + steps { + script { + 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})" + sh """ + git config --global user.name 'ivy-team' + git config --global user.email 'info@ivyteam.ch' + """ + maven cmd: "site site:stage scm-publish:publish-scm" + } + } + } + } + } } } diff --git a/build/release/Jenkinsfile b/build/release/Jenkinsfile index 0a0f46af..690bbe90 100644 --- a/build/release/Jenkinsfile +++ b/build/release/Jenkinsfile @@ -41,6 +41,8 @@ pipeline { sh "gh auth login --with-token < ${tokenFile}" sh "gh pr create --title '${message}' --body '${message}' --head ${targetBranch} --base ${env.BRANCH_NAME}" } + // publish site from 'mvn release' run + maven cmd: "site:stage scm-publish:publish-scm" } } } diff --git a/pom.xml b/pom.xml index 1e6caff2..fd2aa964 100644 --- a/pom.xml +++ b/pom.xml @@ -49,7 +49,6 @@ Stable true UTF-8 - true @@ -63,6 +62,10 @@ Sonatype Releases Repo https://oss.sonatype.org/content/repositories/releases/ + + github + scm:git:git@github.com:axonivy/project-build-plugin.git + @@ -284,6 +287,9 @@ gh-pages.redirect.page + + + @@ -296,34 +302,12 @@ - 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 - - - + org.apache.maven.plugins + maven-scm-publish-plugin + 3.3.0 - github.ivy-team.oauth - true - ${github.site.skip} + gh-pages + true @@ -341,9 +325,6 @@ - - ${project.build.directory}/site/${site.path}/${pluginVersion.majorVersion}.${pluginVersion.minorVersion} - org.apache.maven.plugins @@ -352,7 +333,7 @@ v@{project.version} release - deploy site-deploy + deploy site