Skip to content

Commit

Permalink
feat: rename bounce -> sgtm
Browse files Browse the repository at this point in the history
Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com>
  • Loading branch information
moul committed Jun 23, 2020
1 parent 8657548 commit a89fb2c
Show file tree
Hide file tree
Showing 30 changed files with 272 additions and 334 deletions.
178 changes: 89 additions & 89 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,35 @@ on:
pull_request:

jobs:
docker-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build the Docker image
run: docker build . --file Dockerfile
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.14
- name: Cache Go modules
uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Run GoReleaser (Dry Run)
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist --snapshot --skip-publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
#docker-build:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - name: Build the Docker image
# run: docker build . --file Dockerfile
#goreleaser:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@master
# - name: Set up Go
# uses: actions/setup-go@v2
# with:
# go-version: 1.14
# - name: Cache Go modules
# uses: actions/cache@v1
# with:
# path: ~/go/pkg/mod
# key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
# restore-keys: |
# ${{ runner.os }}-go-
# - name: Run GoReleaser (Dry Run)
# uses: goreleaser/goreleaser-action@v2
# with:
# version: latest
# args: release --rm-dist --snapshot --skip-publish
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
golangci-lint:
runs-on: ubuntu-latest
steps:
Expand All @@ -49,70 +49,70 @@ jobs:
args: --timeout=2m
only-new-issues: false
working-directory: .
tests-on-windows:
needs: golangci-lint # run after golangci-lint action to not produce duplicated errors
runs-on: windows-latest
strategy:
matrix:
golang:
#- 1.13
- 1.14
steps:
- uses: actions/checkout@v2
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.golang }}
- name: Run tests on Windows
run: make.exe unittest
continue-on-error: true
tests-on-mac:
needs: golangci-lint # run after golangci-lint action to not produce duplicated errors
runs-on: macos-latest
strategy:
matrix:
golang:
- 1.14
env:
OS: macos-latest
GOLANG: ${{ matrix.golang }}
steps:
- uses: actions/checkout@v2
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.golang }}
- uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ matrix.golang }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ matrix.golang }}-
- name: Run tests on Unix-like operating systems
run: make unittest
- name: Check go.mod
run: |
go mod tidy -v
git --no-pager diff go.mod go.sum
git --no-pager diff --quiet go.mod go.sum
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
#token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.txt
flags: unittests
env_vars: OS,GOLANG
name: codecov-umbrella
fail_ci_if_error: true
#tests-on-windows:
# needs: golangci-lint # run after golangci-lint action to not produce duplicated errors
# runs-on: windows-latest
# strategy:
# matrix:
# golang:
# #- 1.13
# - 1.14
# steps:
# - uses: actions/checkout@v2
# - name: Install Go
# uses: actions/setup-go@v2
# with:
# go-version: ${{ matrix.golang }}
# - name: Run tests on Windows
# run: make.exe unittest
# continue-on-error: true
#tests-on-mac:
# needs: golangci-lint # run after golangci-lint action to not produce duplicated errors
# runs-on: macos-latest
# strategy:
# matrix:
# golang:
# - 1.14
# env:
# OS: macos-latest
# GOLANG: ${{ matrix.golang }}
# steps:
# - uses: actions/checkout@v2
# - name: Install Go
# uses: actions/setup-go@v2
# with:
# go-version: ${{ matrix.golang }}
# - uses: actions/cache@v1
# with:
# path: ~/go/pkg/mod
# key: ${{ runner.os }}-go-${{ matrix.golang }}-${{ hashFiles('**/go.sum') }}
# restore-keys: |
# ${{ runner.os }}-go-${{ matrix.golang }}-
# - name: Run tests on Unix-like operating systems
# run: make unittest
# - name: Check go.mod
# run: |
# go mod tidy -v
# git --no-pager diff go.mod go.sum
# git --no-pager diff --quiet go.mod go.sum
# - name: Upload coverage to Codecov
# uses: codecov/codecov-action@v1
# with:
# #token: ${{ secrets.CODECOV_TOKEN }}
# file: ./coverage.txt
# flags: unittests
# env_vars: OS,GOLANG
# name: codecov-umbrella
# fail_ci_if_error: true
tests-on-linux:
needs: golangci-lint # run after golangci-lint action to not produce duplicated errors
#needs: golangci-lint # run after golangci-lint action to not produce duplicated errors
runs-on: ubuntu-latest
strategy:
matrix:
golang:
- 1.11
- 1.12
- 1.13
#- 1.11
#- 1.12
#- 1.13
- 1.14
env:
OS: ubuntu-latest
Expand All @@ -134,7 +134,7 @@ jobs:
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
#token: ${{ secrets.CODECOV_TOKEN }}
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.txt
flags: unittests
env_vars: OS,GOLANG
Expand Down
4 changes: 2 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ linters:
- dogsled
- dupl
- errcheck
- funlen
#- funlen
- gochecknoinits
#- gocognit
- goconst
Expand All @@ -39,7 +39,7 @@ linters:
- govet
- ineffassign
- interfacer
- maligned
#- maligned
- misspell
- nakedret
- prealloc
Expand Down
11 changes: 6 additions & 5 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ builds:
- amd64
- arm
- arm64
main: ./cmd/sgtm/main.go
ignore:
-
goos: darwin
Expand Down Expand Up @@ -51,20 +52,20 @@ archives:
wrap_in_directory: true
brews:
-
name: bounce
name: sgtm
# github:
# owner: moul
# name: homebrew-moul
commit_author:
name: moul-bot
email: "bot@moul.io"
homepage: https://github.com/moul/bounce
description: "bounce"
homepage: https://github.com/moul/sgtm
description: "sgtm"
nfpms:
-
file_name_template: '{{ .ProjectName }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
homepage: https://github.com/moul/bounce
description: "bounce"
homepage: https://github.com/moul/sgtm
description: "sgtm"
maintainer: "Manfred Touron <https://manfred.life>"
license: "Apache-2.0 OR MIT"
vendor: moul
Expand Down
8 changes: 4 additions & 4 deletions COPYRIGHT
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
Copyright 2020 Manfred Touron and other bounce Developers.
Copyright 2020 Manfred Touron and other sgtm Developers.

