Skip to content

Commit 0131ee3

Browse files
author
Joshua M. Dotson
committed
v0.5.1: Rebase on a helm+kubectl Docker image. Document docker example.
1 parent 02b9a01 commit 0131ee3

File tree

5 files changed

+29
-17
lines changed

5 files changed

+29
-17
lines changed

.envrc

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
1-
export AWS_PROFILE=myprofile
21
export PROJECT=$(basename "${PWD}")
32

4-
export DOCKER_REGISTRY="myregistry.amazonaws.com""
5-
export DOCKER_NAMESPACE="arch"
6-
7-
export DOCKER_REPOSITORY="${DOCKER_REGISTRY}/${DOCKER_NAMESPACE}/${PROJECT}"
3+
export DOCKER_REPOSITORY=ciscosso/mh
84
export DOCKER_TAG=$(grep 'versionNumber = ' cmd/root.go | cut -d\" -f2)
95

106
export DOCKER_IMAGE="${DOCKER_REPOSITORY}:${DOCKER_TAG}"
11-
12-
eval `aws ecr get-login --no-include-email`

Dockerfile

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
FROM golang:latest
1+
FROM golang:latest AS golang
22
WORKDIR /go/src/github.com/cisco-sso/mh
33
RUN go get -u github.com/golang/dep/cmd/dep
44
COPY . .
55
RUN dep ensure \
66
&& CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o mh .
77

8-
FROM alpine:latest
9-
RUN apk --no-cache add ca-certificates
8+
FROM dtzar/helm-kubectl:2.8.0
109
WORKDIR /root/
11-
COPY --from=0 /go/src/github.com/cisco-sso/mh/mh .
10+
COPY --from=golang /go/src/github.com/cisco-sso/mh/mh .
1211
ENTRYPOINT ["./mh"]

Makefile

+1-5
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,11 @@
22
dockerBuild: Dockerfile
33
docker build -t ${DOCKER_IMAGE} .
44

5+
## We use Docker Hub's Automated Build, so this target isn't commonly used.
56
.PHONY: dockerPush
67
dockerPush: dockerBuild
78
docker push ${DOCKER_IMAGE}
89

910
.PHONY: dockerTest
1011
dockerTest:
1112
docker run -it --rm ${DOCKER_IMAGE}
12-
13-
.PHONY: awsEcrCreateRepo
14-
awsEcrCreateRepo:
15-
aws ecr create-repository --repository-name ${DOCKER_NAMESPACE}/${PROJECT}
16-

README.md

+23
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,29 @@ mh destroy wordpress
147147
mh status foo --json 2>&1 | jq --slurp
148148
```
149149

150+
## Docker
151+
152+
```
153+
docker run --rm \
154+
-v $(pwd):/platform-deploy \
155+
-v ~/.kube:/.kube \
156+
-v ~/.helm:/root/.helm \
157+
-e KUBECONFIG=/.kube/mycluster.example.org \
158+
-e MH_CONFIG=/platform-deploy/clusters/mycluster.example.org/mh/main.yaml \
159+
ciscosso/mh simulate
160+
```
161+
162+
**NOTE:** The MH apps and config in this example exist in the platform-deploy tree.
163+
164+
Apps should be stored relative to MH config. (use `configPath` instead of `path`).
165+
166+
```
167+
appSources:
168+
- name: apps
169+
kind: configPath
170+
source: ../../../apps
171+
```
172+
150173
## Contributing
151174

152175
For information on contributing to this repo, please see the accompanying `CONTRIBUTING.md` file.

cmd/root.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func Execute() {
5959
}
6060

6161
func init() {
62-
versionNumber = "v0.5.0"
62+
versionNumber = "v0.5.1"
6363

6464
cobra.OnInitialize(initConfig)
6565

0 commit comments

Comments
 (0)