Skip to content

Commit 858afb2

Browse files
author
Aaron Schlesinger
committed
ref(*): move all client files to the root
1 parent 60041c5 commit 858afb2

200 files changed

Lines changed: 110 additions & 12286 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Makefile

Lines changed: 95 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -1,106 +1,99 @@
1-
# If DEIS_REGISTRY is not set, try to populate it from legacy DEV_REGISTRY
2-
DEIS_REGISTRY ?= $(DEV_REGISTRY)
3-
IMAGE_PREFIX ?= deis
4-
COMPONENT ?= workflow
5-
VERSION ?= git-$(shell git rev-parse --short HEAD)
6-
IMAGE = $(DEIS_REGISTRY)$(IMAGE_PREFIX)/$(COMPONENT):$(VERSION)
7-
SHELL_SCRIPTS = $(wildcard rootfs/bin/*) $(shell find "rootfs" -name '*.sh') $(wildcard _scripts/*.sh)
8-
9-
# Get the component informtation to a tmp location and get replica count
10-
$(shell kubectl get rc deis-$(COMPONENT) --namespace deis -o yaml > /tmp/deis-$(COMPONENT))
11-
DESIRED_REPLICAS=$(shell kubectl get -o template rc/deis-$(COMPONENT) --template={{.status.replicas}} --namespace deis)
12-
13-
info:
14-
@echo "Build tag: ${VERSION}"
15-
@echo "Registry: ${DEIS_REGISTRY}"
16-
@echo "Image: ${IMAGE}"
17-
18-
check-docker:
19-
@if [ -z $$(which docker) ]; then \
20-
echo "Missing \`docker\` client which is required for development"; \
21-
exit 2; \
22-
fi
23-
24-
build: docker-build
25-
26-
docker-build: check-docker
27-
docker build --rm -t $(IMAGE) rootfs
28-
29-
docker-push: update-manifests
30-
docker push ${IMAGE}
31-
32-
kube-delete:
33-
-kubectl delete service deis-workflow
34-
-kubectl delete rc deis-workflow
35-
36-
kube-delete-database:
37-
-kubectl delete service deis-database
38-
-kubectl delete rc deis-database
39-
40-
kube-delete-all: kube-delete kube-delete-database
41-
42-
kube-create: update-manifests
43-
kubectl create -f manifests/deis-workflow-service.yml
44-
kubectl create -f manifests/deis-workflow-rc.tmp.yml
45-
46-
kube-create-database:
47-
kubectl create -f manifests/deis-database-rc.yml
48-
kubectl create -f manifests/deis-database-service.yml
49-
50-
kube-create-all: kube-create-database kube-create
51-
52-
kube-update: update-manifests
53-
kubectl delete -f manifests/deis-workflow-rc.tmp.yml
54-
kubectl create -f manifests/deis-workflow-rc.tmp.yml
55-
56-
update-manifests:
57-
sed 's#\(image:\) .*#\1 $(IMAGE)#' manifests/deis-workflow-rc.yml \
58-
> manifests/deis-workflow-rc.tmp.yml
59-
60-
deploy: docker-build docker-push
61-
sed 's#\(image:\) .*#\1 $(IMAGE)#' /tmp/deis-$(COMPONENT) | kubectl apply --validate=true -f -
62-
kubectl scale rc deis-workflow --replicas 0 --namespace deis
63-
kubectl scale rc deis-workflow --replicas $(DESIRED_REPLICAS) --namespace deis
64-
65-
clean: check-docker
66-
docker rmi $(IMAGE)
67-
68-
commit-hook:
69-
cp contrib/util/commit-msg .git/hooks/commit-msg
70-
71-
full-clean: check-docker
72-
docker images -q $(IMAGE_PREFIX)$(COMPONENT) | xargs docker rmi -f
73-
74-
postgres:
75-
docker start postgres || docker run --restart="always" -d -p 5432:5432 --name postgres postgres:9.3
76-
docker exec postgres createdb -U postgres deis 2>/dev/null || true
77-
@echo "To use postgres for local development:"
78-
@echo " export PGHOST=`docker-machine ip $$(docker-machine active) 2>/dev/null || echo 127.0.0.1`"
79-
@echo " export PGPORT=5432"
80-
@echo " export PGUSER=postgres"
81-
82-
setup-venv:
83-
@if [ ! -d venv ]; then virtualenv venv; fi
84-
venv/bin/pip install --disable-pip-version-check -q -r rootfs/requirements.txt -r rootfs/dev_requirements.txt
85-
86-
test: test-style test-check test-unit test-functional
87-
88-
test-check:
89-
cd rootfs && python manage.py check
1+
export GO15VENDOREXPERIMENT=1
2+
3+
# the filepath to this repository, relative to $GOPATH/src
4+
repo_path = github.com/deis/workflow/client
5+
6+
HOST_OS := $(shell uname)
7+
ifeq ($(HOST_OS),Darwin)
8+
GOOS=darwin
9+
else
10+
GOOS=linux
11+
endif
12+
13+
DEV_ENV_IMAGE := quay.io/deis/go-dev:0.9.0
14+
DEV_ENV_WORK_DIR := /go/src/${repo_path}
15+
DEV_ENV_PREFIX := docker run --rm -e GO15VENDOREXPERIMENT=1 -e CGO_ENABLED=0 -v ${CURDIR}:${DEV_ENV_WORK_DIR} -w ${DEV_ENV_WORK_DIR}
16+
DEV_ENV_CMD := ${DEV_ENV_PREFIX} ${DEV_ENV_IMAGE}
17+
DIST_DIR := _dist
18+
19+
GO_FILES = $(wildcard *.go)
20+
GO_LDFLAGS = -ldflags "-s -X ${repo_path}/version.BuildVersion=${VERSION}"
21+
GO_PACKAGES = cmd controller/api controller/client $(wildcard controller/models/*) parser $(wildcard pkg/*)
22+
GO_PACKAGES_REPO_PATH = $(addprefix $(repo_path)/,$(GO_PACKAGES))
23+
GOFMT = gofmt -e -l -s
24+
GOTEST = go test --cover --race -v
25+
26+
VERSION ?= $(shell git rev-parse --short HEAD)
27+
28+
define check-static-binary
29+
if file $(1) | egrep -q "(statically linked|Mach-O)"; then \
30+
echo -n ""; \
31+
else \
32+
echo "The binary file $(1) is not statically linked. Build canceled"; \
33+
exit 1; \
34+
fi
35+
endef
36+
37+
prep-bintray-json:
38+
# TRAVIS_TAG is set to the tag name if the build is a tag
39+
ifdef TRAVIS_TAG
40+
@jq '.version.name |= "$(VERSION)"' _scripts/ci/bintray-template.json | \
41+
jq '.package.repo |= "deis"' > _scripts/ci/bintray-ci.json
42+
else
43+
@jq '.version.name |= "$(VERSION)"' _scripts/ci/bintray-template.json \
44+
> _scripts/ci/bintray-ci.json
45+
endif
46+
47+
bootstrap:
48+
${DEV_ENV_CMD} glide install
49+
50+
glideup:
51+
${DEV_ENV_CMD} glide up
52+
53+
build: binary-build
54+
@$(call check-static-binary,deis)
55+
56+
build-all:
57+
${DEV_ENV_CMD} gox -verbose \
58+
${GO_LDFLAGS} \
59+
-os="linux darwin " \
60+
-arch="amd64 386" \
61+
-output="$(DIST_DIR)/deis-${VERSION}-{{.OS}}-{{.Arch}}" .
62+
63+
binary-build:
64+
${DEV_ENV_PREFIX} -e GOOS=${GOOS} ${DEV_ENV_IMAGE} go build -a -installsuffix cgo ${GO_LDFLAGS} -o deis .
65+
66+
dist: build-all
67+
68+
install:
69+
cp deis $$GOPATH/bin
70+
71+
installer: build
72+
@if [ ! -d makeself ]; then git clone -b single-binary https://github.com/deis/makeself.git; fi
73+
PATH=./makeself:$$PATH BINARY=deis makeself.sh --bzip2 --current --nox11 . \
74+
deis-cli-`cat deis-version`-`go env GOOS`-`go env GOARCH`.run \
75+
"Deis CLI" "echo \
76+
&& echo 'deis is in the current directory. Please' \
77+
&& echo 'move deis to a directory in your search PATH.' \
78+
&& echo \
79+
&& echo 'See http://docs.deis.io/ for documentation.' \
80+
&& echo"
81+
82+
setup-gotools:
83+
go get -u github.com/golang/lint/golint
84+
go get -u golang.org/x/tools/cmd/cover
85+
go get -u golang.org/x/tools/cmd/vet
86+
87+
test: test-style test-unit
9088

9189
test-style:
92-
cd rootfs && flake8 --show-pep8 --show-source
93-
shellcheck $(SHELL_SCRIPTS)
90+
@if [ $(shell $(GOFMT) $(GO_FILES) $(GO_PACKAGES)) ]; then \
91+
echo "gofmt check failed:"; $(GOFMT) $(GO_FILES) $(GO_PACKAGES); exit 1; \
92+
fi
93+
@go vet $(repo_path) $(GO_PACKAGES_REPO_PATH)
94+
@for i in $(addsuffix /...,$(GO_PACKAGES)); do \
95+
golint $$i; \
96+
done
9497

9598
test-unit:
96-
cd rootfs \
97-
&& coverage run manage.py test --noinput registry api \
98-
&& coverage report -m
99-
100-
test-functional:
101-
@echo "Implement functional tests in _tests directory"
102-
103-
test-integration:
104-
@echo "Check https://github.com/deis/workflow-e2e for the complete interation test suite"
105-
106-
.PHONY: build clean commit-hook full-clean postgres setup-venv test test-style test-unit test-functional
99+
$(GOTEST) $(shell glide novendor)

README.md

Lines changed: 15 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,30 @@
1-
# Deis Workflow v2
1+
# Deis Client
22

3-
[![Build Status](https://travis-ci.org/deis/workflow.svg?branch=master)](https://travis-ci.org/deis/workflow) [![Go Report Card](http://goreportcard.com/badge/deis/workflow)](http://goreportcard.com/report/deis/workflow)
3+
`deis` is a command line utility used to interact with the [Deis](http://deis.io) open source PaaS.
44

5-
Deis (pronounced DAY-iss) is an open source PaaS that makes it easy to deploy and manage
6-
applications on your own servers. Deis builds on [Kubernetes](http://kubernetes.io/) to provide
7-
a lightweight, [Heroku-inspired](http://heroku.com) workflow.
5+
Please add any [issues](https://github.com/deis/workflow/issues) you find with this software to
6+
the [Deis Workflow v2 Project](https://github.com/deis/workflow).
87

9-
## Work in Progress
8+
## Installation
109

11-
![Deis Graphic](https://s3-us-west-2.amazonaws.com/get-deis/deis-graphic-small.png)
10+
Currently the only way to use the go version of the `deis` client is to build it yourself.
11+
To build the `deis` client, you need to have [go](https://golang.org/), [glide](https://github.com/Masterminds/glide),
12+
and [make](https://www.gnu.org/software/make/) installed. Then run `make build`.
1213

13-
Deis Workflow v2 is currently in alpha. Your feedback and participation are more than welcome, but be
14-
aware that this project is considered a work in progress.
14+
## Usage
1515

16-
The following features are not ready in Alpha1, but will be coming
17-
soon.
16+
Running `deis help` will give you a up to date list of `deis` commands.
17+
To learn more about a command run `deis help <command>`.
1818

19-
- Complete SSL support
20-
- Dockerfile builds
21-
- Backup and restore features
22-
- Persistent storage (though it can be manually configured)
19+
## Windows Support
2320

24-
## Hacking Workflow
25-
26-
First, [obtain a Kubernetes cluster][install-k8s]. Deis Workflow currently targets Kubernetes
27-
v1.1 with the following requirements:
28-
29-
* Configure Docker's `insecure-registry` parameter to include the subnets used by your Kubernetes installation
30-
* If you are testing the logger components, you must enable `DaemonSet` experimental APIs via `--runtime-config=extensions/v1beta1/daemonsets=true`
31-
32-
Next, install [helm](http://helm.sh). Next, add the deis repository to your chart list:
33-
34-
```console
35-
$ helm repo add deis https://github.com/deis/charts
36-
```
37-
38-
Then, install Deis!
39-
40-
```console
41-
$ helm install deis/deis
42-
```
43-
44-
Complete instructions for installing and managing a Deis cluster are
45-
available at https://github.com/deis/docs-v2
46-
47-
If you want to retrieve the latest client dev build for OS X or Linux, download the client:
48-
49-
```console
50-
$ curl -sSL http://deis.io/deis-cli/install-v2-alpha.sh | bash
51-
```
52-
53-
If you want to hack on a new feature, build the deis/workflow image and push it to a Docker
54-
registry. The `$DEIS_REGISTRY` environment variable must point to a registry accessible to your
55-
Kubernetes cluster. You may need to configure the Docker engines on your Kubernetes nodes to allow
56-
`--insecure-registry 192.168.0.0/16` (or the appropriate address range).
57-
58-
```console
59-
$ make docker-build docker-push
60-
```
61-
62-
You'll want to modify the deis chart to use your custom image, then run `helm install` on the
63-
chart.
21+
`deis` has experimental support for Windows. To build deis for Windows, you need to install
22+
[go](https://golang.org/) and [glide](https://github.com/Masterminds/glide). Then run the `make.bat` script.
6423

6524
## License
6625

67-
Copyright 2013, 2014, 2015 Engine Yard, Inc.
26+
Copyright 2015, Engine Yard, Inc.
6827

6928
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at <http://www.apache.org/licenses/LICENSE-2.0>
7029

7130
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
72-
73-
74-
[install-k8s]: http://kubernetes.io/gettingstarted/

client/LICENSE

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)