Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cloudflare/cfdeploy
Cloudflare Deployment Tool
https://github.com/cloudflare/cfdeploy
deploy deploy-tool deployer deployment docker docker-image marathon
Last synced: 10 days ago
JSON representation
Cloudflare Deployment Tool
- Host: GitHub
- URL: https://github.com/cloudflare/cfdeploy
- Owner: cloudflare
- License: bsd-3-clause
- Created: 2017-08-14T21:10:49.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2024-09-25T22:29:25.000Z (about 1 month ago)
- Last Synced: 2024-10-08T12:48:33.462Z (29 days ago)
- Topics: deploy, deploy-tool, deployer, deployment, docker, docker-image, marathon
- Language: Go
- Size: 31.3 KB
- Stars: 27
- Watchers: 7
- Forks: 12
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Cloudflare Deployment Tool
[![Build Status](https://travis-ci.org/cloudflare/cfdeploy.svg?branch=master)](https://travis-ci.org/cloudflare/cfdeploy)
[![GoDoc](http://godoc.org/github.com/cloudflare/cfdeploy?status.svg)](http://godoc.org/github.com/cloudflare/cfdeploy)This tool allows you to easily deploy Docker Image(s) to Marathon.
Features:
* Has a single dependency - Go
* Validates your Marathon YAML file and converts to JSON
* Checks that your Docker images are published *before* deploying to Marathon
* Automatically interpolates image tags via customizable template
* e.g. `{{ .GitRevCount }}-{{ .GitRevShort }}` = `93-5814f5e`
* Supports multiple deployment targets/environments## Installation
Assuming:
1. you have a correctly configured `$GOPATH`
2. you have `$GOPATH/bin` in your `$PATH````
go get -u github.com/cloudflare/cfdeploy
cfdeploy # shows help message
```## Setup
Create a `deploy.yaml` file alongside your Marathon `staging.yaml` and `prod.yaml` files such as this:
```
marathon:
host: marathon.example.com
image:
repository: index.docker.io
tagTemplate: "{{ .GitRevCount }}-{{ .GitRevShort }}"environments:
prod:
marathon:
file: prod.yaml
images:
svc:
name: library/hello-world
staging:
marathon:
file: staging.yaml
images:
svc:
name: library/hello-world
```Then, modify your Marathon files to have the Docker image replaced into them, e.g:
```
...
container:
type: DOCKER
docker:
image: {{ index .Images "svc" }}
...
```Note: the key `"svc"` must match the key under `environments.ENV.images.KEY` in your `deploy.yaml` file.
## Usage
If you have direct (unauthenticated) access to your Marathon instance:
`cfdeploy -e staging`
or
`cfdeploy -e staging -y` to skip the confirmation prompt.
If you need to specify a custom Marathon hostname or headers:
```
cfdeploy -e staging
-marathon.host my-marathon.example.com \
-marathon.curlopts '-H "OauthEmail: ..." -H "OauthAccessToken: ..." -H "OauthExpires: ..."'
```