Skip to content

Commit

Permalink
Updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
krom committed Jun 8, 2018
1 parent e6c78ab commit b3c311b
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 13 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## 1.0.2 (2008-06-08)
* Added showing release notes while upgrading
* Changed create Makefile from Makefile.sample.mk instead of HEADER.mk
* Added Makefile.minimal.mk with basic commands
* Changed create Makefile from Makefile.minimal.mk instead of HEADER.mk

## 1.0.1 (2018-06-06)
* Added Makefile.sample.mk
Expand Down
30 changes: 19 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,25 @@ make mk-upgrade
## USAGE
![Screen](https://raw.githubusercontent.com/krom/docker-compose-makefile/master/docs/screencast.gif)

**Common (see [samples](https://github.com/krom/docker-compose-makefile/tree/master/samples))**
- **make start** - start all containers
- **make start c=hello** - start container hello
- **make stop** - stop all containers
- **make status** - show list of containers with statuses
- **make clean** - clean all data
**Common** (see [samples](https://github.com/krom/docker-compose-makefile/tree/master/samples))
- `make console` - open container's console

**From Makefile.minimal.mk** (see [samples](https://github.com/krom/docker-compose-makefile/tree/master/samples))
- `make start` - start all containers
- `make start` c=hello** - start container hello
- `make stop` - stop all containers
- `make status` - show list of containers with statuses
- `make clean` - clean all data

**From this library**
- **make help** - show help (see above)
- **make mk-upgrade** - check for updates of mk-lib
- **make mk-version** - show current version of mk-lib
- `make help` - show help (see above)
- `make mk-upgrade` - check for updates of mk-lib
- `make mk-version` - show current version of mk-lib

### VARIABLES
* **ROOT_DIR** - full path to dir with *Makefile*
* **DOCKER_COMPOSE** - docker-compose executable command
* **DOCKER_COMPOSE_FILE** - docker-compose.yml file

## SAMPLES

Expand Down Expand Up @@ -69,8 +77,8 @@ You can create _.make.env_ file in directory with Makefile or **current** direct

Available variables

* DOCKER_COMPOSE = {docker-compose executable command}
* DOCKER_COMPOSE_FILE = {custom docker-compose.yml file}
* **DOCKER_COMPOSE** = {docker-compose executable command}
* **DOCKER_COMPOSE_FILE** = {custom docker-compose.yml file}

## TO-DO
- check dependencies
Expand Down
29 changes: 29 additions & 0 deletions samples/Makefile.minimal.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# REQUIRED SECTION
ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
include $(ROOT_DIR)/.makefile-lib/common.mk
# END OF REQUIRED SECTION

.PHONY: help dependencies up start stop restart status ps clean

dependencies: check-dependencies ## Check dependencies

up: ## Start all or c=<name> containers in foreground
@$(DOCKER_COMPOSE) -f $(DOCKER_COMPOSE_FILE) up $(c)

start: ## Start all or c=<name> containers in background
@$(DOCKER_COMPOSE) -f $(DOCKER_COMPOSE_FILE) up -d $(c)

stop: ## Stop all or c=<name> containers
@$(DOCKER_COMPOSE) -f $(DOCKER_COMPOSE_FILE) stop $(c)

restart: ## Restart all or c=<name> containers
@$(DOCKER_COMPOSE) -f $(DOCKER_COMPOSE_FILE) stop $(c)
@$(DOCKER_COMPOSE) -f $(DOCKER_COMPOSE_FILE) up $(c) -d

status: ## Show status of containers
@$(DOCKER_COMPOSE) -f $(DOCKER_COMPOSE_FILE) ps

ps: status ## Alias of status

clean: ## Clean all data
@$(DOCKER_COMPOSE) -f $(DOCKER_COMPOSE_FILE) down
1 change: 1 addition & 0 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ cp README.md $OUT
cp LICENSE $OUT
cp CHANGELOG.md $OUT
cp samples/Makefile $OUT/Makefile.sample.mk
cp samples/Makefile.minimal.mk $OUT/Makefile.minimal.mk

# Writing current version
echo "MK_VERSION := $TRAVIS_TAG" > $OUT/version.mk
Expand Down
2 changes: 1 addition & 1 deletion scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ if [ -f Makefile ]; then
echo "-------------------------------------------------------------------------------
"
else
cp .mk-lib/Makefile.sample.mk Makefile
cp .mk-lib/Makefile.minimal.mk Makefile
echo "Created new Makefile. Feel free to add new commands"
fi;

0 comments on commit b3c311b

Please sign in to comment.