Intellectual Property Notice
----------------------------

bounce is licensed under the Apache License, Version 2.0
sgtm is licensed under the Apache License, Version 2.0
(see LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0) or
the MIT license (see LICENSE-MIT or http://opensource.org/licenses/MIT),
at your option.

Copyrights and patents in the bounces project are retained
Copyrights and patents in the sgtms project are retained
by contributors.
No copyright assignment is required to contribute to bounce.
No copyright assignment is required to contribute to sgtm.

SPDX-License-Identifier: (Apache-2.0 OR MIT)

Expand Down
16 changes: 8 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ FROM golang:1.14-alpine as builder
RUN apk add --no-cache git gcc musl-dev make
RUN go get -u github.com/gobuffalo/packr/v2/packr2
ENV GO111MODULE=on
WORKDIR /go/src/moul.io/bounce
WORKDIR /go/src/moul.io/sgtm
COPY go.* ./
RUN go mod download
COPY . ./
Expand All @@ -18,16 +18,16 @@ RUN make install
# minimalist runtime
FROM alpine:3.12
LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.name="bounce" \
org.label-schema.name="sgtm" \
org.label-schema.description="" \
org.label-schema.url="https://moul.io/bounce/" \
org.label-schema.url="https://moul.io/sgtm/" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url="https://github.com/moul/bounce" \
org.label-schema.vcs-url="https://github.com/moul/sgtm" \
org.label-schema.vendor="Manfred Touron" \
org.label-schema.version=$VERSION \
org.label-schema.schema-version="1.0" \
org.label-schema.cmd="docker run -i -t --rm moul/bounce" \
org.label-schema.help="docker exec -it $CONTAINER bounce --help"
COPY --from=builder /go/bin/bounce /bin/
ENTRYPOINT ["/bin/bounce"]
org.label-schema.cmd="docker run -i -t --rm moul/sgtm" \
org.label-schema.help="docker exec -it $CONTAINER sgtm --help"
COPY --from=builder /go/bin/sgtm /bin/
ENTRYPOINT ["/bin/sgtm"]
#CMD []
20 changes: 10 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
GOPKG ?= moul.io/bounce
DOCKER_IMAGE ?= moul/bounce
GOBINS ?= ./cmd/bounce
GOPKG ?= moul.io/sgtm
DOCKER_IMAGE ?= moul/sgtm
GOBINS ?= ./cmd/sgtm

PRE_INSTALL_STEPS += gen.sum
PRE_UNITTEST_STEPS += gen.sum
Expand All @@ -15,15 +15,15 @@ include rules.mk

.PHONY: run
run: install
bounce --dev-mode --enable-server --enable-discord run
sgtm --dev-mode --enable-server --enable-discord run

.PHONY: run-discord
run-discord: install
bounce --dev-mode --enable-discord run
sgtm --dev-mode --enable-discord run

.PHONY: run-server
run-server: install
bounce --dev-mode --enable-server run
sgtm --dev-mode --enable-server run

.PHONY: packr
packr:
Expand All @@ -32,11 +32,11 @@ packr:

.PHONY: deploy
deploy: docker.push
ssh zrwf.m.42.am make -C infra/projects/bounce.place re
ssh zrwf.m.42.am make -C infra/projects/sgtm.place re

.PHONY: prod-logs
prod-logs:
ssh zrwf.m.42.am make -C infra/projects/bounce.place logs
ssh zrwf.m.42.am make -C infra/projects/sgtm.place logs

.PHONY: docker.push
docker.push: tidy generate docker.build
Expand All @@ -53,8 +53,8 @@ gen.sum: $(GEN_DEPS)
GO111MODULE=on go mod vendor; \
docker run \
--user=`id -u` \
--volume="$(PWD):/go/src/moul.io/bounce" \
--workdir="/go/src/moul.io/bounce" \
--volume="$(PWD):/go/src/moul.io/sgtm" \
--workdir="/go/src/moul.io/sgtm" \
--entrypoint="sh" \
--rm \
moul/moul-bot-protoc:1 \
Expand Down

0 comments on commit a89fb2c

Please sign in to comment.