|
1 | 1 | #!/bin/bash |
2 | 2 |
|
3 | 3 | # |
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. |
5 | 6 | # |
6 | 7 |
|
7 | 8 | # The following repositories are known to use this script: |
8 | 9 | # |
9 | 10 | # bonej-org/bonej-javadoc |
10 | 11 | # fiji/fiji-javadoc |
| 12 | +# flimlib/flimlib-javadoc |
11 | 13 | # imagej/imagej-javadoc |
12 | 14 | # imglib/imglib2-javadoc |
13 | 15 | # scifio/scifio-javadoc |
14 | 16 | # scijava/java3d-javadoc |
15 | 17 | # scijava/scijava-javadoc |
16 | | -# slim-curve/slim-javadoc |
17 | 18 | # uw-loci/loci-javadoc |
18 | 19 |
|
19 | 20 | # Wait for a launched background command to complete, emitting |
@@ -42,15 +43,9 @@ ciRepo=${ciURL##*/} |
42 | 43 | ciPrefix=${ciURL%/*} |
43 | 44 | ciOrg=${ciPrefix##*/} |
44 | 45 | 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 ] |
50 | 47 | then |
51 | 48 | project=$1 |
52 | | - openssl_key=$2 |
53 | | - openssl_iv=$3 |
54 | 49 |
|
55 | 50 | # Populate the settings.xml configuration. |
56 | 51 | mkdir -p "$HOME/.m2" |
|
95 | 90 | echo && |
96 | 91 | echo "== Configuring environment ==" && |
97 | 92 |
|
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 | | - |
104 | 93 | # Configure git settings. |
105 | 94 | git config --global user.email "[email protected]" && |
106 | 95 | git config --global user.name "SciJava CI" && |
|
122 | 111 |
|
123 | 112 | test "$success" || exit 1 |
124 | 113 |
|
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)" |
126 | 115 | git pull --rebase && |
127 | 116 | git push -q origin gh-pages > /dev/null || exit 2 |
128 | 117 |
|
|
0 commit comments