7 Commits
Author SHA1 Message Date
gisle f4d324da9b fix drone.yml
continuous-integration/drone/push Build is passing
2020-07-17 18:27:03 +02:00
gisle fff73cfe44 add go 1.14 to drone.yml
continuous-integration/drone/push Build is passing
2020-07-17 18:20:23 +02:00
gisle 31885d76f0 fix drone.yml
continuous-integration/drone/push Build is passing
2020-07-17 18:19:11 +02:00
gisle fec21a0045 fix drone.yml 2020-07-17 18:14:19 +02:00
gisle d721112738 migrate irc dependency to github version. 2020-07-17 17:21:18 +02:00
gisle dd51f7fd59 Updated irc dependency 2019-03-17 22:35:16 +01:00
gisle 42e6ca8f26 package: Updated irc dependency to fix ((Remove :01 goofs!*)) parse bug. 2019-01-20 21:15:36 +01:00
11 changed files with 109 additions and 99 deletions
+75 -18
View File
@@ -1,21 +1,78 @@
workspace:
base: /go
path: src/git.aiterp.net/rpdata/logbot3
name: logbot3
pipeline:
docker-release:
image: plugins/docker
repo: vmaple/rpdata-logbot3
auto_tag: true
secrets: [ docker_username, docker_password ]
kind: pipeline
type: docker
steps:
- name: go-build-1.11
image: golang:1.11
commands:
- go mod download
- CGO_ENABLED=0 go build -ldflags "-w -s" .
when:
event: tag
ref: refs/tags/*
docker-release-latest:
image: plugins/docker
repo: vmaple/rpdata-logbot3
tags: latest
secrets: [ docker_username, docker_password ]
event:
exclude:
- tag
- name: go-build-1.12
image: golang:1.12
commands:
- go mod download
- CGO_ENABLED=0 go build -ldflags "-w -s" .
when:
event: tag
ref: refs/tags/*
event:
exclude:
- tag
- name: go-build-1.13
image: golang:1.13
commands:
- go mod download
- CGO_ENABLED=0 go build -ldflags "-w -s" .
when:
event:
exclude:
- tag
- name: go-build-1.14
image: golang:1.13
commands:
- go mod download
- CGO_ENABLED=0 go build -ldflags "-w -s" .
when:
event:
exclude:
- tag
- name: go-test
image: golang:1.14
commands:
- go test -v ./...
- name: docker-release-tag
image: plugins/docker
settings:
auto_tag: true
username:
from_secret: docker_username
password:
from_secret: docker_password
repo: r.vmaple.dev/rpdata/logbot3
registry: r.vmaple.dev
when:
event:
- tag
- name: docker-release-latest
image: plugins/docker
settings:
auto_tag: false
username:
from_secret: docker_username
password:
from_secret: docker_password
repo: r.vmaple.dev/rpdata/logbot3
registry: r.vmaple.dev
when:
event:
- tag
+3 -1
View File
@@ -3,4 +3,6 @@ debug
debug.exe
logbot3
logbot3.exe
vendor/
# Idea
/.idea
+5 -7
View File
@@ -3,27 +3,25 @@
FROM golang:1.11 AS build
# Load repository into docker
WORKDIR /go/src/git.aiterp.net/rpdata/logbot3/
WORKDIR /project
COPY . .
RUN rm -rf ./vendor
# Load and run dependencies
RUN go get -u github.com/golang/dep/cmd/dep
RUN dep ensure
RUN go get
# Build server and tools (CGO disabled to make them 100% static)
ENV CGO_ENABLED 0
RUN go build -a -installsuffix cgo -ldflags="-s -w" -o /binaries/logbot3 .
RUN go build -a -installsuffix cgo -ldflags="-s -w" -o logbot3 .
## 2. Distribute
# Use alpine linux
FROM alpine:3.8 as main-dist
FROM alpine:3.12 as main-dist
# Install certificates to enable HTTPS GET requests
RUN apk add --no-cache ca-certificates
# Copy build files into final container
COPY --from=build /binaries/* /usr/local/bin/
COPY --from=build /project/logbot3 /usr/local/bin/
# The server is the main entry point
CMD ["/usr/local/bin/logbot3"]
Generated
-26
View File
@@ -1,26 +0,0 @@
# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
branch = "master"
name = "git.aiterp.net/gisle/irc"
packages = [
".",
"ircutil",
"isupport",
"list"
]
revision = "c1e97eb9d2e383147662ddd649fcab1bdaf295b4"
[[projects]]
name = "github.com/dgrijalva/jwt-go"
packages = ["."]
revision = "06ea1031745cb8b3dab3f6a236daf2b0aa468b7e"
version = "v3.2.0"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "7ef4c9d0736b7eb8e596036446cae5d12a8d7485db1559cfa8ade7ba1bf74263"
solver-name = "gps-cdcl"
solver-version = 1
-38
View File
@@ -1,38 +0,0 @@
# Gopkg.toml example
#
# Refer to https://golang.github.io/dep/docs/Gopkg.toml.html
# for detailed Gopkg.toml documentation.
#
# required = ["github.com/user/thing/cmd/thing"]
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
#
# [[constraint]]
# name = "github.com/user/project"
# version = "1.0.0"
#
# [[constraint]]
# name = "github.com/user/project2"
# branch = "dev"
# source = "github.com/myfork/project2"
#
# [[override]]
# name = "github.com/x/y"
# version = "2.4.0"
#
# [prune]
# non-go = false
# go-tests = true
# unused-packages = true
[[constraint]]
branch = "master"
name = "git.aiterp.net/gisle/irc"
[[constraint]]
name = "github.com/dgrijalva/jwt-go"
version = "3.2.0"
[prune]
go-tests = true
unused-packages = true
+8
View File
@@ -0,0 +1,8 @@
module git.aiterp.net/rpdata/logbot3
go 1.13
require (
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/gissleh/irc v0.0.0-20200717144508-ec7511e0dfd4
)
+12
View File
@@ -0,0 +1,12 @@
git.aiterp.net/gisle/irc v0.0.0-20190317212656-36c2a5ea38d3 h1:2UYpXoDYcgeIGxRX+5K2e/CK0BNAQUZ6xU/9JjQYwDk=
git.aiterp.net/gisle/irc v0.0.0-20190317212656-36c2a5ea38d3/go.mod h1:7uklwlzI0XI2O8ttooTH0suUpUmQ8Pviplg36smc1Aw=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/gissleh/irc v0.0.0-20200717144508-ec7511e0dfd4 h1:2rT4geKF5Zb0TyJjqp8ylUXwfrwIvMESdERItJtmtDI=
github.com/gissleh/irc v0.0.0-20200717144508-ec7511e0dfd4/go.mod h1:dUQ3oIxO/lK/Ga5Dq72/1tH861WBDJFkkBtbnqg6ZXc=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+3 -1
View File
@@ -6,7 +6,7 @@ import (
"strings"
"time"
"git.aiterp.net/gisle/irc"
"github.com/gissleh/irc"
"git.aiterp.net/rpdata/logbot3/internal/models"
"git.aiterp.net/rpdata/logbot3/internal/models/channels"
)
@@ -34,6 +34,8 @@ func New(ctx context.Context, nick string, alternatives []string, user string, r
SkipSSLVerification: false,
})
client.AddHandler(handler)
bot := &Bot{
client: client,
channels: make(map[string]*Channel),
+1 -1
View File
@@ -6,7 +6,7 @@ import (
"strings"
"time"
"git.aiterp.net/gisle/irc"
"github.com/gissleh/irc"
"git.aiterp.net/rpdata/logbot3/internal/config"
"git.aiterp.net/rpdata/logbot3/internal/models/channels"
"git.aiterp.net/rpdata/logbot3/internal/models/logs"
+2 -6
View File
@@ -5,10 +5,9 @@ import (
"os"
"strings"
"git.aiterp.net/rpdata/logbot3/internal/util"
"git.aiterp.net/gisle/irc"
"github.com/gissleh/irc"
"git.aiterp.net/rpdata/logbot3/internal/config"
"git.aiterp.net/rpdata/logbot3/internal/util"
)
func handler(event *irc.Event, client *irc.Client) {
@@ -140,6 +139,3 @@ func handler(event *irc.Event, client *irc.Client) {
}
}
func init() {
irc.Handle(handler)
}
-1
View File
@@ -10,7 +10,6 @@ import (
"git.aiterp.net/rpdata/logbot3/internal/bot"
"git.aiterp.net/rpdata/logbot3/internal/config"
"git.aiterp.net/rpdata/logbot3/internal/models/users"
)