github mcuadros/ofelia v0.3.6

latest releases: v0.3.13, v0.3.12, v0.3.11...
3 years ago

Added way to provide environment variables for the job-run, job-exec and job-local.

See jobs.md for documentation.

Examples of usage new of new feature:

  • docker-compose.yml:

    version: "3"
    services:
    ofelia:
      image: mcuadros/ofelia:002a481
      depends_on:
        - alpine
      command: daemon --docker
      volumes:
        - /var/run/docker.sock:/var/run/docker.sock:ro
      environment:
        DOCKER: COMPOSE
      labels:
        ofelia.job-local.test1.schedule: "@every 5s"
        ofelia.job-local.test1.command: "env"
        ofelia.job-local.test1.environment: '["JOB=LOCAL", "TEST=1"]'
    
        ofelia.job-run.test2.command: "env"
        ofelia.job-run.test2.schedule: "@every 5s"
        ofelia.job-run.test2.image: "alpine"
        ofelia.job-run.test2.environment: '["JOB=RUN", "TEST=2"]'
    
    alpine:
      image: alpine
      command: tail -f /dev/null
      labels:
        ofelia.enabled: "true"
        ofelia.job-exec.test3.schedule: "@every 5s"
        ofelia.job-exec.test3.command: "env"
        ofelia.job-exec.test3.environment: '["JOB=EXEC", "TEST=3"]'
  • config.ini:

     [job-run "test1"]
     schedule = @every 5s
     image = alpine
     name = test1
     command = env
     environment = JOB=RUN
     environment = TEST=1
    
     [job-local "test2"]
     schedule = @every 5s
     command = env
     environment = JOB=LOCAL
     environment = TEST=2
    
     [job-exec "test3"]
     schedule = @every 5s
     container = some_container_that_must_be_running
     command = env
     environment = TEST=3
     environment = JOB=EXEC
    

Don't miss a new ofelia release

NewReleases is sending notifications on new releases.