Commit 7aa737e2 authored by Angel Lopez's avatar Angel Lopez
Browse files

Merge branch 'master' into 'master'

Migrate against the latest version of Solstice and set up the Jenkins script

See merge request !2
parents 3539cff1 146f758b
**.DS_Store
/node_modules/
/static/images/vendor/
/static/fonts/vendor/
/static/js/
/static/css/
/public/
/layouts/robots.txt
.idea/**
**/.DS_Store
/.project
/data/eclipsefdn_projects.yaml
\ No newline at end of file
[submodule "themes/hugo-solstice-theme"]
path = themes/hugo-solstice-theme
url = https://github.com/EclipseFdn/hugo-solstice-theme.git
......@@ -5,24 +5,7 @@
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.dltk.core.scriptbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.php.core.PHPNature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
</natures>
</projectDescription>
language: node_js
matrix:
include:
- node_js: 12
install:
- npm install
- wget https://github.com/gohugoio/hugo/releases/download/v0.76.5/hugo_0.76.5_Linux-64bit.deb
- sudo dpkg -i hugo*.deb
script:
- hugo --gc --minify --buildFuture
pipeline {
agent {
kubernetes {
label 'hugo-agent'
yaml """
apiVersion: v1
metadata:
labels:
run: hugo
name: hugo-pod
spec:
containers:
- name: jnlp
volumeMounts:
- mountPath: /home/jenkins/.ssh
name: volume-known-hosts
env:
- name: "HOME"
value: "/home/jenkins"
- name: hugo
image: eclipsecbi/hugo:0.81.0
command:
- cat
tty: true
volumes:
- configMap:
name: known-hosts
name: volume-known-hosts
"""
}
}
environment {
PROJECT_NAME = "opencert" // must be all lowercase.
PROJECT_BOT_NAME = "OpenCert Bot" // Capitalize the name
}
triggers { pollSCM('H/10 * * * *')
}
options {
buildDiscarder(logRotator(numToKeepStr: '5'))
checkoutToSubdirectory('hugo')
}
stages {
stage('Checkout www repo') {
steps {
dir('www') {
sshagent(['git.eclipse.org-bot-ssh']) {
sh '''
git clone ssh://genie.${PROJECT_NAME}@git.eclipse.org:29418/www.eclipse.org/${PROJECT_NAME}.git .
if [ "${BRANCH_NAME}" = "main" ]; then
git checkout master
else
git checkout ${BRANCH_NAME}
fi
'''
}
}
}
}
stage('Build website (main) with Hugo') {
when {
branch 'main'
}
steps {
container('hugo') {
dir('hugo') {
sh 'hugo -b https://www.eclipse.org/${PROJECT_NAME}/'
}
}
}
}
stage('Build website (staging) with Hugo') {
when {
branch 'staging'
}
steps {
container('hugo') {
dir('hugo') {
sh 'hugo -b https://staging.eclipse.org/${PROJECT_NAME}/'
}
}
}
}
stage('Push to $env.BRANCH_NAME branch') {
when {
anyOf {
branch "main"
branch "staging"
}
}
steps {
sh 'rm -rf www/* && cp -Rvf hugo/public/* www/'
dir('www') {
sshagent(['git.eclipse.org-bot-ssh']) {
sh '''
git add -A
if ! git diff --cached --exit-code; then
echo "Changes have been detected, publishing to repo 'www.eclipse.org/${PROJECT_NAME}'"
git config user.email "${PROJECT_NAME}-bot@eclipse.org"
git config user.name "${PROJECT_BOT_NAME}"
git commit -m "Website build ${JOB_NAME}-${BUILD_NUMBER}"
git log --graph --abbrev-commit --date=relative -n 5
if [ "${BRANCH_NAME}" = "main" ]; then
git push origin HEAD:master
else
git push origin HEAD:${BRANCH_NAME}
fi
else
echo "No changes have been detected since last build, nothing to publish"
fi
'''
}
}
}
}
}
}
\ No newline at end of file
pipeline {
agent {
kubernetes {
label 'hugo-agent'
yaml """
apiVersion: v1
metadata:
labels:
run: hugo
name: hugo-pod
spec:
containers:
- name: jnlp
volumeMounts:
- mountPath: /home/jenkins/.ssh
name: volume-known-hosts
env:
- name: "HOME"
value: "/home/jenkins"
- name: hugo
image: eclipsecbi/hugo:0.81.0
command:
- cat
tty: true
volumes:
- configMap:
name: known-hosts
name: volume-known-hosts
"""
}
}
environment {
PROJECT_NAME = "opencert" // must be all lowercase.
PROJECT_BOT_NAME = "OpenCert Bot" // Capitalize the name
}
triggers { pollSCM('H/10 * * * *')
}
options {
buildDiscarder(logRotator(numToKeepStr: '5'))
checkoutToSubdirectory('hugo')
}
stages {
stage('Checkout www repo') {
steps {
dir('www') {
sshagent(['git.eclipse.org-bot-ssh']) {
sh '''
git clone ssh://genie.${PROJECT_NAME}@git.eclipse.org:29418/www.eclipse.org/${PROJECT_NAME}.git .
if [ "${BRANCH_NAME}" = "master" ]; then
git checkout master
else
git checkout ${BRANCH_NAME}
fi
'''
}
}
}
}
stage('Build website (master) with Hugo') {
when {
branch 'master'
}
steps {
container('hugo') {
dir('hugo') {
sh 'hugo -b https://www.eclipse.org/${PROJECT_NAME}/'
}
}
}
}
stage('Build website (staging) with Hugo') {
when {
branch 'staging'
}
steps {
container('hugo') {
dir('hugo') {
sh 'hugo -b https://staging.eclipse.org/${PROJECT_NAME}/'
}
}
}
}
stage('Push to $env.BRANCH_NAME branch') {
when {
anyOf {
branch "master"
branch "staging"
}
}
steps {
sh 'rm -rf www/* && cp -Rvf hugo/public/* www/'
dir('www') {
sshagent(['git.eclipse.org-bot-ssh']) {
sh '''
git add -A
if ! git diff --cached --exit-code; then
echo "Changes have been detected, publishing to repo 'www.eclipse.org/${PROJECT_NAME}'"
git config user.email "${PROJECT_NAME}-bot@eclipse.org"
git config user.name "${PROJECT_BOT_NAME}"
git commit -m "Website build ${JOB_NAME}-${BUILD_NUMBER}"
git log --graph --abbrev-commit --date=relative -n 5
if [ "${BRANCH_NAME}" = "master" ]; then
git push origin HEAD:master
else
git push origin HEAD:${BRANCH_NAME}
fi
else
echo "No changes have been detected since last build, nothing to publish"
fi
'''
}
}
}
}
}
}
\ No newline at end of file
MetaDataFormat = "yaml"
theme = "eclipsefdn-hugo-solstice-theme"
title = "OpenCert"
baseurl = "https://eclipse.org/opencert/"
sectionPagesMenu = "main"
DefaultContentLanguage = "en"
title = "Eclipse Opencert"
theme = "hugo-solstice-theme"
metaDataFormat = "yaml"
disableKinds = []
enableRobotsTXT = true
pluralizeListTitles = false
[params]
#sectionPagesMenu = "main"
[Params]
google_tag_manager = "GTM-5WLCZXC"
description = "The OpenCert project"
logo = "images/logo.png"
favicon = "images/logo_square.png"
seo_title_suffix = " | The Eclipse Foundation"
description = "The Eclipse OpenCert Tools Platform integrates contributions from different open source projects"
seo_title_suffix = " | The Eclipse OpenCert"
keywords = ["eclipse", "project", "polarsys", "amass", "assurance", "certification", "Cyber-Physical Systems", "CPS"]
news_count = 3
# gcse = "011805775785170369411:p3ec0igo0qq"
header_wrapper_class = "header-wrapper header-default-bg-img featured-jumbotron-bottom-shape"
call_for_action_text = "Download"
call_for_action_url = "https://polarsys.org/opencert/downloads"
call_for_action_url = "https://projects.eclipse.org/projects/polarsys.opencert/governance"
call_for_action_icon = "fa-download"
# sidebar_layout = "default"
# featured_content_publish_target = "eclipse_org"
# js = ""
# styles = ""
logo = "images/logo.png"
favicon = "images/logo_square.png"
# share_img = ""
# logo_width = ""
# header_left_classes = ""
# main_menu_wrapper_classes = ""
# projects_working_group = ""
[taxonomies]
[Author]
name = "Eclipse Foundation and the AMASS ECSEL project partners"
name = "AMASS ECSEL project partners"
website = "https://www.amass-ecsel.eu/"
email = "opencert-dev@polarsys.org"
email = "opencert-dev@eclipse.org"
twitter = "AMASSproject"
youtube = "UCw_D0l5sDgysEphi6tzzDyw"
linkedin = "groups/3807241/"
......
---
title: "Eclipse OpenCert"
date: 2021-06-21T16:09:45-04:00
#headline: ""
#tagline: ""
hide_page_title: true
#hide_sidebar: true
#hide_breadcrumb: true
#show_featured_story: true
#layout: "single"
#links: [[href: "/projects/", text: "Projects"],[href: "/org/workinggroups/", text: "Working Group"],[href: "/membership/", text: "Members"],[href: "/org/value", text: "Business Value"]]
#container: "container-fluid"
---
......@@ -4,7 +4,7 @@ title: PolarSys OpenCert
type: index
---
The PolarSys OpenCert Tools Platform integrates contributions from different open source projects
The Eclipse OpenCert Tools Platform integrates contributions from different open source projects
<div id="opencert_carousel" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment