FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
docs/hack/sync-cli-docs.sh at main · docker/docs · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
docker
/
docs
Public
Notifications
You must be signed in to change notification settings
Fork
8.4k
Star
4.6k
Code
Issues
68
Pull requests
189
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
docs
/
hack
/
sync-cli-docs.sh
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
38 lines (28 loc) · 1.17 KB
Breadcrumbs
docs
/
hack
/
sync-cli-docs.sh
Copy path
File metadata and controls
executable file
·
38 lines (28 loc) · 1.17 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
26
27
28
29
30
31
32
33
34
35
36
37
38
#!
/bin/bash
set
-euo pipefail
main
() {
local
branch_name=
"
${1
:-
upstream
/
master}
"
local
cli_source=
"
${2
:-
$HOME
/
src
/
cli}
/.git
"
local
worktree_dir=
"
./internal-update-cli-docs
"
(
set
-e
GIT_DIR=
"
$cli_source
"
GIT_DIR=
"
$GIT_DIR
"
git fetch upstream
GIT_DIR=
"
$GIT_DIR
"
git worktree add
"
$worktree_dir
"
"
$branch_name
"
)
||
return
$?
trap
"
GIT_DIR=
\"
$cli_source
\"
git worktree remove
\"
$worktree_dir
\"
--force 2>/dev/null || true
"
EXIT
(set -e
;
cd
"
$worktree_dir
"
;
make -f docker.Makefile yamldocs
||
{
printf
"
::error::Failed to generate YAML docs!\n
"
;
exit
1
;
})
||
return
$?
cp
"
$worktree_dir
"
/docs/yaml/
*
.yaml ./data/cli/engine/
if
git diff --quiet
"
./data/cli/engine/*.yaml
"
;
then
printf
"
\e[32m✅ Already up to date\e[0m\n
"
return
100
fi
echo
-e
"
ℹ️ Changes detected:
"
git diff --stat
"
./data/cli/engine/*.yaml
"
||
true
NICE_GIT_REF=
$(
cd
"
$worktree_dir
"
&&
git describe --always --dirty
)
||
return
$?
git add
"
./data/cli/engine/*.yaml
"
git commit -m
"
cli: sync docs with docker/cli
$NICE_GIT_REF
"
printf
"
\e[32m✅ Committed changes\e[0m\n
"
return
0
}
main
"
$@
"
Back
|
FazBrowse Home
|
New Git URL