Skip to content

Commit

Permalink
Merge pull request #4 from jdbaldry/jsonnet
Browse files Browse the repository at this point in the history
refactor: Use Jsonnet instead of CUE for now
  • Loading branch information
jdbaldry authored Dec 7, 2020
2 parents f945630 + a8afa6e commit aee31e4
Show file tree
Hide file tree
Showing 85 changed files with 4,521 additions and 5,847 deletions.
108 changes: 0 additions & 108 deletions .drone/drone.cue

This file was deleted.

105 changes: 105 additions & 0 deletions .drone/drone.jsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
local pipeline = {
kind: 'pipeline',
platform: { os: 'linux', arch: 'amd64' },
};

local build_image = 'jdbgrafana/haproxy-mixin-build-image:0.0.3';

local step = {
check_artifacts: {
name: 'check artifacts',
image: build_image,
commands: [
'make build',
'git diff --exit-code',
],
},
};
[
pipeline {
name: 'pr',
steps: [
{
name: 'check .drone/drone.yml',
image: build_image,
commands: [
'make .drone/drone.yml',
'git diff --exit-code -- .drone/drone.yml',
],
},
{
name: 'check formatting',
image: build_image,
commands: [
'make fmt',
'git diff --exit-code',
],
},
step.check_artifacts,
{
name: 'lint mixin',
image: build_image,
commands: [
'make lint',
],
},
],
trigger: { event: { include: ['pull_request'] } },
},
pipeline {
name: 'default',
steps: [
{
name: 'fmt',
image: build_image,
commands: [
'make fmt',
],
},
{
name: '.drone/drone.yml',
image: build_image,
commands: [
'make .drone/drone.yml',
],
},
{
name: 'build',
image: build_image,
commands: [
'make build',
],
},
{
name: 'lint',
image: build_image,
commands: [
'make lint',
],
},
],
trigger: { event: { include: ['custom'] } },
},
pipeline {
name: 'release',
steps: [
step.check_artifacts,
{
name: 'make dist/haproxy-mixin.tar.gz',
image: build_image,
commands: [
'make dist/haproxy-mixin.tar.gz',
],
},
{
name: 'publish',
image: 'plugins/github-release',
settings: {
api_key: { from_secret: 'github_token' },
files: 'dist/*',
},
},
],
trigger: { event: { include: ['tag'] } },
},
]
58 changes: 38 additions & 20 deletions .drone/drone.yml
Original file line number Diff line number Diff line change
@@ -1,83 +1,101 @@
name: pr
---
kind: pipeline
name: pr

platform:
os: linux
arch: amd64

steps:
- name: check .drone/drone.yml
image: jdbgrafana/haproxy-mixin-build-image:0.0.2
image: jdbgrafana/haproxy-mixin-build-image:0.0.3
commands:
- make .drone/drone.yml
- git diff --exit-code -- .drone/drone.yml

- name: check formatting
image: jdbgrafana/haproxy-mixin-build-image:0.0.2
image: jdbgrafana/haproxy-mixin-build-image:0.0.3
commands:
- make fmt
- git diff --exit-code

- name: check artifacts
image: jdbgrafana/haproxy-mixin-build-image:0.0.2
image: jdbgrafana/haproxy-mixin-build-image:0.0.3
commands:
- make build
- git diff --exit-code

- name: lint mixin
image: jdbgrafana/haproxy-mixin-build-image:0.0.2
image: jdbgrafana/haproxy-mixin-build-image:0.0.3
commands:
- make lint

trigger:
event:
include:
- pull_request
- pull_request

---
name: default
kind: pipeline
name: default

platform:
os: linux
arch: amd64

steps:
- name: fmt
image: jdbgrafana/haproxy-mixin-build-image:0.0.2
image: jdbgrafana/haproxy-mixin-build-image:0.0.3
commands:
- make fmt

- name: .drone/drone.yml
image: jdbgrafana/haproxy-mixin-build-image:0.0.2
image: jdbgrafana/haproxy-mixin-build-image:0.0.3
commands:
- make .drone/drone.yml

- name: build
image: jdbgrafana/haproxy-mixin-build-image:0.0.2
image: jdbgrafana/haproxy-mixin-build-image:0.0.3
commands:
- make build

- name: lint
image: jdbgrafana/haproxy-mixin-build-image:0.0.2
image: jdbgrafana/haproxy-mixin-build-image:0.0.3
commands:
- make lint

trigger:
event:
include:
- custom
- custom

---
name: release
kind: pipeline
name: release

platform:
os: linux
arch: amd64

steps:
- name: check artifacts
image: jdbgrafana/haproxy-mixin-build-image:0.0.2
image: jdbgrafana/haproxy-mixin-build-image:0.0.3
commands:
- make build
- git diff --exit-code

- name: make dist/haproxy-mixin.tar.gz
image: jdbgrafana/haproxy-mixin-build-image:0.0.2
image: jdbgrafana/haproxy-mixin-build-image:0.0.3
commands:
- make dist/haproxy-mixin.tar.gz

- name: publish
image: plugins/github-release
settings:
files: dist/*
api_key:
from_secret: github_token
files: dist/*

trigger:
event:
include:
- tag
- tag

...
12 changes: 0 additions & 12 deletions .drone/dump_tool.cue

This file was deleted.

Loading

0 comments on commit aee31e4

Please sign in to comment.