diff --git a/.gitignore b/.gitignore index 201c9b9..f2615ff 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ public/ -pagefind \ No newline at end of file +pagefind +.hugo_build.lock diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..5febab9 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,61 @@ +pipeline { + agent { label 'web2' } + environment { + GITHUB_TOKEN = credentials('site_pr_builder') + STAGING_PATH = "/var/www/staging.osuosl.org/htdocs" + PRODUCTION_PATH = "/var/www/new.osuosl.org/htdocs" + } + stages { + stage('Checkout') { + steps { + checkout scm + } + } + stage('Build Hugo Site') { + steps { + script { + sh 'hugo --minify' // Build the Hugo site for all branches + } + } + } + stage('Deploy Site') { + steps { + script { + if (env.BRANCH_NAME == 'main') { + // Deploy to production when the branch is 'main' + sh """ + rsync -avH --delete public/ ${PRODUCTION_PATH}/ + """ + } else if (env.CHANGE_ID) { + // Deploy to a staging directory based on the PR number + def stagingPath = "${STAGING_PATH}/osuosl-website-${env.CHANGE_ID}" + sh """ + rsync -avH --delete public/ ${stagingPath}/ + """ + } else { + echo "Not a PR or main branch, skipping deployment" + } + } + } + } + } + post { + always { + script { + def siteUrl = "" + if (env.BRANCH_NAME == 'main') { + siteUrl = "https://new.osuosl.org/" + } else if (env.CHANGE_ID) { + siteUrl = "https://osuosl-website-${env.CHANGE_ID}.staging.osuosl.org/" + } + + // Post build status with a link to the site + githubNotify context: 'Built site URL', + description: 'Build completed', + status: currentBuild.result, + targetUrl: "${siteUrl}", + message: "Site available: ${siteUrl}" + } + } + } +} diff --git a/content/blog/bbc17.md b/content/blog/bbc17.md index e272f42..ed1d963 100644 --- a/content/blog/bbc17.md +++ b/content/blog/bbc17.md @@ -1,6 +1,6 @@ --- title: "Beaver BarCamp 17: New Horizons" -date: 2017-05-9 +date: 2017-05-09 authors: ["Amanda Kelner"] slug: bbc17 --- @@ -69,4 +69,4 @@ broader range of sessions. If you have suggestions or would like to let us know what you thought of BarCamp or if you weren’t able to make it this year and would like to let us know how to make it easier for you to attend, fill out our [feedback survey](https://docs.google.com/forms/d/e/1FAIpQLSfY9BvXSNlniy0DJle3Dr3xQ54gpCaGSW_Xk-mjWxXTGusqng/viewform?usp=sf_link) -so the improvements we make next year will help everyone get the most out of BarCamp. \ No newline at end of file +so the improvements we make next year will help everyone get the most out of BarCamp. diff --git a/content/blog/connecting-at-beaver-barcamp-12.md b/content/blog/connecting-at-beaver-barcamp-12.md index 7265fd4..752db53 100644 --- a/content/blog/connecting-at-beaver-barcamp-12.md +++ b/content/blog/connecting-at-beaver-barcamp-12.md @@ -1,6 +1,6 @@ --- title: Connecting at Beaver BarCamp 12 -date: 2013-10-17 17:56 +date: 2013-10-17 authors: ["Melissa"] slug: connecting-at-beaver-barcamp-12 --- @@ -67,4 +67,4 @@ BarCamp for the first time and participated in PowerPoint karaoke. ![Beaver Bar Camp](/images/bbc12-blog-post.jpg#blog-center) *“I'd heard about PowerPoint karaoke but didn't quite know what to expect,” says -Earl. “It was a fun time and a good chance to practice speaking skills.”* \ No newline at end of file +Earl. “It was a fun time and a good chance to practice speaking skills.”* diff --git a/content/blog/open-source-bridge-promotes-community.md b/content/blog/open-source-bridge-promotes-community.md index 7b1860f..b08397e 100644 --- a/content/blog/open-source-bridge-promotes-community.md +++ b/content/blog/open-source-bridge-promotes-community.md @@ -1,6 +1,6 @@ --- title: Open Source Bridge Promotes Community -date: 2013-06-24 21:54 +date: 2013-06-24 authors: ["Melissa Morse"] slug: open-source-bridge-promotes-community --- diff --git a/content/blog/openstack-on-openpower.md b/content/blog/openstack-on-openpower.md index 1eb2f5b..0bbded0 100644 --- a/content/blog/openstack-on-openpower.md +++ b/content/blog/openstack-on-openpower.md @@ -1,6 +1,6 @@ --- title: OpenStack on OpenPOWER -date: 2014-04-23 12:45 +date: 2014-04-23 authors: ["ramereth"] slug: openstack-on-openpower --- diff --git a/content/blog/openstacks-horizon.md b/content/blog/openstacks-horizon.md index cb1df6b..52c47f6 100644 --- a/content/blog/openstacks-horizon.md +++ b/content/blog/openstacks-horizon.md @@ -1,6 +1,6 @@ --- title: Openstack's Horizon -date: 2014-02-20 22:32 +date: 2014-02-20 authors: ["Melissa"] slug: openstacks-horizon --- diff --git a/content/blog/osl-announces-10-year-celebration-attends-oscon.md b/content/blog/osl-announces-10-year-celebration-attends-oscon.md index e7a8e37..67c061e 100644 --- a/content/blog/osl-announces-10-year-celebration-attends-oscon.md +++ b/content/blog/osl-announces-10-year-celebration-attends-oscon.md @@ -1,6 +1,6 @@ --- title: "OSL Announces 10 year Celebration; Attends OSCON" -date: 2013-07-30 21:03 +date: 2013-07-30 authors: ["Melissa"] slug: osl-announces-10-year-celebration-attends-oscon --- diff --git a/content/blog/osl-staff-mentors-international-students-through-google-summer-of-code.md b/content/blog/osl-staff-mentors-international-students-through-google-summer-of-code.md index 4539691..3de0a5c 100644 --- a/content/blog/osl-staff-mentors-international-students-through-google-summer-of-code.md +++ b/content/blog/osl-staff-mentors-international-students-through-google-summer-of-code.md @@ -1,6 +1,6 @@ --- title: OSL Staff Mentors International Students Through Google Summer of Code -date: 2013-02-11 23:57 +date: 2013-02-11 authors: ["Kayla Harr"] slug: osl-staff-mentors-international-students-through-google-summer-of-code --- diff --git a/content/blog/osl-to-mentor-four-in-google-summer-of-code.md b/content/blog/osl-to-mentor-four-in-google-summer-of-code.md index 941a491..08c97f2 100644 --- a/content/blog/osl-to-mentor-four-in-google-summer-of-code.md +++ b/content/blog/osl-to-mentor-four-in-google-summer-of-code.md @@ -1,6 +1,6 @@ --- title: OSL to Mentor Four in Google Summer of Code -date: 2013-06-05 20:11 +date: 2013-06-05 authors: ["Kayla Harr"] slug: osl-to-mentor-four-in-google-summer-of-code ---