FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
pom-scijava/.github/publish.sh at master · scijava/pom-scijava · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
scijava
/
pom-scijava
Public
Notifications
You must be signed in to change notification settings
Fork
35
Star
28
Code
Issues
8
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
pom-scijava
/
.github
/
publish.sh
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
50 lines (43 loc) · 1.3 KB
Breadcrumbs
pom-scijava
/
.github
/
publish.sh
Copy path
File metadata and controls
executable file
·
50 lines (43 loc) · 1.3 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
39
40
41
42
43
44
45
46
47
48
49
50
#!
/bin/sh
#
Commit a file to the status.scijava.org gh-pages branch.
#
Requires SSH agent to be running with write access to status.scijava.org.
set
-e
test
$#
-gt 1
||
{
echo
"
Usage: publish.sh
\"
Commit message
\"
file1 [file2 ...]
"
exit
2
}
datestamp=
"
$(
TZ=UTC date +
'
%Y-%m-%d %H:%M:%S UTC
'
)
"
message=
"
$1
(
$datestamp
)
"
shift
git config --global user.name
"
SciJava CI
"
git config --global user.email ci@scijava.org
dest_dir=site-publish
git clone --depth=1 --branch=gh-pages git@github.com:scijava/status.scijava.org
"
$dest_dir
"
while
[
$#
-gt
0 ]
do
file=
$1
shift
test
-f
"
$file
"
||
{
echo
"
File not found:
$file
"
>&2
;
exit
1
;
}
dest=
$(
basename
"
$file
"
)
cp
"
$file
"
"
$dest_dir
/
$dest
"
(cd
"
$dest_dir
"
&&
git add
"
$dest
"
)
done
cd
"
$dest_dir
"
#
Check staged changes (--cached): the files above were already `git add`ed, so
#
a plain `git diff` would see an always-clean working tree and never commit.
if
git diff --cached --quiet
then
echo
"
== No changes ==
"
else
echo
"
== Committing changes ==
"
git commit -m
"
$message
"
#
Retry against concurrent publishers (the build and status workflows both
#
push here), rebasing onto whatever landed in between.
n=0
until
git push
do
n=
$((
n
+
1
))
test
"
$n
"
-lt 5
||
{
echo
"
push failed after
$n
attempts
"
>&2
;
exit
1
;
}
git pull --rebase
done
fi
Back
|
FazBrowse Home
|
New Git URL