Skip to content

Commit

Permalink
initial
Browse files Browse the repository at this point in the history
  • Loading branch information
gunerhuseyin committed Jul 8, 2020
0 parents commit ccc61d9
Show file tree
Hide file tree
Showing 34 changed files with 3,741 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
examples
.git
.gitignore
.github
*.md
.goreleaser.yml
Dockerfile
LICENSE
22 changes: 22 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Linter

on:
push:
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'

jobs:
Golint:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Run GoLinter
uses: reviewdog/action-golangci-lint@v1
with:
golangci_lint_flags: "--tests=false"
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Release

on:
pull_request:
push:
tags:
- 'v*.*.*'

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.14
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31 changes: 31 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Test

on:
push:
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'

jobs:
Build:
strategy:
fail-fast: false
matrix:
go-version: [1.13.x, 1.14.x]
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Setup Go ${{ matrix.go }}
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go-version }}
-
name: Fetch Repository
uses: actions/checkout@v2
- name: Build
run: go build -v .
-
name: Test
run: go test ./... -v
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
*.tar
vendor/
gaos
48 changes: 48 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
env:
- CGO_ENABLED=0
- GOFLAGS=-mod=vendor
- GO111MODULE=auto

before:
hooks:
- go mod download
- go mod vendor

builds:
- id: binary
goos:
- linux
- darwin
- windows
goarch:
- amd64
ldflags:
- -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} -X main.builtBy=GoReleaser

archives:
- builds:
- binary
replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: x86
amd64: x86_64
format_overrides:
- goos: windows
format: zip
files: ["LICENSE"]

checksum:
name_template: 'checksums.txt'
algorithm: sha256

snapshot:
name_template: "{{ .Tag }}-next"

changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
Binary file added .res/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Compose CODEOWNERS file

# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
# @zeus-team will be requested for review when someone opens a pull request.

* @Trendyol/zeus-team
31 changes: 31 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
ARG IMAGE_BASE=golang
ARG GO_VERSION=1.14

ARG VERSION
ARG COMMIT
ARG DATE

FROM ${IMAGE_BASE}:${GO_VERSION} AS builder

ENV CGO_ENABLED=0
ENV GOOS=linux
ENV GOARCH=amd64
ENV GO111MODULE=on

ADD . ./app

WORKDIR app

RUN go mod vendor

RUN go build \
-a -mod=vendor \
-ldflags="-s -w \
-X main.version=${VERSION} \
-X main.commit=${COMMIT} \
-X main.date=${DATE} \
-X main.builtBy=Docker" \
-o ./gaos

ENTRYPOINT ["./gaos"]

19 changes: 19 additions & 0 deletions Dockerfile.base
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
ARG IMAGE_BASE=golang
ARG GO_VERSION=1.14

FROM ${IMAGE_BASE}:${GO_VERSION} AS builder

ENV CGO_ENABLED=0
ENV GOOS=linux
ENV GOARCH=amd64
ENV GO111MODULE=on

ADD . ./app

WORKDIR app

RUN CGO_ENABLED=${CGO_ENABLED} GOOS=${GOOS} GOARCH=${GOARCH} go build -ldflags="-w -s" -o gaos

FROM scratch

COPY --from=builder /go/app/gaos /gaos
17 changes: 17 additions & 0 deletions Dockerfile.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM zoobab/kind

COPY . .
WORKDIR .


RUN git clone https://github.com/bats-core/bats-core.git && \
cd bats-core && \
./install.sh /usr/local && \
bats --version

RUN docker version && \
kind version && \
kind create cluster && \
kubectl cluster-info --context kind-kind \

RUN bats e2e.bats
Loading

0 comments on commit ccc61d9

Please sign in to comment.