elabpull

Run in CI/CD

Link your eLabFTW to Gitlab

  1. Generate eLabFTW API Key: https://doc.elabftw.net/docs/usage/api/
  2. In your Gitlab repository navigate to Settings -> CI/CD -> Variables
  3. Click on Add variable
  4. Under Key enter ELAB_API_KEY (this name is mandatory)
  5. Under _Value enter copy the generated eLabFTW API Key
  6. Click Add variable

Add environment variable

Set permissions for CI/CD to push to repository

Navigate to Settings -> CI/CD -> Job token permissions and make sure Allow Git push requests to the repository under Additional permissions is checked

Job Token Permission

Run the pipeline

  1. Navigate to Build -> Pipeline
  2. Click on New pipeline (upper right corner)
  3. Under Inputs enter the experiment ID of which you want to download data into your repository as a space seperated list, e.g., 1 3 12 for the experiments with the IDs 1, 3 and 12
  4. Click New pipeline

You can find your downloaded eLabFTW experiment information under elab-downloads


Usage as CLI

Build the executable with

go build -o elabpull

Run it

export ELAB_API_KEY=<API-KEY>

elabpull [-save-pdf] [-save-uploads] <EXPERMIENT_IDS>

Usage as docker container

Build container

docker build -t elabpull .

Run container

docker run --rm     -v "$PWD/elab-downloads:/elab-downloads"     -e ELAB_API_KEY     elabpull:latest [-save-pdf] [-save-uploads] <EXPERMIENT_IDS>