Skip to content

Commit

Permalink
Push builds to github-pages instead of SSH upload (modelica#2925)
Browse files Browse the repository at this point in the history
  • Loading branch information
sjoelund committed May 1, 2021
1 parent 4103f30 commit 7d509cf
Showing 1 changed file with 30 additions and 2 deletions.
32 changes: 30 additions & 2 deletions .CI/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ pipeline {
anyOf {
buildingTag()
anyOf {
branch 'jenkins'
branch 'master'
branch 'maint/**'
}
Expand All @@ -86,7 +87,21 @@ pipeline {
steps {
unstash name: 'MLS'
sh "test ! -z ${env.GIT_BRANCH}"
sshPublisher(publishers: [sshPublisherDesc(configName: 'ModelicaSpecification', transfers: [sshTransfer(remoteDirectory: "${env.GIT_BRANCH}", sourceFiles: '*.html,*.css,*.js,MLS.pdf,media/**,css/**')])])
sshagent (credentials: ['Hudson-SSH-Key']) {
sh 'ssh-keyscan github.com >> ~/.ssh/known_hosts'
sh "test -d specification.modelica.org || git clone git@github.com:modelica/specification.modelica.org"
sh "cd specification.modelica.org/ && git fetch && git reset --hard origin/master"
sh "rm -rf 'specification.modelica.org/${env.GIT_BRANCH}' && mkdir -p 'specification.modelica.org/${env.GIT_BRANCH}'"
sh "cp -a *.html *.css *.js MLS.pdf media css 'specification.modelica.org/${env.GIT_BRANCH}'"
sh """
cd specification.modelica.org
git add '${env.GIT_BRANCH}'
if ! git diff-index --quiet origin/master --; then
git commit --amend -m "Initial commit"
git push -f
fi
"""
}
}
}
stage('index') {
Expand All @@ -108,7 +123,20 @@ pipeline {
}
steps {
sh 'python3 .CI/index.py'
sshPublisher(publishers: [sshPublisherDesc(configName: 'ModelicaSpecification', transfers: [sshTransfer(sourceFiles: 'index.html')])])
sshagent (credentials: ['Hudson-SSH-Key']) {
sh 'ssh-keyscan github.com >> ~/.ssh/known_hosts'
sh "test -d specification.modelica.org || git clone git@github.com:modelica/specification.modelica.org"
sh "cd specification.modelica.org/ && git fetch && git reset --hard origin/master"
sh "cp -a index.html specification.modelica.org/"
sh """
cd specification.modelica.org
git add index.html
if ! git diff-index --quiet origin/master --; then
git commit --amend -m "Initial commit"
git push -f
fi
"""
}
}
}
}
Expand Down

0 comments on commit 7d509cf

Please sign in to comment.