-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: RDAPI-28682 enable Jenkins build and preview (#118)
* RDAPI-28682 build.sh - updated to new version that for use Jenkins and remove netlify references config.toml - cleanup existing hugo configuration page-meta-links.html - cleanup the edit links menu package.json - update to reflect versions used in axway-open-docs * RDAPI-28682 fix minor issue and enable previews on the branch * RDAPI-28682 disable previews on the branch
- Loading branch information
1 parent
641c627
commit a151301
Showing
6 changed files
with
119 additions
and
91 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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// Loads the Jenkins global pipeline library called "axway-dubl-libraries". This | ||
// has to be added by your Jenkins admin. | ||
@Library('axway-dubl-libraries') | ||
|
||
// Previews will always be created by the opendocs.preview() function for pull | ||
// requests and branches called "master" and "main". Add in the names of branches | ||
// you want to generate previews for using the PREVIEW_FOR_BRANCHES variable e.g. | ||
// String PREVIEW_FOR_BRANCHES = "developmay22 developaug22 developnov22" | ||
// String PREVIEW_FOR_BRANCHES = "developmay22,developaug22,developnov22" | ||
String PREVIEW_FOR_BRANCHES = "" | ||
|
||
node('OpendocsBuilder') { | ||
timestamps{ // enable timestamp in the console logs | ||
ansiColor('xterm') { // using ansi colours | ||
properties([ | ||
disableConcurrentBuilds(), | ||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '20', daysToKeepStr: '', numToKeepStr: '20')) | ||
]) | ||
|
||
try { | ||
// Checkout stage | ||
stage('Checkout') { | ||
checkout scm | ||
} | ||
|
||
// Potentially duplicating something already done using github workflows | ||
// but it runs fast. Just delete this stage if you don't need it. | ||
stage ('Markdown Lint') { | ||
opendocs.markdownlint("content/en/**/*.md") | ||
} | ||
|
||
stage ('Build') { | ||
// The build environment uses a default version of hugo. Invoke the opendocs.build | ||
// using the following to override the default version: | ||
// - opendocs.build(HUGO_VERSION, BUILD_COMMAND) | ||
// - opendocs.build("0.103.1", "bash build.sh -m ci") | ||
opendocs.build("bash build.sh -m ci") | ||
} | ||
|
||
stage ('Start Preview') { | ||
opendocs.preview("${PREVIEW_FOR_BRANCHES}") | ||
} | ||
} | ||
catch(Exception e) { | ||
currentBuild.result = "FAILURE" | ||
echo e | ||
} | ||
} | ||
} | ||
} | ||
|
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
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
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 |
---|---|---|
@@ -1,36 +1,21 @@ | ||
{{ if .Path }} | ||
{{ if .File }} | ||
{{ $pathFormatted := replace .File.Path "\\" "/" -}} | ||
{{ $gh_repo := ($.Param "github_repo") }} | ||
{{ $gh_subdir := ($.Param "github_subdir") }} | ||
{{ $gh_project_repo := ($.Param "github_project_repo") }} | ||
{{ if $gh_repo }} | ||
{{ $gh_branch := ($.Param "github_branch") }} | ||
<div class="td-page-meta ml-2 pb-1 pt-2 mb-0"> | ||
{{ $gh_branch := "master" }} | ||
{{ if in (.Site.BaseURL | string) "develop" }} | ||
{{ $gh_branch = "develop"}} | ||
{{ end }} <!-- end of if develop --> | ||
{{ $editURL := printf "%s/edit/%s/content/%s" $gh_repo $gh_branch .Path }} | ||
{{ if and ($gh_subdir) (.Site.Language.Lang) }} | ||
{{ $editURL = printf "%s/edit/%s/%s/content/%s/%s" $gh_repo $gh_branch $gh_subdir ($.Site.Language.Lang) $.Path }} | ||
{{ else if .Site.Language.Lang }} | ||
{{ $editURL = printf "%s/edit/%s/content/%s/%s" $gh_repo $gh_branch ($.Site.Language.Lang) .Path }} | ||
{{ else if $gh_subdir }} | ||
{{ $editURL = printf "%s/edit/%s/%s/content/%s" $gh_repo $gh_branch $gh_subdir $.Path }} | ||
{{ end }} <!-- end of subdir lang conds --> | ||
<a href="{{ $editURL }}" target="_blank"><i class="fa fa-edit fa-fw"></i> {{ T "post_edit_this" }}</a> | ||
{{ $baseURL := strings.TrimSuffix "/" .Site.BaseURL }} | ||
{{ $dir := (split .File.Dir "/") }} | ||
{{ $cms_collection := index $dir 0 }} | ||
{{ with (index $dir 1) }} | ||
{{ $cms_collection = . }} | ||
{{ end }} | ||
{{ with (index $dir 2) }} | ||
{{ $cms_collection = . }} | ||
{{ end }} | ||
{{ with (index $dir 3) }} | ||
{{ $cms_collection = . }} | ||
{{ end }} <!-- end of with --> | ||
{{ $cmsURL := printf "%s/admin/#/edit/%s/%s" $baseURL $cms_collection .File.BaseFileName }} | ||
<a href="{{ $cmsURL }}" target="_blank"><i class="fas fa-columns fa-fw"></i> {{ T "post_edit_cms" }}</a> | ||
{{ if $gh_repo }} | ||
{{ if $gh_branch }} | ||
{{ $editURL := printf "%s/edit/%s/content/%s" $gh_repo $gh_branch $pathFormatted }} | ||
{{ if and ($gh_subdir) (.Site.Language.Lang) }} | ||
{{ $editURL = printf "%s/edit/%s/%s/content/%s/%s" $gh_repo $gh_branch $gh_subdir ($.Site.Language.Lang) $pathFormatted }} | ||
{{ else if .Site.Language.Lang }} | ||
{{ $editURL = printf "%s/edit/%s/content/%s/%s" $gh_repo $gh_branch ($.Site.Language.Lang) $pathFormatted }} | ||
{{ else if $gh_subdir }} | ||
{{ $editURL = printf "%s/edit/%s/%s/content/%s" $gh_repo $gh_branch $gh_subdir $pathFormatted }} | ||
{{ end }} <!-- end of subdir lang conds --> | ||
<a href="{{ $editURL }}" target="_blank"><i class="fa fa-edit fa-fw"></i> {{ T "post_edit_this" }}</a> | ||
{{ end }} <!-- end of if gh_branch --> | ||
{{ end }} <!-- end of if gh_repo --> | ||
</div> | ||
{{ end }} <!-- end of if repo --> | ||
{{ end }} <!-- end if path --> | ||
{{ end }} <!-- end if File --> |
This file was deleted.
Oops, something went wrong.
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