Skip to content

Commit

Permalink
Add kubectl plugin to github artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
marccampbell committed Jan 17, 2020
1 parent 83828dd commit df8e9cf
Show file tree
Hide file tree
Showing 128 changed files with 324 additions and 1,384 deletions.
51 changes: 0 additions & 51 deletions .buildkite/pipeline.yml

This file was deleted.

101 changes: 101 additions & 0 deletions .github/workflows/alpha-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: "Alpha release"
on:
push:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v1
with:
go-version: "1.12.14"
- name: setup goenv
run: |
echo "::set-env name=GOPATH::$(go env GOPATH)"
echo "::add-path::$(go env GOPATH)/bin"
shell: bash
- uses: actions/checkout@master
- name: setup kubebuilder
run: |
echo "::add-path::/usr/local/kubebuilder/bin"
- run: make kubebuilder all
- uses: actions/upload-artifact@v1
with:
name: schemahero
path: bin/schemahero
- uses: actions/upload-artifact@v1
with:
name: manager
path: bin/manager
- uses: actions/upload-artifact@v1
with:
name: kubectl-schemahero
path: bin/kubectl-schemahero

## We list each here so that they all show up in the output of github checks
test-postgres:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@master
- name: Download schemahero binary
uses: actions/download-artifact@v1
with:
name: schemahero
path: bin/
- run: chmod +x bin/schemahero
- run: make -C integration/tests/postgres/column-set-default run
- run: make -C integration/tests/postgres/column-unset-default run
- run: make -C integration/tests/postgres/create-table run
- run: make -C integration/tests/postgres/foreign-key-create run
- run: make -C integration/tests/postgres/foreign-key-action run
- run: make -C integration/tests/postgres/foreign-key-drop run
- run: make -C integration/tests/postgres/foreign-key-alter run
- run: make -C integration/tests/postgres/not-null run
- run: make -C integration/tests/postgres/index-create run
- run: make -C integration/tests/postgres/primary-key-add run
- run: make -C integration/tests/postgres/primary-key-drop run

## We list each here so that they all show up in the output of github checks
test-mysql:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@master
- name: Download schemahero binary
uses: actions/download-artifact@v1
with:
name: schemahero
path: bin/
- run: chmod +x bin/schemahero
- run: make -C integration/tests/mysql/column-set-default run
- run: make -C integration/tests/mysql/column-unset-default run
- run: make -C integration/tests/mysql/create-table run
- run: make -C integration/tests/mysql/foreign-key-create run
- run: make -C integration/tests/mysql/foreign-key-action run
- run: make -C integration/tests/mysql/foreign-key-drop run
- run: make -C integration/tests/mysql/foreign-key-alter run
- run: make -C integration/tests/mysql/not-null run
- run: make -C integration/tests/mysql/index-create run
- run: make -C integration/tests/mysql/primary-key-add run
- run: make -C integration/tests/mysql/primary-key-drop run

goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Unshallow
run: git fetch --prune --unshallow
- uses: actions/setup-go@v1
with:
go-version: "1.12.14"
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v1
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54 changes: 53 additions & 1 deletion .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
steps:
- uses: actions/setup-go@v1
with:
go-version: '1.12.14'
go-version: "1.12.14"
- name: setup goenv
run: |
echo "::set-env name=GOPATH::$(go env GOPATH)"
Expand All @@ -26,3 +26,55 @@ jobs:
with:
name: manager
path: bin/manager
- uses: actions/upload-artifact@v1
with:
name: kubectl-schemahero
path: bin/kubectl-schemahero

## We list each here so that they all show up in the output of github checks
test-postgres:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@master
- name: Download schemahero binary
uses: actions/download-artifact@v1
with:
name: schemahero
path: bin/
- run: chmod +x bin/schemahero
- run: make -C integration/tests/postgres/column-set-default run
- run: make -C integration/tests/postgres/column-unset-default run
- run: make -C integration/tests/postgres/create-table run
- run: make -C integration/tests/postgres/foreign-key-create run
- run: make -C integration/tests/postgres/foreign-key-action run
- run: make -C integration/tests/postgres/foreign-key-drop run
- run: make -C integration/tests/postgres/foreign-key-alter run
- run: make -C integration/tests/postgres/not-null run
- run: make -C integration/tests/postgres/index-create run
- run: make -C integration/tests/postgres/primary-key-add run
- run: make -C integration/tests/postgres/primary-key-drop run

