You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mynewt.apache.org by todd mitton <mi...@runtime.io> on 2016/02/06 01:36:29 UTC

Automate http://mynewt.incubator.apache.org generation

Hi,

Here's a simple script to automate the generation of the static content for
http://mynewt.incubator.apache.org. It basically captures the steps Aditi
takes when updating the site.

Thanks,
-Todd


diff --git a/build.sh b/build.sh
new file mode 100755
index 0000000..f810ac8
--- /dev/null
+++ b/build.sh
@@ -0,0 +1,34 @@
+#!/bin/bash -e
+
+if [[ "$1" != "build"  ]]; then
+    echo "Build the mynewt website"
+    echo "Make sure git status is claen and run from the master branch"
+    echo
+    echo "Usage: $0 build"
+    exit
+fi
+
+echo mkdocs clean build:
+mkdocs build --clean
+
+echo Remove unwanted html templates
+find site -name "*.html" | xargs grep '{%.*%}' -l | xargs rm
+
+echo Copy extras into site
+cp -a extras/ site/
+
+echo Change git branch to asf-site
+git checkout asf-site
+
+echo Remove old content
+ls | grep -v site | xargs rm -rf
+
+echo Copy contents of site directory for serving
+cp -a site/ .
+
+echo ---
+echo --- You are now on the asf-site branch
+echo --- Review git diffs before commiting
+echo ---
+git status
+

Re: Automate http://mynewt.incubator.apache.org generation

Posted by Justin Mclean <ju...@classsoftware.com>.
Hi,

>> +echo Remove unwanted html templates
>> +find site -name "*.html" | xargs grep '{%.*%}' -l | xargs rm

Nice didn’t think of doing it that way, I had forgotten about xargs

I would normally do:
find site -name "*.html" -exec rm {} \;

Or  even:
find site -name “*.html” -delete

Thanks,
Justin


Re: Automate http://mynewt.incubator.apache.org generation

Posted by aditi hilbert <ad...@runtime.io>.
I would love this to be added to the incubator-mynewt-site.git repo (master) as soon as possible, of course :) 

thanks,
aditi

> On Feb 5, 2016, at 4:36 PM, todd mitton <mi...@runtime.io> wrote:
> 
> Hi,
> 
> Here's a simple script to automate the generation of the static content for
> http://mynewt.incubator.apache.org. It basically captures the steps Aditi
> takes when updating the site.
> 
> Thanks,
> -Todd
> 
> 
> diff --git a/build.sh b/build.sh
> new file mode 100755
> index 0000000..f810ac8
> --- /dev/null
> +++ b/build.sh
> @@ -0,0 +1,34 @@
> +#!/bin/bash -e
> +
> +if [[ "$1" != "build"  ]]; then
> +    echo "Build the mynewt website"
> +    echo "Make sure git status is claen and run from the master branch"
> +    echo
> +    echo "Usage: $0 build"
> +    exit
> +fi
> +
> +echo mkdocs clean build:
> +mkdocs build --clean
> +
> +echo Remove unwanted html templates
> +find site -name "*.html" | xargs grep '{%.*%}' -l | xargs rm
> +
> +echo Copy extras into site
> +cp -a extras/ site/
> +
> +echo Change git branch to asf-site
> +git checkout asf-site
> +
> +echo Remove old content
> +ls | grep -v site | xargs rm -rf
> +
> +echo Copy contents of site directory for serving
> +cp -a site/ .
> +
> +echo ---
> +echo --- You are now on the asf-site branch
> +echo --- Review git diffs before commiting
> +echo ---
> +git status
> +