Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

image generation and version fix #45

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ FROM alpine
LABEL maintainers="Kubernetes Authors"
LABEL description="CSI External Provisioner"

COPY csi-provisioner csi-provisioner
COPY ./deploy/docker/csi-provisioner csi-provisioner
ENTRYPOINT ["/csi-provisioner"]
2 changes: 1 addition & 1 deletion Dockerfile.builder
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ LABEL description="CSI External Provisioner"
WORKDIR /go/src/github.com/kubernetes-csi/external-provisioner
COPY . .
RUN cd cmd/csi-provisioner && \
go install
CGO_ENABLED=0 GOOS=linux go install -a -ldflags '-extldflags "-static"' -o ./bin/csi-provisioner ./cmd/csi-provisioner
47 changes: 21 additions & 26 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,36 +12,31 @@
# See the License for the specific language governing permissions and
# limitations under the License.

IMAGE = k8scsi/csi-provisioner
VERSION = v0.2.0
IMAGE_NAME = quay.io/k8scsi/csi-provisioner
IMAGE_VERSION = v0.2.0

container: build quick-container
.PHONY: container
ifdef V
TESTARGS = -v -args -alsologtostderr -v 5
else
TESTARGS =
endif

clean:
rm -f external-provisioner
rm -rf _output
.PHONY: clean

format:
gofmt -w -s ./
.PHONY: format
all: csi-provisioner

deps:
dep ensure -update
.PHONY: deps
csi-provisioner:
mkdir -p bin
CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' -o ./bin/csi-provisioner ./cmd/csi-provisioner

quick-container:
sudo ./hack/build-container.sh
@echo ""
@echo "Container quay.io/k8scsi/csi-provisioner:canary created"
.PHONY: quick-container
clean:
rm -rf bin deploy/docker/csi-provisioner

provisioner:
mkdir -p _output
go build -i -o _output/csi-provisioner ./cmd/csi-provisioner/
.PHONY: provisioner
container: csi-provisioner
cp bin/csi-provisioner deploy/docker
docker build -t $(IMAGE_NAME):$(IMAGE_VERSION) .

all build: provisioner
push: container
docker push $(IMAGE_NAME):$(IMAGE_VERSION)

.PHONY: all build
test:
go test `go list ./... | grep -v 'vendor'` $(TESTARGS)
go vet `go list ./... | grep -v vendor`
3 changes: 2 additions & 1 deletion hack/build-container.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/bin/sh

NAME=csi-provisioner
TAG=canary
VER=$1
TAG="${VER:-canary}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we ok with this new version scheme @lpabon @childsb @jsafrane ?

CONTAINER=quay.io/k8scsi/${NAME}:${TAG}
APP=csi-provisioner

Expand Down