Skip to content

con/tinuous-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tinuous Template

A Copier template for generating tinuous configuration files with automatic CI system detection and smart defaults.

Features

  • Auto-detects CI systems - Automatically finds GitHub Actions, Travis CI, Appveyor, and CircleCI configurations
  • Smart defaults - Provides sensible defaults based on detected CI systems and project structure
  • DataLad integration - Optional DataLad/git-annex support with configurable subdataset boundaries
  • Flexible path organization - Multiple path organization strategies (by-date, by-CI, by-type, flat, custom)
  • Secret sanitization - Configurable regex patterns for automatic secret sanitization
  • Complete setup - Generates tinuous.yaml, .env, and README.md

Requirements

Usage

Generate Configuration

# Install copier
pip install copier

# Generate configuration in current directory
copier copy gh:con/tinuous-template .

# Generate in a specific directory
copier copy gh:con/tinuous-template /path/to/destination

Non-Interactive Mode

Provide answers via command-line flags:

copier copy gh:con/tinuous-template . \
  --data repository=con/tinuous \
  --data is_standalone=true \
  --data enable_datalad=true \
  --data subdataset_boundary=by-month

Use Defaults

Accept all default values:

copier copy gh:con/tinuous-template . --defaults

Configuration Questions

The template will ask you:

Basic Information

  • target_repo_path: Path to target repository (auto-detected if empty)
  • repository: GitHub repository in OWNER/NAME format (auto-detected from git)
  • is_standalone: Whether this is a standalone repository or embedded in a project
  • log_root: Root directory for logs (defaults based on standalone mode)

CI Systems

  • detect_github_actions: Enable GitHub Actions (auto-detected)
  • github_workflows: Specific workflows to include (empty = all)
  • detect_travis: Enable Travis CI (auto-detected)
  • detect_appveyor: Enable Appveyor (auto-detected)
    • appveyor_account: Appveyor account name (required if enabled)
    • appveyor_project_slug: Project slug (optional)
  • detect_circleci: Enable CircleCI (auto-detected)

Path Organization

  • path_organization: Choose from:
    • by-date-ci: Year/Month/Day/CI/Type (recommended)
    • by-ci-date: CI/Year/Month/Day/Type
    • by-type: Type/Year/Month
    • flat: Year/Month (flat structure)
    • custom: Define your own
  • custom_path_prefix: Custom path template (if custom selected)

DataLad

  • enable_datalad: Enable DataLad integration
  • datalad_cfg_proc: Config procedure (text2git, yoda, none)
  • subdataset_boundary: Where to create subdatasets (none, by-year, by-month, by-day)

Time Range

  • since_date: Start date for fetching logs (ISO 8601)
  • max_days_back: Maximum days to look back
  • event_types: Event types to fetch (cron, push, pr, manual)

Artifacts & Releases

  • fetch_artifacts: Fetch build artifacts (GitHub Actions, CircleCI)
  • fetch_releases: Fetch GitHub release assets

Security

  • enable_secret_sanitization: Enable automatic secret sanitization
  • secret_patterns: Regex patterns for secrets (YAML mapping)

Examples

Example 1: Standalone Repository

mkdir tinuous-myproject
cd tinuous-myproject
git init
copier copy gh:con/tinuous-template .

The template will:

  • Auto-detect repository from parent directory if available
  • Detect all CI systems in the target repo
  • Create configuration for a standalone log repository
  • Enable DataLad with monthly subdatasets (if chosen)

Example 2: Embedded in Project

cd ~/projects/myproject
copier copy gh:con/tinuous-template .

Answer prompts:

  • Is this standalone? No
  • Log root: logs/tinuous

The template will:

  • Auto-detect repository from .git/config
  • Detect CI systems in current project
  • Create configuration with logs in logs/tinuous/

Example 3: Custom Configuration

copier copy gh:con/tinuous-template . \
  --data repository=myorg/myrepo \
  --data is_standalone=false \
  --data log_root=ci-logs \
  --data path_organization=custom \
  --data custom_path_prefix='builds/{ci}/{year}/{month}/{build_commit[:7]}'

Generated Files

The template generates:

  • tinuous.yaml - Main configuration file for tinuous
  • .env - Template for environment variables (tokens)
  • README.md - Documentation for the generated configuration

After Generation

  1. Review tinuous.yaml - Check and adjust settings as needed
  2. Set up authentication - Add tokens to .env (copy from .env if needed)
  3. Add to .gitignore - Ensure .env is in .gitignore
  4. Test configuration - Run tinuous fetch to test

Template Structure

tinuous-template/
├── copier.yml                      # Template configuration
├── extensions/
│   └── copier_extensions.py        # Custom Jinja filters
└── template/
    ├── tinuous.yaml.jinja          # Main configuration template
    ├── .env.jinja                  # Environment variables template
    └── README.md.jinja             # Documentation template

Development

Testing the Template

# Create test directory
mkdir test-output
cd test-output

# Run template
copier copy /path/to/tinuous-template .

# Or test with a real repository
cd /path/to/your/project
copier copy /path/to/tinuous-template .

CI Detection

The template detects CI systems by looking for:

  • GitHub Actions: .github/workflows/*.yml or .github/workflows/*.yaml
  • Travis CI: .travis.yml
  • Appveyor: .appveyor.yml or appveyor.yml
  • CircleCI: .circleci/config.yml

Custom Filters

Custom Jinja filters in extensions/copier_extensions.py:

  • repo_from_git: Extract repo from .git/config
  • has_github_actions: Check for GitHub Actions
  • has_travis: Check for Travis CI
  • has_appveyor: Check for Appveyor
  • has_circleci: Check for CircleCI
  • is_iso8601: Validate ISO 8601 date format
  • get_github_workflows: List workflow filenames
  • current_year: Get current year
  • parse_bool: Parse boolean values

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Test your changes
  4. Submit a pull request

License

MIT License - see LICENSE file for details

Related Projects

Support

About

Copier template for tinuous

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published