## We list each here so that they all show up in the output of github checks
test-mysql:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@master
- name: Download schemahero binary
uses: actions/download-artifact@v1
with:
name: schemahero
path: bin/
- run: chmod +x bin/schemahero
- run: make -C integration/tests/mysql/column-set-default run
- run: make -C integration/tests/mysql/column-unset-default run
- run: make -C integration/tests/mysql/create-table run
- run: make -C integration/tests/mysql/foreign-key-create run
- run: make -C integration/tests/mysql/foreign-key-action run
- run: make -C integration/tests/mysql/foreign-key-drop run
- run: make -C integration/tests/mysql/foreign-key-alter run
- run: make -C integration/tests/mysql/not-null run
- run: make -C integration/tests/mysql/index-create run
- run: make -C integration/tests/mysql/primary-key-add run
- run: make -C integration/tests/mysql/primary-key-drop run
100 changes: 100 additions & 0 deletions .github/workflows/tagged-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: "Tagged release"
on:
push:
tags: ["*"]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v1
with:
go-version: "1.12.14"
- name: setup goenv
run: |
echo "::set-env name=GOPATH::$(go env GOPATH)"
echo "::add-path::$(go env GOPATH)/bin"
shell: bash
- uses: actions/checkout@master
- name: setup kubebuilder
run: |
echo "::add-path::/usr/local/kubebuilder/bin"
- run: make kubebuilder all
- uses: actions/upload-artifact@v1
with:
name: schemahero
path: bin/schemahero
- uses: actions/upload-artifact@v1
with:
name: manager
path: bin/manager
- uses: actions/upload-artifact@v1
with:
name: kubectl-schemahero
path: bin/kubectl-schemahero

## We list each here so that they all show up in the output of github checks
test-postgres:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@master
- name: Download schemahero binary
uses: actions/download-artifact@v1
with:
name: schemahero
path: bin/
- run: chmod +x bin/schemahero
- run: make -C integration/tests/postgres/column-set-default run
- run: make -C integration/tests/postgres/column-unset-default run
- run: make -C integration/tests/postgres/create-table run
- run: make -C integration/tests/postgres/foreign-key-create run
- run: make -C integration/tests/postgres/foreign-key-action run
- run: make -C integration/tests/postgres/foreign-key-drop run
- run: make -C integration/tests/postgres/foreign-key-alter run
- run: make -C integration/tests/postgres/not-null run
- run: make -C integration/tests/postgres/index-create run
- run: make -C integration/tests/postgres/primary-key-add run
- run: make -C integration/tests/postgres/primary-key-drop run

## We list each here so that they all show up in the output of github checks
test-mysql:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@master
- name: Download schemahero binary
uses: actions/download-artifact@v1
with:
name: schemahero
path: bin/
- run: chmod +x bin/schemahero
- run: make -C integration/tests/mysql/column-set-default run
- run: make -C integration/tests/mysql/column-unset-default run
- run: make -C integration/tests/mysql/create-table run
- run: make -C integration/tests/mysql/foreign-key-create run
- run: make -C integration/tests/mysql/foreign-key-action run
- run: make -C integration/tests/mysql/foreign-key-drop run
- run: make -C integration/tests/mysql/foreign-key-alter run
- run: make -C integration/tests/mysql/not-null run
- run: make -C integration/tests/mysql/index-create run
- run: make -C integration/tests/mysql/primary-key-add run
- run: make -C integration/tests/mysql/primary-key-drop run

goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Unshallow
run: git fetch --prune --unshallow
- uses: actions/setup-go@v1
with:
go-version: "1.12.14"
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v1
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ dist/
.DS_Store

vendor
integration/**/out.sql
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<br/>

[![Go Report Card](https://goreportcard.com/badge/github.com/schemahero/schemahero?style=flat-square)](https://goreportcard.com/report/github.com/schemahero/schemahero)
[![Build Status](https://badge.buildkite.com/deaf7798e8cc5f726c9684514a4e63285123481ee410aad94e.svg?branch=master)](https://buildkite.com/replicated/schemahero)
[![Godoc](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](https://godoc.org/github.com/schemahero/schemahero)
[![LICENSE](https://img.shields.io/github/license/schemahero/schemahero.svg?style=flat-square)](https://github.com/schemahero/schemahero/blob/master/LICENSE)

Expand Down
13 changes: 1 addition & 12 deletions integration/Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@

SHELL := /bin/bash
CONSTIMAGE := "ttl.sh/$(shell uuidgen | tr '[:upper:]' '[:lower:]'):1h"
IMAGE ?= $(CONSTIMAGE)

export IMAGE
export GO111MODULE=on

.PHONY: run
run: build postgres mysql
run: postgres mysql

.PHONY: postgres
postgres:
Expand Down Expand Up @@ -38,12 +36,3 @@ mysql:
make -C tests/mysql/index-create run
make -C tests/mysql/primary-key-add run
make -C tests/mysql/primary-key-drop run

.PHONY: build
build: docker-build
docker push $(IMAGE)

.PHONY: docker-build
docker-build:
docker build -t $(IMAGE) -f ../Dockerfile.schemahero ..
@echo "export IMAGE=$(IMAGE)"
2 changes: 1 addition & 1 deletion integration/tests/mysql/column-set-default/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include ../common.mk

TEST_NAME := mysql-column-set-default
SPEC_FILE := /specs/users.yaml
SPEC_FILE := ./specs/users.yaml
2 changes: 2 additions & 0 deletions integration/tests/mysql/column-set-default/expect.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
alter table `users` modify column `account_type` varchar (10) not null default "trial"
alter table `users` modify column `num_seats` int (11) not null default "5"

This file was deleted.

0 comments on commit df8e9cf

Please sign in to comment.