Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Push builds to github-pages instead of SSH upload #2925

Merged
merged 1 commit into from
May 1, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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