Skip to content
This repository was archived by the owner on Aug 12, 2025. It is now read-only.
Merged
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
24 changes: 18 additions & 6 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,36 @@ steps:
pull: always
image: golang:1.12.7-alpine
commands:
- apk --update add make git
- make ci
- apk --update add make git bash jq curl
- make ci-test

- name: publish-amd64
- name: image
pull: always
image: plugins/docker
settings:
dry_run: true
context: .
dockerfile: Dockerfile
repo: packethost/cluster-api-provider-packet
tags:
- latest

- name: publish
pull: always
image: plugins/docker
settings:
context: .
dockerfile: Dockerfile
password:
from_secret: docker_password
repo: packethost/metabot
repo: packethost/cluster-api-provider-packet
tags:
- "${DRONE_COMMIT}"
- latest
username:
from_secret: docker_username
when:
branch: master
event:
exclude:
- pull_request
- push
- tag
23 changes: 18 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
.PHONY: vendor test manager clusterctl run install deploy manifests generate fmt vet run
.PHONY: vendor test manager clusterctl run install deploy manifests generate fmt vet run kubebuilder ci cd

KUBEBUILDER_VERSION ?= 2.0.0-beta.0
KUBEBUILDER ?= /usr/local/kubebuilder/bin/kubebuilder

GIT_VERSION?=$(shell git log -1 --format="%h")
RELEASE_TAG ?= $(shell git tag --points-at HEAD)
Expand Down Expand Up @@ -41,7 +44,7 @@ CLUSTERCTL ?= bin/clusterctl-$(OS)-$(ARCH)
MANAGER ?= bin/manager-$(OS)-$(ARCH)
KUBECTL ?= kubectl

GO ?= GO111MODULE=on go
GO ?= GO111MODULE=on CGO_ENABLED=0 go

all: test manager clusterctl

Expand All @@ -50,7 +53,9 @@ vendor:
$(GO) mod vendor
./hack/update-vendor.sh

ci: fmt vet test image
# 2 separate targets: ci-test does everything locally, does not need docker; ci includes ci-test and building the image
ci-test: fmt vet test
ci: ci-test image

imagetag:
ifndef IMAGETAG
Expand All @@ -68,9 +73,17 @@ endif
cd: confirm
$(MAKE) tag-image push IMAGETAG=$(GIT_VERSION)

# needed kubebuilder for tests
kubebuilder: $(KUBEBUILDER)
$(KUBEBUILDER):
curl -sL https://go.kubebuilder.io/dl/$(KUBEBUILDER_VERSION)/$(BUILDOS)/$(BUILDARCH) | tar -xz -C /tmp/
# move to a long-term location and put it on your path
# (you'll need to set the KUBEBUILDER_ASSETS env var if you put it somewhere else)
mv /tmp/kubebuilder_$(KUBEBUILDER_VERSION)_$(BUILDOS)_$(BUILDARCH) /usr/local/kubebuilder


# Run tests
test: vendor generate fmt vet manifests
test: vendor generate fmt vet manifests $(KUBEBUILDER)
$(GO) test -mod=vendor ./pkg/... ./cmd/... -coverprofile cover.out

# Build manager binary
Expand Down Expand Up @@ -133,7 +146,7 @@ endif

# Build the docker image
image: docker-build
docker-build: test
docker-build:
docker build -t $(BUILD_IMAGE_TAG) .

# Push the docker image
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,3 +266,4 @@ Important notes:

* [kubeadm yaml api](https://godoc.org/k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1beta2)