Skip to content

Commit

Permalink
CI: Create GHA workflow file (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
erikkn authored Mar 31, 2021
1 parent 25de88c commit 2e88141
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Go

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:

build_and_publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Go env
uses: actions/setup-go@v2
with:
go-version: 1.15

- name: Test Klaabu package
run: make test

- name: Build Klaabu for Linux
run: make GOOS=linux GOARCH=amd64 build

- name: Build Klaabu for MacOS
run: make GOOS=darwin GOARCH=amd64 build

- name: Publish the Klaabu binary
uses: softprops/action-gh-release@v1
if: github.ref == 'refs/heads/master'
with:
files: |
klaabu-linux-amd64
klaabu-darwin-amd64
env:
GITHUB_TOKEN: ${{ secrets.PUBLISH_TOKEN}}

7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,14 @@ vendor:
go mod vendor

compile:
ifdef GOOS
ifdef GOARCH
env
go build -mod=readonly -o ${BIN}-$(GOOS)-$(GOARCH) cli/*.go
endif
else
go build -mod=readonly -o ${BIN} cli/*.go
endif

test:
go test -v ./...
Expand Down
Binary file removed cli/cli
Binary file not shown.
26 changes: 26 additions & 0 deletions schema.kml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
schema: [organization=foobar,version=v1]

vlans:
a: x

asns:
65000: foo-bar # Corporate network

cidrs:
10.0.0.0/8:
10.22.0.0/16: office [foo=bar]
10.22.0.1/20: vpc-partner [asn=foobar]
10.29.0.0/22: delivery [account=foobar,region=eu-central-1,vpc=runtime-delivery]
192.168.0.0/12: # aws aggregate
192.169.0.0/16: k8s-production [account=foobar-production,region=eu-central-1,shared-vpc=true]
192.169.0.0/20: abc-1 [env=prod,owner=xyz,site=aws,vpc=main-k8s-1]
192.169.16.0/20: abc-2 [env=prod,owner=xyz,site=aws,vpc=main-k8s-2]
192.169.32.0/20: abc-3 [env=prod,owner=xyz,site=aws,vpc=main-k8s-3]
192.169.48.0/20: abc-4 [env=prod,owner=xyz,site=aws,vpc=main-k8s-4]
192.170.0.0/16: k8s-staging [account=foobar-staging,region=eu-central-1,shared-vpc=true]
192.170.0.0/20: def-1 [env=stag,owner=xyz,site=aws,vpc=k8s-stag-1]
192.170.16.0/20: def-2 [env=stag,owner=xyz,site=aws,vpc=k8s-stag-2]
192.170.32.0/20: def-3 [env=stag,owner=xyz,site=aws,vpc=k8s-stag-3]
192.170.48.0/20: def-4 [env=stag,owner=xyz,site=aws,vpc=k8s-stag-4]
192.170.64.0/20: def-5 [env=stag,owner=xyz,site=aws,vpc=k8s-stag-5]
192.170.80.0/20: def-6 [env=stag,owner=xyz,site=aws,vpc=k8s-stag-6]

0 comments on commit 2e88141

Please sign in to comment.