Repository: sling-site Updated Branches: refs/heads/master 1c927c34f -> 364881800
SLING-7178 - Allow publishing the Sling site using Maven Add a -Prun-site profile, update documentation. Project: http://git-wip-us.apache.org/repos/asf/sling-site/repo Commit: http://git-wip-us.apache.org/repos/asf/sling-site/commit/36488180 Tree: http://git-wip-us.apache.org/repos/asf/sling-site/tree/36488180 Diff: http://git-wip-us.apache.org/repos/asf/sling-site/diff/36488180 Branch: refs/heads/master Commit: 36488180096e3601dd4cf7011fe9ddf160295b29 Parents: 1c927c3 Author: Robert Munteanu <[email protected]> Authored: Thu Oct 5 11:36:51 2017 +0300 Committer: Robert Munteanu <[email protected]> Committed: Thu Oct 5 11:36:51 2017 +0300 ---------------------------------------------------------------------- README.md | 23 ++++------------------- pom.xml | 32 ++++++++++++++++++++++++++------ 2 files changed, 30 insertions(+), 25 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/sling-site/blob/36488180/README.md ---------------------------------------------------------------------- diff --git a/README.md b/README.md index 39db70f..4370479 100644 --- a/README.md +++ b/README.md @@ -5,36 +5,21 @@ the Apache CMS to this JBake-generated site. ## How to build and stage the site locally Clone this repository, run the below Maven command, open http://localhost:8820/ and enjoy. - mvn clean package jbake:inline -Djbake.port=8820 -Djbake.listenAddress=0.0.0.0 + mvn clean package -Prun-site This allows you to experiment with your changes before eventually publishing them. ## How to publish the website Clone this repository and run the below commands or equivalent: - git checkout master - - # Build the site + # Build the site and review your changes mvn clean package - # Move aside the generated pages - mv target/sling-site-* /tmp/slingsite - - # Switch to the live branch and sync - git checkout asf-site - git pull origin asf-site - rsync -r /tmp/slingsite/* . - - # At this point, git diff as needed to verify - # what you're about to publish the The Whole Internet - # and then - git commit -a -m "<put something clever here>" - git push origin asf-site + # deploy the site + mvn clean package -Ppublish-site The [ASF's gitpubsub mechanism](https://blogs.apache.org/infra/entry/git_based_websites_available) then synchronizes that content to http://sling.apache.org , usually within a few seconds. -It would be nice to automate this in a Jenkins build...patches welcome! - ## Variables in page content Adding `expandVariables=true` to a page's front matter enables simple variables replacement, see the `pageVariables` map in templates code for which variables are supported or to add more variables. A pattern like `${sling_tagline}` in page content http://git-wip-us.apache.org/repos/asf/sling-site/blob/36488180/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index b413786..08d5bfc 100644 --- a/pom.xml +++ b/pom.xml @@ -104,7 +104,7 @@ <version>1.1</version> <extensions>true</extensions> <configuration> - <content>target/${artifactId}-${version}</content> + <content>target/${project.artifactId}-${project.version}</content> <checkinComment>Automatic publish of sling site</checkinComment> <pubScmUrl>scm:git:https://git-wip-us.apache.org/repos/asf/sling-site.git</pubScmUrl> <scmBranch>asf-site-staging</scmBranch> @@ -113,11 +113,7 @@ </plugins> </build> - <!-- TODO - - removed files: res/css/codehilite.css, README.md, .gitignore (needed?) - - many line endings changed - --> - <profiles> + <profiles> <profile> <id>publish-site</id> <build> @@ -138,6 +134,30 @@ </plugins> </build> </profile> + <profile> + <id>run-site</id> + <build> + <plugins> + <plugin> + <groupId>org.jbake</groupId> + <artifactId>jbake-maven-plugin</artifactId> + <executions> + <execution> + <id>run-site</id> + <phase>package</phase> + <goals> + <goal>inline</goal> + </goals> + <configuration> + <port>8820</port> + <listenAddress>0.0.0.0</listenAddress> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> </profiles> </project>
