]>
git.proxmox.com Git - ceph.git/blob - ceph/src/pmdk/utils/docker/run-doc-update.sh
2 # SPDX-License-Identifier: BSD-3-Clause
3 # Copyright 2019-2020, Intel Corporation
7 source `dirname $0`/valid-branches.sh
13 ORIGIN
="https://${DOC_UPDATE_GITHUB_TOKEN}@github.com/${BOT_NAME}/${REPO_NAME}"
14 UPSTREAM
="https://github.com/${USER_NAME}/${REPO_NAME}"
15 # master or stable-* branch
16 TARGET_BRANCH
=${CI_BRANCH}
17 VERSION
=${TARGET_BRANCHES[$TARGET_BRANCH]}
19 if [ -z $VERSION ]; then
20 echo "Target location for branch $TARGET_BRANCH is not defined."
27 git remote add upstream
${UPSTREAM}
29 git config
--local user.name
${BOT_NAME}
30 git config
--local user.email
"pmem-bot@intel.com"
33 git checkout
-B ${TARGET_BRANCH} upstream
/${TARGET_BRANCH}
35 # Copy man & PR web md
40 mv .
/doc
/web_linux ..
/
41 mv .
/doc
/web_windows ..
/
42 mv .
/doc
/generated
/libs_map.yml ..
/
44 # Checkout gh-pages and copy docs
45 GH_PAGES_NAME
="gh-pages-for-${TARGET_BRANCH}"
46 git checkout
-B $GH_PAGES_NAME upstream
/gh-pages
49 rsync
-a ..
/web_linux
/ .
/manpages
/linux
/${VERSION}/
50 rsync
-a ..
/web_windows
/ .
/manpages
/windows
/${VERSION}/ \
51 --exclude='librpmem' \
52 --exclude='rpmemd' --exclude='pmreorder' \
58 if [ $TARGET_BRANCH = "master" ]; then
59 [ ! -d _data
] && mkdir _data
60 cp ..
/libs_map.yml _data
63 # Add and push changes.
64 # git commit command may fail if there is nothing to commit.
65 # In that case we want to force push anyway (there might be open pull request
66 # with changes which were reverted).
68 git commit
-m "doc: automatic gh-pages docs update" && true
69 git push
-f ${ORIGIN} $GH_PAGES_NAME
71 GITHUB_TOKEN
=${DOC_UPDATE_GITHUB_TOKEN} hub pull-request
-f \
72 -b ${USER_NAME}:gh-pages \
73 -h ${BOT_NAME}:${GH_PAGES_NAME} \
74 -m "doc: automatic gh-pages docs update" && true