-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
XIVY-15201 push pages using native GIT cli
- Loading branch information
Showing
2 changed files
with
48 additions
and
44 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -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 '[email protected]' | ||
#gh auth login --with-token < ${tokenFile} | ||
git clone -b gh-pages [email protected]: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() | ||
} | ||
} | ||
} | ||
|
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