Skip to content

Commit abc3725

Browse files
committed
Generalize CI javadoc build script
It should have no explicit dependence on GitHub Actions. This change removes the SSH configuration, in favor of assuming it has been set up externally. While we're at it: update slim-curve -> flimlib.
1 parent 2a324eb commit abc3725

File tree

1 file changed

+5
-16
lines changed

1 file changed

+5
-16
lines changed

github-javadoc.sh renamed to ci-javadoc.sh

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
#!/bin/bash
22

33
#
4-
# github-javadoc.sh - A script to build the javadocs of a SciJava-based project.
4+
# ci-build.sh - A script to build the javadocs of SciJava-based projects
5+
# automatically using a continuous integration service.
56
#
67

78
# The following repositories are known to use this script:
89
#
910
# bonej-org/bonej-javadoc
1011
# fiji/fiji-javadoc
12+
# flimlib/flimlib-javadoc
1113
# imagej/imagej-javadoc
1214
# imglib/imglib2-javadoc
1315
# scifio/scifio-javadoc
1416
# scijava/java3d-javadoc
1517
# scijava/scijava-javadoc
16-
# slim-curve/slim-javadoc
1718
# uw-loci/loci-javadoc
1819

1920
# Wait for a launched background command to complete, emitting
@@ -42,15 +43,9 @@ ciRepo=${ciURL##*/}
4243
ciPrefix=${ciURL%/*}
4344
ciOrg=${ciPrefix##*/}
4445
gitBranch=$(git branch --show-current) # get current branch name
45-
curl -o pull-request.txt https://api.github.com/repos/$ciOrg/$ciRepo/pulls >/dev/null 2>&1 # Check for pull requests
46-
curl -o secure-env.txt https://api.github.com/orgs/$ciOrg/$ciRepo/secrets >/dev/null 2>&1 # Check for secure env var
47-
if [ grep -q "documentation_url" secure-env.txt \
48-
-a ! grep -q "url" pull-request.txt \
49-
-a "$gitBranch" = master ]
46+
if [ "$gitBranch" = main -o "$gitBranch" = master ]
5047
then
5148
project=$1
52-
openssl_key=$2
53-
openssl_iv=$3
5449

5550
# Populate the settings.xml configuration.
5651
mkdir -p "$HOME/.m2"
@@ -95,12 +90,6 @@ EOL
9590
echo &&
9691
echo "== Configuring environment ==" &&
9792

98-
# Configure SSH. The file .github/javadoc.scijava.org.enc must contain
99-
# an encrypted private RSA key for communicating with the git remote.
100-
mkdir -p "$HOME/.ssh" &&
101-
openssl aes-256-cbc -K "$openssl_key" -iv "$openssl_iv" -in '.github/javadoc.scijava.org.enc' -out "$HOME/.ssh/id_rsa" -d &&
102-
chmod 400 "$HOME/.ssh/id_rsa" &&
103-
10493
# Configure git settings.
10594
git config --global user.email "[email protected]" &&
10695
git config --global user.name "SciJava CI" &&
@@ -122,7 +111,7 @@ EOL
122111

123112
test "$success" || exit 1
124113

125-
git commit -m "Update $project javadocs (GitHub Actions build $WORKFLOW_RUN_NUMBER)" # Env var defined in GitHub Actions yml file
114+
git commit -m "Update $project javadocs (via $ciOrg/$ciRepo)"
126115
git pull --rebase &&
127116
git push -q origin gh-pages > /dev/null || exit 2
128117

0 commit comments

Comments
 (0)