Skip to content

Commit

Permalink
v0.5.1: Rebase on a helm+kubectl Docker image. Document docker example.
Browse files Browse the repository at this point in the history
  • Loading branch information
josdotso committed Jun 7, 2018
1 parent 02b9a01 commit 0131ee3
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 17 deletions.
8 changes: 1 addition & 7 deletions .envrc
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
export AWS_PROFILE=myprofile
export PROJECT=$(basename "${PWD}")

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

export DOCKER_IMAGE="${DOCKER_REPOSITORY}:${DOCKER_TAG}"
eval `aws ecr get-login --no-include-email`
7 changes: 3 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
FROM golang:latest
FROM golang:latest AS golang
WORKDIR /go/src/github.com/cisco-sso/mh
RUN go get -u github.com/golang/dep/cmd/dep
COPY . .
RUN dep ensure \
&& CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o mh .

FROM alpine:latest
RUN apk --no-cache add ca-certificates
FROM dtzar/helm-kubectl:2.8.0
WORKDIR /root/
COPY --from=0 /go/src/github.com/cisco-sso/mh/mh .
COPY --from=golang /go/src/github.com/cisco-sso/mh/mh .
ENTRYPOINT ["./mh"]
6 changes: 1 addition & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@
dockerBuild: Dockerfile
docker build -t ${DOCKER_IMAGE} .

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

.PHONY: dockerTest
dockerTest:
docker run -it --rm ${DOCKER_IMAGE}

.PHONY: awsEcrCreateRepo
awsEcrCreateRepo:
aws ecr create-repository --repository-name ${DOCKER_NAMESPACE}/${PROJECT}

23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,29 @@ mh destroy wordpress
mh status foo --json 2>&1 | jq --slurp
```

## Docker

```
docker run --rm \
-v $(pwd):/platform-deploy \
-v ~/.kube:/.kube \
-v ~/.helm:/root/.helm \
-e KUBECONFIG=/.kube/mycluster.example.org \
-e MH_CONFIG=/platform-deploy/clusters/mycluster.example.org/mh/main.yaml \
ciscosso/mh simulate
```

**NOTE:** The MH apps and config in this example exist in the platform-deploy tree.

Apps should be stored relative to MH config. (use `configPath` instead of `path`).

```
appSources:
- name: apps
kind: configPath
source: ../../../apps
```

## Contributing

For information on contributing to this repo, please see the accompanying `CONTRIBUTING.md` file.
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func Execute() {
}

func init() {
versionNumber = "v0.5.0"
versionNumber = "v0.5.1"

cobra.OnInitialize(initConfig)

Expand Down

0 comments on commit 0131ee3

Please sign in to comment.