diff --git a/Jenkinsfile b/Jenkinsfile
index 4d21ab20..6f7d711f 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -22,20 +22,56 @@ 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
+ if [ -z `git --no-pager diff` ]; then
+ git add .
+ git commit -m '${message}'
+ git push origin HEAD:gh-pages
+ fi
+ """
+ }
+ }
}
- 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