Skip to content
This repository was archived by the owner on Aug 12, 2025. It is now read-only.

Commit f338d25

Browse files
authored
Merge pull request #57 from packethost/ghactions
switch to github actions
2 parents 5ef73c0 + dfbb715 commit f338d25

File tree

3 files changed

+51
-59
lines changed

3 files changed

+51
-59
lines changed

.drone.yml

Lines changed: 0 additions & 55 deletions
This file was deleted.

.github/workflows/ci.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Continuous Integration
2+
on:
3+
pull_request:
4+
types: [opened, synchronize, reopened]
5+
push:
6+
branches:
7+
- master
8+
9+
jobs:
10+
report:
11+
name: Report
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: ref
15+
run: echo ${{ github.ref }}
16+
- name: event_name
17+
run: echo ${{ github.event_name }}
18+
build:
19+
name: Build
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: checkout
23+
uses: actions/checkout@v2
24+
- uses: actions/setup-go@v2
25+
with:
26+
go-version: '1.14.2' # The Go version to download (if necessary) and use.
27+
- name: kubebuilder-env
28+
run: echo "::set-env name=KUBEBUILDER_DIR::/tmp/kubebuilder_install"
29+
- name: kubebuilder
30+
run: make kubebuilder KUBEBUILDER_DIR=${KUBEBUILDER_DIR} # we use this dir because /usr/local/kubebuilder is protected
31+
- name: test
32+
run: make test KUBEBUILDER_DIR=${KUBEBUILDER_DIR}
33+
env:
34+
KUBEBUILDER_ASSETS: ${{ env.KUBEBUILDER_DIR }}/bin
35+
- name: hub login
36+
if: (github.event_name == 'push' && endsWith(github.ref,'/master')) || (github.event_name == 'create' && startsWith(github.ref,'refs/tags/'))
37+
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
38+
- 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
39+
if: github.event_name == 'push' && endsWith(github.ref,'/master')
40+
run: make cd CONFIRM=true
41+
- 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
42+
if: github.event_name == 'push' && endsWith(github.ref,'/master')
43+
run: make cd CONFIRM=true BRANCH_NAME=master
44+
- 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
45+
if: github.event_name == 'create' && startsWith(github.ref,'refs/tags/')
46+
run: make release CONFIRM=true

Makefile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
.PHONY: vendor test manager clusterctl run install deploy manifests generate fmt vet run kubebuilder ci cd
22

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

@@ -54,7 +56,7 @@ GO ?= GO111MODULE=on CGO_ENABLED=0 go
5456

5557

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

@@ -136,7 +138,7 @@ $(KUBEBUILDER):
136138
curl -sL https://go.kubebuilder.io/dl/$(KUBEBUILDER_VERSION)/$(BUILDOS)/$(BUILDARCH) | tar -xz -C /tmp/
137139
# move to a long-term location and put it on your path
138140
# (you'll need to set the KUBEBUILDER_ASSETS env var if you put it somewhere else)
139-
mv /tmp/kubebuilder_$(KUBEBUILDER_VERSION)_$(BUILDOS)_$(BUILDARCH) /usr/local/kubebuilder
141+
mv /tmp/kubebuilder_$(KUBEBUILDER_VERSION)_$(BUILDOS)_$(BUILDARCH) $(KUBEBUILDER_DIR)
140142

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

152153
# Build manager binary

0 commit comments

Comments
 (0)