https://github.com/ncarlier/makefiles
My makefiles.
https://github.com/ncarlier/makefiles
Last synced: 6 months ago
JSON representation
My makefiles.
- Host: GitHub
- URL: https://github.com/ncarlier/makefiles
- Owner: ncarlier
- License: mit
- Created: 2017-11-03T11:34:38.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-12-15T08:50:30.000Z (almost 8 years ago)
- Last Synced: 2024-10-29T07:04:17.084Z (11 months ago)
- Size: 11.7 KB
- Stars: 5
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Makefiles
## Description
My makefiles.
See README files under each folder for more details.
## Usage sample with Docker
Create a `.env` file:
```env
# General configuration
MACHINE_NAME=# Scaleway configuration
SCALEWAY_ORGANIZATION=
SCALEWAY_TOKEN=
```Create a `Makefile`:
```makefile
# Import custom configuration
include .env# Docker compose configuration files
COMPOSE_FILES?=-f docker-compose.yml# Include common Make tasks
root_dir:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
makefiles:=$(root_dir)/makefiles
include $(makefiles)/help.Makefile
include $(makefiles)/docker/machine.Makefile
include $(makefiles)/docker/compose.Makefile## Setup the infrastructure
setup: machine-create machine-env
.PHONY : setup## Teardown the infrastructure
teardown: compose-down machine-rm
.PHONY : teardown## Deploy services
deploy: compose-up compose-logs
.PHONY : deploy## Un-deploy services
undeploy: compose-down
.PHONY : undeploy## Login with SSH
ssh: machine-ssh
.PHONY : ssh```
Play:
```bash
$ # Get contextual help
$ make help
$ # Create the Docker machine
$ make setup
$ # Switch Docker host
$ eval $(make machine-env)
$ # Get Docker Daemon infos
$ docker info
$ # Deploy services
$ make deploy
$ # Get Docker status
$ docker ps
$ # Teardown the Docker machine
$ make teardown
```---