Skip to content

Commit

Permalink
Merge pull request #3 from plazi/2-worker
Browse files Browse the repository at this point in the history
use GHAct
  • Loading branch information
retog authored Jun 13, 2024
2 parents 063afee + 6975d53 commit a339f90
Show file tree
Hide file tree
Showing 9 changed files with 144 additions and 449 deletions.
6 changes: 5 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@
"run",
"--v8-flags=--max-old-space-size=8000",
"--inspect",
"--allow-net", "--allow-read", "--allow-write", "--allow-run=git", "--allow-env"
"--allow-net",
"--allow-read",
"--allow-write",
"--allow-run=git",
"--allow-env"
],
"attachSimplePort": 9229
}
Expand Down
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM denoland/deno:ubuntu-1.22.1
FROM denoland/deno:1.43.3

# Install cron
RUN apt-get update
RUN apt-get install -y git
RUN DEBIAN_FRONTEND=noninteractive apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y git

# The port that your application listens to.
EXPOSE 4505
Expand All @@ -14,8 +14,8 @@ WORKDIR /app

# Cache the dependencies as a layer (the following two steps are re-run only when deps.ts is modified).
# Ideally cache deps.ts will download and compile _all_ external files used in main.ts.
COPY src/deps.ts .
RUN deno cache deps.ts
COPY src/deps.ts src/deps.ts
RUN deno cache src/deps.ts

# These steps will be re-run upon each file change in your working directory:
ADD src src
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Turtle-Hook

This updates a SPARQL-Endpoint to reflect the changes of the content of RDF-Turtle files in a Github repository.

It uses [ghact](https://deno.land/x/ghact) to provide a webhook and a web/rest interface.
18 changes: 14 additions & 4 deletions config/config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
export const config = {
branch: "main",
import { type Config } from "../src/deps.ts";

export const sparqlConfig = {
graphUriPrefix: "https://raw.githubusercontent.com/plazi/treatments-rdf/main",
repository: "plazi/treatments-rdf",
repositoryUri: "https://github.com/plazi/treatments-rdf.git",
uploadUri: "http://blazegraph:8080/blazegraph/sparql",
};

export const ghActConfig: Config = {
title: "Turtle-Hook",
description: "Load RDF from plazi/treatments-rdf into our triple-store.",
// we don't create commits, so a default job-author is not really neccesary
email: "",
sourceRepositoryUri: "https://github.com/plazi/treatments-rdf.git",
sourceBranch: "main",
sourceRepository: "plazi/treatments-rdf",
workDir: "/workdir",
};
52 changes: 0 additions & 52 deletions config/postupdate.sparql

This file was deleted.

215 changes: 0 additions & 215 deletions manual-test.ts

This file was deleted.

10 changes: 5 additions & 5 deletions src/deps.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export {
Server,
Status,
STATUS_TEXT,
} from "https://deno.land/std@0.141.0/http/mod.ts";
export { serveDir } from "https://deno.land/std@0.141.0/http/file_server.ts";
type Config,
GHActServer,
GHActWorker,
type Job,
} from "https://deno.land/x/ghact@1.2.1/mod.ts";
Loading

0 comments on commit a339f90

Please sign in to comment.