Skip to content

miloss/grunt-compose

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

grunt-compose

Run docker-compose from Grunt

License Version Build Status

Integrate Docker Compose into your Grunt workflow. This plugin assumes that you are already using Docker Compose and have your Compose file (docker-compose.yml by default) ready. For more information about Docker Compose go here.

What this task does:

  • passes environment variables to Compose file for Bash-like $VARIABLE usage
  • runs docker-compose commands inside a target directory

Installation

npm install grunt-compose --save-dev

Configuration

In your project's Gruntfile, add a section named compose to the data object passed into grunt.initConfig().

grunt.initConfig({
    compose: {
        options: {
            cmds: ['kill', 'up'],
            cwd: 'docker',
            env: {}
        }
     }
});

Options

options.cmds

Type: Array Default value: []

Array of docker-compose commands to run sequentially.

options.cwd

Type: String Default value: 'docker'

A relative directory that contains Compose file docker-compose.yml.

options.env

Type: Object Default value: {}

A set of environment variables that will be passed to yml file.

Example:

grunt.initConfig({
    compose: {
        options: {
            cmds: ['up'],
            env: {
                FOO: 'bar'
            }
        }
     }
});

Usage

grunt compose

About

Run docker-compose from Grunt

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published