aboutsummaryrefslogtreecommitdiffstats
path: root/jjb/daily-jjb-doc-update/include-doc-upload.sh
blob: 731a122a7d3fe580c8cbb7a21ef8302ad13cfb95 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash

set -e
set -x

[[ -z "$WORKSPACE" ]] && WORKSPACE=$(pwd -P)
HTDOCS=${HTDOCS:-$WORKSPACE/docs-webtemplate/build-dev/}
TMPDIR=${TMPDIR:-$WORKSPACE/upload-gh}

# publish the docs

ssh-keyscan -H github.com >> ~/.ssh/known_hosts

mkdir -p $TMPDIR
git clone -b gh-pages git@github.com:automotive-grade-linux/docs-gh-pages.git $TMPDIR/upload-gh-pages
mkdir -p $TMPDIR/upload-gh-pages/next/
cp -ar $HTDOCS/* $TMPDIR/upload-gh-pages/next/
pushd $TMPDIR/upload-gh-pages
    git config user.name build.automotivelinux.org
    git config user.email jenkins@automotivelinux.org
    git diff
    git add .
    git commit --amend -m"Render: $(date)"
    git push origin gh-pages:gh-pages -f
popd