Skip to content
This repository was archived by the owner on Mar 22, 2023. It is now read-only.

Commit 8a14df5

Browse files
authored
Merge pull request #670 from pmem/stable-1.5
Merge stable-1.5 into stable-1.6
2 parents 5a2e015 + dedb204 commit 8a14df5

3 files changed

Lines changed: 75 additions & 15 deletions

File tree

utils/docker/build.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
#
4545

4646
set -e
47+
source $(dirname $0)/valid-branches.sh
4748

4849
# Environment variables that can be customized (default values are after dash):
4950
export KEEP_CONTAINER=${KEEP_CONTAINER:-0}
@@ -93,8 +94,8 @@ fi
9394

9495
if [ -n "$DNS_SERVER" ]; then DNS_SETTING=" --dns=$DNS_SERVER "; fi
9596

96-
# Only run doc update on pmem/libpmemobj-cpp master branch
97-
if [[ "$TRAVIS_BRANCH" != "master" || "$TRAVIS_PULL_REQUEST" != "false" || "$TRAVIS_REPO_SLUG" != "${GITHUB_REPO}" ]]; then
97+
# Only run doc update on $GITHUB_REPO master or stable branch
98+
if [[ -z "${TRAVIS_BRANCH}" || -z "${TARGET_BRANCHES[${TRAVIS_BRANCH}]}" || "$TRAVIS_PULL_REQUEST" != "false" || "$TRAVIS_REPO_SLUG" != "${GITHUB_REPO}" ]]; then
9899
AUTO_DOC_UPDATE=0
99100
fi
100101

utils/docker/run-doc-update.sh

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22
#
3-
# Copyright 2018, Intel Corporation
3+
# Copyright 2018-2020, Intel Corporation
44
#
55
# Redistribution and use in source and binary forms, with or without
66
# modification, are permitted provided that the following conditions
@@ -32,20 +32,33 @@
3232

3333
set -e
3434

35-
ORIGIN="https://${GITHUB_TOKEN}@github.com/pmem-bot/libpmemobj-cpp"
36-
UPSTREAM="https://github.com/pmem/libpmemobj-cpp"
35+
source `dirname $0`/valid-branches.sh
36+
37+
BOT_NAME="pmem-bot"
38+
USER_NAME="pmem"
39+
REPO_NAME="libpmemobj-cpp"
40+
41+
ORIGIN="https://${GITHUB_TOKEN}@github.com/${BOT_NAME}/${REPO_NAME}"
42+
UPSTREAM="https://github.com/pmem/${REPO_NAME}"
43+
# master or stable-* branch
44+
TARGET_BRANCH=${TRAVIS_BRANCH}
45+
VERSION=${TARGET_BRANCHES[$TARGET_BRANCH]}
46+
47+
if [ -z $VERSION ]; then
48+
echo "Target location for branch $TARGET_BRANCH is not defined."
49+
exit 1
50+
fi
3751

3852
# Clone repo
3953
git clone ${ORIGIN}
40-
cd libpmemobj-cpp
54+
cd ${REPO_NAME}
4155
git remote add upstream ${UPSTREAM}
4256

43-
git config --local user.name "pmem-bot"
44-
git config --local user.email "pmem-bot@intel.com"
57+
git config --local user.name ${BOT_NAME}
58+
git config --local user.email "${BOT_NAME}@intel.com"
4559

46-
git checkout master
4760
git remote update
48-
git rebase upstream/master
61+
git checkout -B ${TARGET_BRANCH} upstream/${TARGET_BRANCH}
4962

5063
# Build docs
5164
mkdir build
@@ -58,20 +71,26 @@ cp -R doc/cpp_html ../..
5871
cd ..
5972

6073
# Checkout gh-pages and copy docs
61-
git checkout -fb gh-pages upstream/gh-pages
62-
git clean -df
63-
cp -r ../cpp_html/* master/doxygen/
74+
GH_PAGES_NAME="gh-pages-for-${TARGET_BRANCH}"
75+
git checkout -B $GH_PAGES_NAME upstream/gh-pages
76+
git clean -dfx
77+
78+
# Clean old content, since some files might have been deleted
79+
rm -r ./$VERSION
80+
mkdir -p ./$VERSION/doxygen/
81+
82+
cp -r ../cpp_html/* ./$VERSION/doxygen/
6483

6584
# Add and push changes.
6685
# git commit command may fail if there is nothing to commit.
6786
# In that case we want to force push anyway (there might be open pull request with
6887
# changes which were reverted).
6988
git add -A
7089
git commit -m "doc: automatic gh-pages docs update" && true
71-
git push -f ${ORIGIN} gh-pages
90+
git push -f ${ORIGIN} $GH_PAGES_NAME
7291

7392
# Makes pull request.
7493
# When there is already an open PR or there are no changes an error is thrown, which we ignore.
75-
hub pull-request -f -b pmem:gh-pages -h pmem-bot:gh-pages -m "doc: automatic gh-pages docs update" && true
94+
hub pull-request -f -b ${USER_NAME}:gh-pages -h ${BOT_NAME}:${GH_PAGES_NAME} -m "doc: automatic gh-pages docs update" && true
7695

7796
exit 0

utils/docker/valid-branches.sh

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright 2020, Intel Corporation
4+
#
5+
# Redistribution and use in source and binary forms, with or without
6+
# modification, are permitted provided that the following conditions
7+
# are met:
8+
#
9+
# * Redistributions of source code must retain the above copyright
10+
# notice, this list of conditions and the following disclaimer.
11+
#
12+
# * Redistributions in binary form must reproduce the above copyright
13+
# notice, this list of conditions and the following disclaimer in
14+
# the documentation and/or other materials provided with the
15+
# distribution.
16+
#
17+
# * Neither the name of the copyright holder nor the names of its
18+
# contributors may be used to endorse or promote products derived
19+
# from this software without specific prior written permission.
20+
#
21+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22+
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23+
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24+
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25+
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26+
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27+
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28+
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29+
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32+
33+
declare -A TARGET_BRANCHES=( \
34+
["master"]="master" \
35+
["stable-1.5"]="v1.5" \
36+
["stable-1.6"]="v1.6" \
37+
["stable-1.7"]="v1.7" \
38+
["stable-1.8"]="v1.8" \
39+
["stable-1.9"]="v1.9" \
40+
)

0 commit comments

Comments
 (0)