Created
December 5, 2016 08:45
-
-
Save liquidz/5cdba6b7b718292723697cfb20776bda to your computer and use it in GitHub Desktop.
DigitalOcean
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DROPLET_NAME = mytest | |
KEY_NAME = termux | |
DOCTL = $(GOPATH)/bin/doctl | |
CONFIG = $(HOME)/.config/doctl/config.yaml | |
DO_REGION = sgp1 | |
DO_IMAGE = ubuntu-16-10-x64 | |
DO_SIZE = 512mb | |
all: $(DOCTL) $(CONFIG) | |
$(DOCTL): | |
go get github.com/digitalocean/doctl/cmd/doctl | |
$(CONFIG): | |
doctl auth init | |
list: | |
doctl compute droplet list | |
ssh-key-create: | |
doctl compute ssh-key create $(KEY_NAME) \ | |
--public-key "$(shell cat ~/.ssh/id_rsa.pub)" | |
create: | |
doctl compute droplet create $(DROPLET_NAME) \ | |
--region $(DO_REGION) \ | |
--image $(DO_IMAGE) \ | |
--size $(DO_SIZE) \ | |
--ssh-keys $(shell doctl compute ssh-key list | grep $(KEY_NAME) | cut -f1) | |
delete: | |
doctl compute droplet delete $(DROPLET_NAME) | |
ssh: | |
doctl compute ssh $(DROPLET_NAME) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment