Run e2e tests in Docker

May 11, 2026 ยท View on GitHub

CI Coverage

A task scheduler built with Go and Vue.js that allows users to specify recurring jobs via a simple YAML configuration file. The scheduler reads job definitions, executes commands at specified times using cron expressions, and passes in environment variables for each job.

Tagged GitHub releases include downloadable Linux binaries. Run ./gocron_<version>_linux_<arch> --version to inspect the embedded version metadata of a downloaded release binary.

The server supports --config /path/to/config.yaml for a non-default configuration file.

Table of Contents

Features

  • Simple Configuration: Easily define jobs, cron schedules, and environment variables in a YAML config file.
  • Cron Scheduling: Supports cron expressions for precise scheduling.
  • Environment Variables: Define environment variables specific to each job.
  • Easy Job Management: Add and remove jobs quickly with simple configuration.
  • Pre-installed backup-software for an easy backup solution

How It Works

  • Defaults Section: This section defines default values that are applied to all jobs. You can specify a default cron expression and environment variables to be inherited by each job.
  • Jobs Section: Here, you define multiple jobs. Each job can have its own cron expression, environment variables, and commands to execute.
  • Environment Variables: Define environment variables for each job to customize its runtime environment.
  • Commands: Each job can have multiple commands, which will be executed in sequence.

Docker

run command

docker run -it --rm \
  --name gocron \
  --hostname gocron \
  -p 8156:8156 \
  -v ./config/:/app/config/ \
  ghcr.io/flohoss/gocron:latest

compose file

services:
  gocron:
    image: ghcr.io/flohoss/gocron:latest
    restart: always
    container_name: gocron
    hostname: gocron
    volumes:
      - ./config/:/app/config/
    ports:
      - '8156:8156'

By default, gocron reads ./config/config.yaml. You can optionally override the config file path with --config /path/to/config.yaml. SQLite data is stored in the same folder by default, and can be overridden with db.location inside the config file. Relative db.location values are resolved from the config file directory. You can also set the SQLite file name with db.name (default: db.sqlite).

Environment overrides (GC_)

Config values can be overridden via environment variables using the GC_ prefix.

  • GC_LOG_LEVEL=debug overrides log_level
  • GC_SERVER_PORT=9000 overrides server.port
  • GC_HEALTHCHECK_TYPE=GET overrides healthcheck.type

Rule: dots become underscores and keys are uppercased (server.address -> GC_SERVER_ADDRESS).

Screenshots

Dark mode

Light mode

API Docs

Configuration File

YAML Configuration

The entire configuration is managed via the YAML file, including settings for the timezone, logging, and server.

For a complete and working configuration example, please refer to the config/config.yaml file in the repository.

Software

You can specify the software you want to install and the version you want to use directly in the configuration file. Available software packages include: apprise, borgbackup, docker, git, podman, rclone, rdiff-backup, restic, rsync, logrotate, sqlite3, and kopia.

The version format depends on the installation method:

  • apprise (via pipx): version format like 1.2.0
  • docker (via apt): version format like 5:24.0.5-1~debian.11~bullseye
  • Others (via apt): standard apt version format

Here is an example of how to set up specific software versions:

software:
  - name: 'apprise'
    version: '1.2.0'
  - name: 'borgbackup'
    version: '1.2.0'
  - name: 'docker'
    version: '5:24.0.5-1~debian.11~bullseye'
  - name: 'git'
  - name: 'podman'
  - name: 'rclone'
  - name: 'rdiff-backup'
  - name: 'restic'
    version: '0.14.0'
  - name: 'rsync'
  - name: 'logrotate'
  - name: 'sqlite3'
  - name: 'kopia'

Star History

Star History Chart

License

This project is licensed under the MIT License - see the LICENSE file for details.

Development setup

Run tests

# Run Go tests
docker compose run --rm go test ./...

# Install e2e dependencies
docker compose run --rm yarn-e2e install --frozen-lockfile

# Run e2e tests in Docker
docker compose up -d
docker compose --profile test run --rm e2e
docker compose down

# Open Cypress UI from the e2e package (optional)
docker compose run --rm yarn-e2e open

Update Dependencies

# Node packages
docker compose run --rm yarn install --frozen-lockfile
docker compose run --rm yarn upgrade --latest

# E2E packages
docker compose run --rm yarn-e2e install --frozen-lockfile
docker compose run --rm yarn-e2e upgrade --latest

# Go packages
docker compose run --rm go get -u ./...
docker compose run --rm go mod tidy

Automatic rebuild and reload

docker compose up