Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ site/
site-source/
junit-pioneer/
junit-pioneer
test-reports/
test-reports
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
# JUnit Pioneer Site

The site for the [JUnit Pioneer organization][pioneer-org] and all its projects.
There is currently only one (also called [JUnit Pioneer][pioneer]) but this repository is set up to host many more.
It is set up to host various related projects:

* [JUnit Pioneer][pioneer] (yes, it's also the name of a project)
* [Test Reports][reports]

[pioneer-org]: https://github.com/junit-pioneer
[pioneer]: https://github.com/junit-pioneer/junit-pioneer
[reports]: https://github.com/junit-pioneer/test-reports


## Structure
Expand Down
25 changes: 21 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ task setup {

task removeProjectPage(type: Delete) {
delete fileTree('site-source/_pages') {
include 'xp.*'
include 'xp.*', 'tr.*'
}
}

task removeDocs(type: Delete) {
delete 'site-source/_docs/xp'
delete 'site-source/_docs/xp', 'site-source/_docs/tr'
}

task removeDocNav() {
Expand All @@ -58,6 +58,7 @@ task removeDocNav() {
String fullNav = nav.getText()
String removedNav = fullNav
.replaceAll(/(?m)# @xp:start$\s(^[\D\d]*$\s)*^# @xp:end/, "# @xp:toc")
.replaceAll(/(?m)# @tr:start$\s(^[\D\d]*$\s)*^# @tr:end/, "# @tr:toc")
nav.setText(removedNav)
}
}
Expand Down Expand Up @@ -93,25 +94,41 @@ task copyPioneerDocs(type: Copy) {
into 'site-source/_docs/xp'
}

task copyTestReportProjectPage(type: Copy) {
from 'test-reports/docs/'
include 'project-page.*'
rename 'project-page.adoc', 'tr.adoc'
into 'site-source/_pages'
}

task copyTestReportDocs(type: Copy) {
from 'test-reports/docs'
exclude 'project-page.*', 'docs-nav.yml'
into 'site-source/_docs/tr'
}

task insertDocNav() {
doLast {
description 'Inserts specific lines into _data/naviation.yml'
File navTarget = file('site-source/_data/navigation.yml')
String emptyNav = navTarget.getText()

String xpNavContent = file('junit-pioneer/docs/docs-nav.yml').getText()
String trNavContent = file('test-reports/docs/docs-nav.yml').getText()
String fullNav = emptyNav
.replaceAll(/(?m)# @xp:toc/, "# @xp:start\n${xpNavContent}# @xp:end")
.replaceAll(/(?m)# @tr:toc/, "# @tr:start\n${trNavContent}# @tr:end")

navTarget.setText(fullNav)
}
}

task insertVersion() {
dependsOn copyPioneerProjectPage
dependsOn copyPioneerProjectPage, copyTestReportProjectPage
doLast {
description 'Inserts current versions into about pages'
insertProjectVersion('junit-pioneer', 'xp')
insertProjectVersion('test-reports', 'tr')
}
}

Expand Down Expand Up @@ -139,7 +156,7 @@ task insertXpIntoHome() {
}

task create {
dependsOn copyPioneerProjectPage, copyPioneerDocs, insertDocNav, insertVersion, insertXpIntoHome
dependsOn copyPioneerProjectPage, copyPioneerDocs, copyTestReportProjectPage, copyTestReportDocs, insertDocNav, insertVersion, insertXpIntoHome
}

// -----
Expand Down
6 changes: 4 additions & 2 deletions git-commit-push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ cd site-source
SOURCE_HASH="$(git rev-parse --short HEAD)"
cd ../junit-pioneer
XP_HASH="$(git rev-parse --short HEAD)"
cd ../test-reports
TR_HASH="$(git rev-parse --short HEAD)"
cd ..

# now commit and push
cd site
git add --all
# echo "Update to source $SOURCE_HASH, xp $XP_HASH"
git commit -m "Update to source $SOURCE_HASH, xp $XP_HASH"
# echo "Update to source $SOURCE_HASH, xp $XP_HASH, tr $TR_HASH"
git commit -m "Update to source $SOURCE_HASH, xp $XP_HASH, tr $TR_HASH"
git push
3 changes: 2 additions & 1 deletion git-repo-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
# exit with nonzero exit code if anything fails
set -e

# cloning `junit-pioneer`
# cloning projects
git clone https://github.com/junit-pioneer/junit-pioneer.git junit-pioneer --depth=10
git clone https://github.com/junit-pioneer/test-reports.git test-reports --depth=10
# adding worktrees `site` and `site-source`
git checkout master
git checkout site-source
Expand Down