Skip to content

Commit

Permalink
Rewrite the installer such that manifests are maintainable
Browse files Browse the repository at this point in the history
  • Loading branch information
jessesuen committed Mar 7, 2018
1 parent a45bf1b commit 06c0d32
Show file tree
Hide file tree
Showing 20 changed files with 615 additions and 619 deletions.
18 changes: 8 additions & 10 deletions Dockerfile-builder
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,21 @@ RUN apt-get update && apt-get install -y \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Install go
ENV GO_VERSION 1.9.1
ENV GO_VERSION 1.9.3
ENV GO_ARCH amd64
ENV GOPATH /root/go
ENV PATH ${GOPATH}/bin:/usr/local/go/bin:${PATH}
RUN wget https://storage.googleapis.com/golang/go${GO_VERSION}.linux-${GO_ARCH}.tar.gz && \
tar -C /usr/local/ -xf /go${GO_VERSION}.linux-${GO_ARCH}.tar.gz && \
rm /go${GO_VERSION}.linux-${GO_ARCH}.tar.gz && \
# A dummy directory is created under $GOPATH/src/dummy so we are able to use dep
# to install all the packages of our dep lock file
mkdir -p ${GOPATH}/src/dummy
wget https://github.com/golang/dep/releases/download/v0.4.1/dep-linux-amd64 -O /usr/local/bin/dep && \
chmod +x /usr/local/bin/dep

# Install Go dependencies and some tooling
COPY Gopkg.toml ${GOPATH}/src/dummy
COPY Gopkg.lock ${GOPATH}/src/dummy
RUN go get -u github.com/golang/dep/cmd/dep && \
rm -rf ${GOPATH}/src/github.com && \
cd ${GOPATH}/src/dummy && \
# A dummy directory is created under $GOPATH/src/dummy so we are able to use dep
# to install all the packages of our dep lock file
COPY Gopkg.toml ${GOPATH}/src/dummy/Gopkg.toml
COPY Gopkg.lock ${GOPATH}/src/dummy/Gopkg.lock
RUN cd ${GOPATH}/src/dummy && \
dep ensure -vendor-only && \
mv vendor/* ${GOPATH}/src/ && \
rmdir vendor && \
Expand Down
40 changes: 39 additions & 1 deletion Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ required = [
"k8s.io/code-generator/cmd/deepcopy-gen",
"k8s.io/code-generator/cmd/informer-gen",
"k8s.io/code-generator/cmd/lister-gen",
# required by packr build (which we don't import as a package)
"golang.org/x/sync/errgroup",
]

[[constraint]]
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ builder:

.PHONY: cli
cli:
go build -v -i -ldflags '${LDFLAGS}' -o ${DIST_DIR}/${ARGO_CLI_NAME} ./cmd/argo
CGO_ENABLED=0 go run vendor/github.com/gobuffalo/packr/packr/main.go build -v -i -ldflags '${LDFLAGS}' -o ${DIST_DIR}/${ARGO_CLI_NAME} ./cmd/argo

.PHONY: cli-linux
cli-linux: builder
Expand Down
Loading

0 comments on commit 06c0d32

Please sign in to comment.