Update mirror generation

This commit is contained in:
tree 2023-01-30 15:19:16 +01:00
rodič 66ab91d079
revize 91dbfea406
6 změnil soubory, kde provedl 26 přidání a 4 odebrání

3
.gitignore vendorováno
Zobrazit soubor

@ -1,3 +1,4 @@
.DS_Store
dist
cache
dist-mirror
cache

Zobrazit soubor

@ -1,14 +1,14 @@
pipeline:
build:
build_mirror:
image: denoland/deno
commands:
- apt update
- apt install make
- deno --version
- make
- make mirror
deploy:
deploy_mirror:
image: rclone/rclone
commands:
- "rclone sync dist/ :sftp:data/ --sftp-host frontier.gwei.cz --sftp-user pbw-deploy --sftp-port 2022 --sftp-pass $RCLONE_PASS -v"

Zobrazit soubor

@ -2,6 +2,8 @@
all: test build
mirror: test build-mirror
test:
deno test --unstable --allow-read utils/test.js
@ -16,5 +18,8 @@ fmt: format
build:
deno run --unstable --allow-read --allow-write utils/exec.js build
build-mirror:
deno run --unstable --allow-read --allow-write utils/mirror.js
event-sync:
deno run --unstable --allow-read --allow-write --allow-net utils/eventSync.js $(event)

Zobrazit soubor

@ -19,6 +19,7 @@ export class DeConfEngine {
this.srcDir = this.options.srcDir || "./data";
this.outputDir = this.options.outputDir || "./dist";
this.publicUrl = this.options.publicUrl || "https://data.prgblockweek.com";
this.exploreUrl = this.options.exploreUrl || "https://explore.prgblockweek.com";
this.githubUrl = this.options.githubUrl ||
"https://github.com/utxo-foundation/prague-blockchain-week/tree/main/data";
@ -47,6 +48,7 @@ export class DeConfEngine {
id: p.id,
name: p.data.index.name,
dataUrl: p.data.index.dataUrl,
exploreUrl: p.data.index.exploreUrl,
})),
);
// write schemas
@ -116,6 +118,7 @@ class DeConf_Package {
// load year index
pkg.index = await _tomlLoad([...specDir, "index.toml"].join("/"));
pkg.index.dataUrl = [this.engine.publicUrl, this.id].join("/");
pkg.index.exploreUrl = [this.engine.exploreUrl, this.id].join("/");
pkg.index.dataGithubUrl = [this.engine.githubUrl, this.id].join("/");
//console.log(`\n##\n## [${pkg.index.name}] \n##`);
// load sub-events

10
utils/mirror.js Normal file
Zobrazit soubor

@ -0,0 +1,10 @@
import { DeConfEngine } from "./engine.js";
const deconf = new DeConfEngine({
publicUrl: "https://mirror.data.prgblockweek.com",
exploreUrl: "https://mirror.explore.prgblockweek.com",
outputDir: "./dist-mirror"
});
await deconf.init();
await deconf.build();

Zobrazit soubor

@ -44,3 +44,6 @@ properties:
dataGithubUrl:
type: string
format: uri
exploreUrl:
type: string
format: uri