mirror of
https://git.klmp200.net/ALFRED/ALFRED.git
synced 2025-01-18 10:36:44 +01:00
Migrate to gomodules
This commit is contained in:
parent
7b26cc3640
commit
35eab30bcd
48
.drone.yml
48
.drone.yml
@ -1,32 +1,38 @@
|
||||
pipeline:
|
||||
build:
|
||||
image: golang:1.11
|
||||
group: build
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: default
|
||||
|
||||
steps:
|
||||
- name: build
|
||||
image: golang:1.14
|
||||
commands:
|
||||
- go get -v -d ./...
|
||||
- go build .
|
||||
test:
|
||||
image: golang:1.11
|
||||
group: test
|
||||
secrets: [ test_api_token ]
|
||||
environment: [ test_api_token ]
|
||||
commands:
|
||||
- go get -v -d ./...
|
||||
- go test ./...
|
||||
publish:
|
||||
- go build
|
||||
|
||||
- name: publish
|
||||
image: plugins/docker
|
||||
settings:
|
||||
repo: klmp200/alfred
|
||||
secrets: [ docker_username, docker_password ]
|
||||
username:
|
||||
from_secret: docker_username
|
||||
password:
|
||||
from_secret: docker_password
|
||||
when:
|
||||
branch: master
|
||||
event: push
|
||||
deploy:
|
||||
|
||||
- name: deploy
|
||||
image: appleboy/drone-ssh
|
||||
environment:
|
||||
SSH_PASSWORD:
|
||||
from_secret: ssh_password
|
||||
settings:
|
||||
host:
|
||||
- ollivander.diagon-alley
|
||||
username: dronedeploy
|
||||
secrets: [ ssh_password ]
|
||||
envs: [ ssh_password ]
|
||||
from_secret: ssh_host
|
||||
username:
|
||||
from_secret: ssh_username
|
||||
password:
|
||||
from_secret: ssh_password
|
||||
envs: [ SSH_PASSWORD ]
|
||||
script:
|
||||
- echo $SSH_PASSWORD | sudo -S systemctl restart alfred-bot
|
||||
when:
|
||||
|
25
Dockerfile
25
Dockerfile
@ -1,27 +1,16 @@
|
||||
FROM golang:1.11 AS builder
|
||||
|
||||
# Download and install the latest release of dep
|
||||
# ADD https://github.com/golang/dep/releases/download/v0.4.1/dep-linux-amd64 /usr/bin/dep
|
||||
# RUN chmod +x /usr/bin/dep
|
||||
|
||||
WORKDIR /go/src/git.klmp200.net/ALFRED/ALFRED
|
||||
|
||||
FROM golang:1.14 AS builder
|
||||
RUN mkdir /build
|
||||
WORKDIR /build
|
||||
# Copy the code from the host and compile it
|
||||
COPY . .
|
||||
|
||||
RUN go get -v -d ./...
|
||||
|
||||
RUN mkdir res
|
||||
COPY settings.json res
|
||||
COPY quotes.json res
|
||||
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix nocgo -o /app .
|
||||
|
||||
# We use Alpine for it's ca-certificates needed by http lib
|
||||
FROM alpine:3.4
|
||||
RUN apk add --no-cache ca-certificates apache2-utils
|
||||
FROM scratch
|
||||
# We need ca-certifactes for http calls
|
||||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
||||
COPY --from=builder /app ./
|
||||
COPY --from=builder /go/src/git.klmp200.net/ALFRED/ALFRED/res ./
|
||||
|
||||
|
||||
COPY --from=builder /build/res ./
|
||||
ENTRYPOINT ["./app"]
|
||||
|
11
go.mod
Normal file
11
go.mod
Normal file
@ -0,0 +1,11 @@
|
||||
module git.klmp200.net/klmp200/abitbol
|
||||
|
||||
go 1.15
|
||||
|
||||
require (
|
||||
git.klmp200.net/ALFRED/ALFRED v0.0.0-20201109182945-7b26cc3640f2
|
||||
github.com/PuerkitoBio/goquery v1.6.0 // indirect
|
||||
github.com/dghubble/go-twitter v0.0.0-20201011215211-4b180d0cc78d // indirect
|
||||
github.com/dghubble/oauth1 v0.6.0 // indirect
|
||||
gopkg.in/tucnak/telebot.v2 v2.3.5
|
||||
)
|
33
go.sum
Normal file
33
go.sum
Normal file
@ -0,0 +1,33 @@
|
||||
git.klmp200.net/ALFRED/ALFRED v0.0.0-20201109182945-7b26cc3640f2 h1:aFcX//JwBBVDBRxycyzBC+mJ+cuTQKrM6wIeVmdEHLM=
|
||||
git.klmp200.net/ALFRED/ALFRED v0.0.0-20201109182945-7b26cc3640f2/go.mod h1:j6PTiwlXECBIqwIm/4zbrXrwfXoWYD+EY7BPZWYTKrs=
|
||||
github.com/PuerkitoBio/goquery v1.6.0 h1:j7taAbelrdcsOlGeMenZxc2AWXD5fieT1/znArdnx94=
|
||||
github.com/PuerkitoBio/goquery v1.6.0/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBKeU+7zCJoLcc=
|
||||
github.com/andybalholm/cascadia v1.1.0 h1:BuuO6sSfQNFRu1LppgbD25Hr2vLYW25JvxHs5zzsLTo=
|
||||
github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y=
|
||||
github.com/cenkalti/backoff v2.1.1+incompatible h1:tKJnvO2kl0zmb/jA5UKAt4VoEVw1qxKWjE/Bpp46npY=
|
||||
github.com/cenkalti/backoff v2.1.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/dghubble/go-twitter v0.0.0-20201011215211-4b180d0cc78d h1:sBKr0A8iQ1qAOozedZ8Aox+Jpv+TeP1Qv7dcQyW8V+M=
|
||||
github.com/dghubble/go-twitter v0.0.0-20201011215211-4b180d0cc78d/go.mod h1:xfg4uS5LEzOj8PgZV7SQYRHbG7jPUnelEiaAVJxmhJE=
|
||||
github.com/dghubble/oauth1 v0.6.0 h1:m1yC01Ohc/eF38jwZ8JUjL1a+XHHXtGQgK+MxQbmSx0=
|
||||
github.com/dghubble/oauth1 v0.6.0/go.mod h1:8pFdfPkv/jr8mkChVbNVuJ0suiHe278BtWI4Tk1ujxk=
|
||||
github.com/dghubble/sling v1.3.0 h1:pZHjCJq4zJvc6qVQ5wN1jo5oNZlNE0+8T/h0XeXBUKU=
|
||||
github.com/dghubble/sling v1.3.0/go.mod h1:XXShWaBWKzNLhu2OxikSNFrlsvowtz4kyRuXUG7oQKY=
|
||||
github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk=
|
||||
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
|
||||
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
|
||||
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
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.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20200202094626-16171245cfb2 h1:CCH4IOTTfewWjGOlSp+zGcjutRKlBEZQ6wTn8ozI/nI=
|
||||
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/tucnak/telebot.v2 v2.3.5 h1:TdMJTlG8kvepsvZdy/gPeYEBdwKdwFFjH1AQTua9BOU=
|
||||
gopkg.in/tucnak/telebot.v2 v2.3.5/go.mod h1:BgaIIx50PSRS9pG59JH+geT82cfvoJU/IaI5TJdN3v8=
|
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
Loading…
Reference in New Issue
Block a user