File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
3
function parse_args() {
4
+ force_pull=false
4
5
5
- while getopts " hl:" opt; do
6
+ while getopts " hl:f " opt; do
6
7
case " $opt " in
7
8
h)
8
9
# Display the usage information and exit when -h is provided
9
- echo " Usage: $0 [-l path_to_local_clickhouse_repo]"
10
+ echo " Usage: $0 [-l path_to_local_clickhouse_repo] [-f] "
10
11
echo " "
11
12
echo " Options:"
12
13
echo " -l Path to a local copy of the ClickHouse repository."
14
+ echo " -f Force pull from GitHub even in CI environment."
13
15
echo " -h Display this help message."
14
16
exit 0
15
17
;;
16
18
l)
17
19
local_path=" $OPTARG "
18
20
;;
21
+ f)
22
+ force_pull=true
23
+ ;;
19
24
\? )
20
25
echo " Invalid option: -$OPTARG " >&2
21
26
exit 1
22
27
;;
23
28
esac
24
29
done
25
-
26
- echo " $local_path "
27
30
}
28
31
29
32
# Copy files/folders using rsync (or fallback to cp)
@@ -100,10 +103,14 @@ main() {
100
103
101
104
if [[ -z " $local_path " ]]; then
102
105
103
- if [[ " $CI " == " true" ]]; then
106
+ # Check if in CI environment and force_pull is not set
107
+ if [[ " $CI " == " true" && " $force_pull " == " false" ]]; then
104
108
echo " CI environment detected, expecting /ClickHouse without having to pull the repo"
105
109
copy_docs_locally " /ClickHouse"
106
110
else
111
+ if [[ " $force_pull " == " true" && " $CI " == " true" ]]; then
112
+ echo " Force pull enabled, ignoring CI environment and pulling from GitHub"
113
+ fi
107
114
git clone --depth 1 --branch master https://github.com/ClickHouse/ClickHouse
108
115
# Copy docs from cloned repository
109
116
copy_docs_locally " $( pwd) /ClickHouse"
You can’t perform that action at this time.
0 commit comments