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
55 changes: 0 additions & 55 deletions .drone.yml

This file was deleted.

46 changes: 46 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Continuous Integration
on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches:
- master

jobs:
report:
name: Report
runs-on: ubuntu-latest
steps:
- name: ref
run: echo ${{ github.ref }}
- name: event_name
run: echo ${{ github.event_name }}
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.14.2' # The Go version to download (if necessary) and use.
- name: kubebuilder-env
run: echo "::set-env name=KUBEBUILDER_DIR::/tmp/kubebuilder_install"
- name: kubebuilder
run: make kubebuilder KUBEBUILDER_DIR=${KUBEBUILDER_DIR} # we use this dir because /usr/local/kubebuilder is protected
- name: test
run: make test KUBEBUILDER_DIR=${KUBEBUILDER_DIR}
env:
KUBEBUILDER_ASSETS: ${{ env.KUBEBUILDER_DIR }}/bin
- name: hub login
if: (github.event_name == 'push' && endsWith(github.ref,'/master')) || (github.event_name == 'create' && startsWith(github.ref,'refs/tags/'))
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: deploy-tag # when merged into master, tag master and push - ideally, this would be a separate job, but you cannot share docker build cache between jobs
if: github.event_name == 'push' && endsWith(github.ref,'/master')
run: make cd CONFIRM=true
- name: deploy-master # when merged into master, tag master and push - ideally, this would be a separate job, but you cannot share docker build cache between jobs
if: github.event_name == 'push' && endsWith(github.ref,'/master')
run: make cd CONFIRM=true BRANCH_NAME=master
- name: release # when based on a tag, tag master and push - ideally, this would be a separate job, but you cannot share docker build cache between jobs
if: github.event_name == 'create' && startsWith(github.ref,'refs/tags/')
run: make release CONFIRM=true
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
.PHONY: vendor test manager clusterctl run install deploy manifests generate fmt vet run kubebuilder ci cd

KUBEBUILDER_VERSION ?= 2.3.1
KUBEBUILDER ?= /usr/local/kubebuilder/bin/kubebuilder
# default install location for kubebuilder; can be placed elsewhere
KUBEBUILDER_DIR ?= /usr/local/kubebuilder
KUBEBUILDER ?= $(KUBEBUILDER_DIR)/bin/kubebuilder
CONTROLLER_GEN_VERSION ?= v0.3.0
CONTROLLER_GEN=$(GOBIN)/controller-gen

Expand Down Expand Up @@ -54,7 +56,7 @@ GO ?= GO111MODULE=on CGO_ENABLED=0 go


# Image URL to use all building/pushing image targets
IMG ?= controller:latest
IMG ?= packethost/cluster-api-provider-packet:latest
# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
CRD_OPTIONS ?= "crd:trivialVersions=true"

Expand Down Expand Up @@ -136,7 +138,7 @@ $(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
mv /tmp/kubebuilder_$(KUBEBUILDER_VERSION)_$(BUILDOS)_$(BUILDARCH) $(KUBEBUILDER_DIR)

# Run tests
test: generate fmt vet manifests
Expand All @@ -146,7 +148,6 @@ test: generate fmt vet manifests
e2e:
# This is the name used inside the component.yaml for the container that runs the manager
# The image gets loaded inside kind from ./test/e2e/config/packet-dev.yaml
docker tag $(IMG) $(BUILD_IMAGE)
$(E2E_FLAGS) $(MAKE) -C test/e2e run

# Build manager binary
Expand Down