mirror of
https://github.com/dathere/ckan_geoconnex_bulk_runner.git
synced 2026-07-05 23:22:20 +00:00
Compare commits
No commits in common. "main" and "0.0.1" have entirely different histories.
4 changed files with 15 additions and 11 deletions
6
.github/workflows/container.yml
vendored
6
.github/workflows/container.yml
vendored
|
|
@ -25,9 +25,9 @@ jobs:
|
||||||
with:
|
with:
|
||||||
file: ./bulk_loader/Dockerfile
|
file: ./bulk_loader/Dockerfile
|
||||||
push: true
|
push: true
|
||||||
tags: ghcr.io/dathere/ckan_geoconnex_bulk_runner:${{ matrix.namespace }}
|
tags: ghcr.io/dathere/ckan_geoconnex_bulk_runner:latest
|
||||||
cache-from: type=gha,scope=ckan_geoconnex_bulk_runner
|
cache-from: type=gha,scope=ckan_geoconnex_bulk_runner
|
||||||
platforms: linux/amd64
|
platforms: linux/amd64
|
||||||
cache-to: type=gha,mode=max,scope=ckan_geoconnex_bulk_runner
|
cache-to: type=gha,mode=max,scope=ckan_geoconnex_bulk_runner
|
||||||
build-args: |
|
env:
|
||||||
NAMESPACE=${{ matrix.namespace }}
|
NAMESPACE: ${{ matrix.namespace }}
|
||||||
|
|
|
||||||
16
.github/workflows/release.yml
vendored
16
.github/workflows/release.yml
vendored
|
|
@ -10,7 +10,13 @@ jobs:
|
||||||
publish:
|
publish:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
ckan_instance: [{ name: New_Mexico_Water_Data_Catalog, url: https://catalog.newmexicowaterdata.org, token: NMWDC_API_BULK_LOADER_TOKEN }]
|
ckan_instance: [
|
||||||
|
{
|
||||||
|
name: New_Mexico_Water_Data_Catalog,
|
||||||
|
url: https://catalog.newmexicowaterdata.org,
|
||||||
|
token: ${{ secrets.NMWDC_API_BULK_LOADER_TOKEN }}
|
||||||
|
}
|
||||||
|
]
|
||||||
name: Publish JSONL file
|
name: Publish JSONL file
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
|
@ -24,10 +30,10 @@ jobs:
|
||||||
- name: Run generate_release crate and upload JSONL file
|
- name: Run generate_release crate and upload JSONL file
|
||||||
run: |
|
run: |
|
||||||
cd ${{github.workspace}}
|
cd ${{github.workspace}}
|
||||||
cargo run -p generate_release --release --verbose > ${{ matrix.ckan_instance.name }}.jsonl
|
cargo run -p generate_release --release --verbose > ckan-geoconnex-web-resources-${{ matrix.namespace }}.jsonl
|
||||||
gh release upload ${{github.event.release.tag_name}} ${{ matrix.ckan_instance.name }}.jsonl
|
gh release upload ${{github.event.release.tag_name}} ckan-geoconnex-web-resources-${{ matrix.namespace }}.jsonl
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ github.TOKEN }}
|
GITHUB_TOKEN: ${{ github.TOKEN }}
|
||||||
NAMESPACE: ${{ matrix.ckan_instance.name }}
|
NAMESPACE: ${{ matrix.namespace }}
|
||||||
INSTANCE_URL: ${{ matrix.ckan_instance.url }}
|
INSTANCE_URL: ${{ matrix.ckan_instance.url }}
|
||||||
API_TOKEN: ${{ secrets[matrix.ckan_instance.token] }}
|
API_TOKEN: ${{ matrix.ckan_instance.token }}
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,6 @@ FROM rust:1.96 AS builder
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN rustup set profile minimal
|
RUN rustup set profile minimal
|
||||||
COPY . .
|
COPY . .
|
||||||
ARG NAMESPACE
|
|
||||||
ENV NAMESPACE=$NAMESPACE
|
|
||||||
RUN cargo build -p bulk_loader --release
|
RUN cargo build -p bulk_loader --release
|
||||||
|
|
||||||
FROM ubuntu:latest
|
FROM ubuntu:latest
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ async fn main() -> Result<()> {
|
||||||
let namespace = std::env!("NAMESPACE");
|
let namespace = std::env!("NAMESPACE");
|
||||||
// Get latest release data which is organized as a single JSONL file
|
// Get latest release data which is organized as a single JSONL file
|
||||||
// at https://github.com/dathere/ckan_geoconnex_bulk_runner/releases/latest
|
// at https://github.com/dathere/ckan_geoconnex_bulk_runner/releases/latest
|
||||||
let body = reqwest::get(format!("https://github.com/dathere/ckan_geoconnex_bulk_runner/releases/latest/download/{namespace}.jsonl"))
|
let body = reqwest::get(format!("https://github.com/dathere/ckan_geoconnex_bulk_runner/releases/latest/download/ckan-geoconnex-web-resources-{namespace}.jsonl"))
|
||||||
.await?
|
.await?
|
||||||
.text()
|
.text()
|
||||||
.await?;
|
.await?;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue