-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bring back the caprover related stuff
- Loading branch information
1 parent
27ef554
commit cfeb51d
Showing
9 changed files
with
113 additions
and
175 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Simple workflow for deploying static content to GitHub Pages | ||
name: Caprover Deploy | ||
run-name: Caprover Deploy branch:${{ github.ref_name }} | ||
on: | ||
# Runs on pushes targeting the default branch | ||
push: | ||
branches: | ||
- master | ||
- development | ||
- caprover-* | ||
paths: | ||
- Dockerfile-Caprover | ||
- erddap/**/* | ||
- .github/workflows/* | ||
- init.d/* | ||
workflow_dispatch: | ||
|
||
jobs: | ||
# Single deploy job since we're just deploying | ||
deploy: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
environment: | ||
name: ${{ startsWith(github.ref_name, 'caprover-deploy') && 'development' || github.ref_name == 'development' && 'development' || github.ref_name == 'master' && 'production' || github.ref_name == 'caprover-production' && 'production' || 'production' }} | ||
url: ${{ vars.URL }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
persist-credentials: false | ||
- name: Compress repo to a tar file step | ||
run: tar -cvf packaged.tar . | ||
- name: Install Caprover CLI | ||
run: npm install -g caprover | ||
- name: Deploy ${{ github.ref_name }} on ${{ vars.URL }} | ||
run: | | ||
caprover deploy \ | ||
--caproverUrl ${{ vars.CAPROVER_URL }} \ | ||
--caproverApp ${{ vars.CAPROVER_APP_NAME }} \ | ||
--appToken ${{ secrets.CAPROVER_TOKEN }} \ | ||
--tarFile packaged.tar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Synchronize ERDDAP datasets.xml on server deployment | ||
run-name: Synchronize ${{github.repository}}[${{ github.ref_name }}] datasets.xml on deployment | ||
on: | ||
push: | ||
branches: | ||
- master | ||
- development | ||
- caprover-* | ||
paths-ignore: | ||
- Dockerfile | ||
- erddap/**/* | ||
- init.d/* | ||
jobs: | ||
update: | ||
name: Update container datasets-xml | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: ${{ startsWith(github.ref_name, 'caprover-') && 'development' || github.ref_name == 'development' && 'development' || github.ref_name == 'master' && 'production' }} | ||
url: ${{ vars.URL }} | ||
|
||
steps: | ||
- name: Run `erddap-deploy update action` on ${{ vars.NAME }} at ${{ vars.URL }} | ||
uses: hakaiinstitute/erddap-deploy/sync@v1.3.1 | ||
with: | ||
ssh_host: ${{ secrets.SSH_HOST }} | ||
ssh_username: ${{ secrets.SSH_USERNAME }} | ||
ssh_key: ${{ secrets.SSH_KEY }} | ||
ssh_port: ${{ secrets.SSH_PORT }} | ||
container_name: srv-captain--${{ vars.CAPROVER_APP_NAME }} | ||
hard_flag: true | ||
monitor: true | ||
sudo: true | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
FROM --platform=linux/x86_64 axiom/docker-erddap:2.23-jdk17-openjdk | ||
|
||
# Install related packages | ||
RUN apt-get update | ||
RUN apt-get install -y git python3-pip | ||
ADD "https://www.random.org/cgi-bin/randbyte?nbytes=10&format=h" skipcache | ||
RUN pip install git+https://github.com/HakaiInstitute/erddap-deploy.git@v1.3 | ||
|
||
ARG HOST_PORT=${HOST_PORT:-8080} | ||
ENV HOST_PORT=${HOST_PORT} | ||
|
||
# Copy ERDDAP configuration files | ||
COPY ./erddap/conf/robots.txt /usr/local/tomcat/webapps/ROOT/robots.txt | ||
COPY ./erddap/content /usr/local/tomcat/content/erddap | ||
COPY init.d /init.d | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] | ||
|
||
#healthcheck to check ERDDAP landing page. the check provides the added bonus | ||
#of triggering ERDDAP initialization before the first user visit | ||
HEALTHCHECK --interval=10s --timeout=10s --start-period=10s \ | ||
CMD curl --fail http://localhost:${HOST_PORT}/erddap/index.html || exit 1 | ||
|
||
EXPOSE ${HOST_PORT} | ||
CMD ["catalina.sh", "run"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"schemaVersion": 2, | ||
"dockerfilePath": "./Dockerfile-Caprover" | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
if [[ -n $ERDDAP_DATASETS_REPO_URL ]]; then | ||
erddap_deploy sync | ||
fi | ||
|
||
if [[ -n $UPTIME_KUMA_URL ]]; then | ||
erddap_deploy monitor | ||
fi |
This file was deleted.
Oops, something went wrong.