Use go modules
This commit is contained in:
parent
99862b6daa
commit
9dc1f401b7
20
.drone.yml
20
.drone.yml
@ -23,8 +23,6 @@ steps:
|
||||
- go get -v -d srs.epita.fr/fic-server/repochecker
|
||||
- go get -v -d srs.epita.fr/fic-server/qa
|
||||
- mkdir deploy
|
||||
environment:
|
||||
GO111MODULE: off
|
||||
|
||||
- name: vet
|
||||
image: golang:alpine
|
||||
@ -36,8 +34,6 @@ steps:
|
||||
- go vet -v srs.epita.fr/fic-server/dashboard
|
||||
- go vet -v srs.epita.fr/fic-server/repochecker
|
||||
- go vet -v srs.epita.fr/fic-server/qa
|
||||
environment:
|
||||
GO111MODULE: off
|
||||
|
||||
- name: build admin
|
||||
image: golang:alpine
|
||||
@ -46,7 +42,6 @@ steps:
|
||||
- tar chjf deploy/htdocs-admin.tar.bz2 htdocs-admin
|
||||
environment:
|
||||
CGO_ENABLED: 0
|
||||
GO111MODULE: off
|
||||
|
||||
- name: build backend
|
||||
image: golang:alpine
|
||||
@ -54,7 +49,6 @@ steps:
|
||||
- go build -v -o deploy/backend-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH} srs.epita.fr/fic-server/backend
|
||||
environment:
|
||||
CGO_ENABLED: 0
|
||||
GO111MODULE: off
|
||||
|
||||
- name: build frontend
|
||||
image: golang:alpine
|
||||
@ -63,7 +57,6 @@ steps:
|
||||
- tar chjf deploy/htdocs-frontend.tar.bz2 htdocs-frontend
|
||||
environment:
|
||||
CGO_ENABLED: 0
|
||||
GO111MODULE: off
|
||||
|
||||
- name: build dashboard
|
||||
image: golang:alpine
|
||||
@ -72,7 +65,6 @@ steps:
|
||||
- tar chjf deploy/htdocs-dashboard.tar.bz2 htdocs-dashboard
|
||||
environment:
|
||||
CGO_ENABLED: 0
|
||||
GO111MODULE: off
|
||||
|
||||
- name: build repochecker
|
||||
image: golang:alpine
|
||||
@ -81,7 +73,6 @@ steps:
|
||||
- grep "const version" repochecker/update.go | sed -r 's/^.*=\s*(\S.*)$/\1/' > deploy/repochecker.version
|
||||
environment:
|
||||
CGO_ENABLED: 0
|
||||
GO111MODULE: off
|
||||
|
||||
- name: build repochecker for macOS
|
||||
image: golang:alpine
|
||||
@ -91,7 +82,6 @@ steps:
|
||||
CGO_ENABLED: 0
|
||||
GOOS: darwin
|
||||
GOARCH: amd64
|
||||
GO111MODULE: off
|
||||
|
||||
- name: build qa
|
||||
image: golang:alpine
|
||||
@ -100,7 +90,6 @@ steps:
|
||||
- tar chjf deploy/htdocs-qa.tar.bz2 htdocs-qa
|
||||
environment:
|
||||
CGO_ENABLED: 0
|
||||
GO111MODULE: off
|
||||
|
||||
- name: deploy
|
||||
image: appleboy/drone-scp
|
||||
@ -214,8 +203,6 @@ steps:
|
||||
- go get -v -d srs.epita.fr/fic-server/backend
|
||||
- go get -v -d srs.epita.fr/fic-server/frontend
|
||||
- go get -v -d srs.epita.fr/fic-server/dashboard
|
||||
environment:
|
||||
GO111MODULE: off
|
||||
|
||||
- name: build admin
|
||||
image: golang:alpine
|
||||
@ -223,7 +210,6 @@ steps:
|
||||
- go build -v -o deploy/admin-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH} srs.epita.fr/fic-server/admin
|
||||
environment:
|
||||
CGO_ENABLED: 0
|
||||
GO111MODULE: off
|
||||
|
||||
- name: build backend
|
||||
image: golang:alpine
|
||||
@ -231,7 +217,6 @@ steps:
|
||||
- go build -v -o deploy/backend-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH} srs.epita.fr/fic-server/backend
|
||||
environment:
|
||||
CGO_ENABLED: 0
|
||||
GO111MODULE: off
|
||||
|
||||
- name: build frontend
|
||||
image: golang:alpine
|
||||
@ -239,7 +224,6 @@ steps:
|
||||
- go build -v -o deploy/frontend-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH} srs.epita.fr/fic-server/frontend
|
||||
environment:
|
||||
CGO_ENABLED: 0
|
||||
GO111MODULE: off
|
||||
|
||||
- name: build dashboard
|
||||
image: golang:alpine
|
||||
@ -247,7 +231,6 @@ steps:
|
||||
- go build -v -o deploy/dashboard-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH} srs.epita.fr/fic-server/dashboard
|
||||
environment:
|
||||
CGO_ENABLED: 0
|
||||
GO111MODULE: off
|
||||
|
||||
- name: build repochecker
|
||||
image: golang:alpine
|
||||
@ -255,7 +238,6 @@ steps:
|
||||
- go build -v -o deploy/repochecker-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH} srs.epita.fr/fic-server/repochecker
|
||||
environment:
|
||||
CGO_ENABLED: 0
|
||||
GO111MODULE: off
|
||||
|
||||
- name: build repochecker for macOS
|
||||
image: golang:alpine
|
||||
@ -266,7 +248,6 @@ steps:
|
||||
CGO_ENABLED: 0
|
||||
GOOS: darwin
|
||||
GOARCH: arm64
|
||||
GO111MODULE: off
|
||||
|
||||
- name: build qa
|
||||
image: golang:alpine
|
||||
@ -274,7 +255,6 @@ steps:
|
||||
- go build -v -o deploy/qa-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH} srs.epita.fr/fic-server/qa
|
||||
environment:
|
||||
CGO_ENABLED: 0
|
||||
GO111MODULE: off
|
||||
|
||||
- name: deploy
|
||||
image: appleboy/drone-scp
|
||||
|
@ -2,19 +2,15 @@ FROM golang:alpine as gobuild
|
||||
|
||||
RUN apk add --no-cache git
|
||||
|
||||
ENV GO111MODULE=off
|
||||
WORKDIR /go/src/srs.epita.fr/fic-server/
|
||||
|
||||
WORKDIR /go/src/srs.epita.fr/fic-server/admin
|
||||
ADD go.mod go.sum ./
|
||||
ADD settings settings/
|
||||
ADD libfic ./libfic/
|
||||
ADD admin ./admin/
|
||||
|
||||
ADD settings ../settings/
|
||||
ADD libfic ../libfic/
|
||||
ADD admin/api ./api/
|
||||
ADD admin/pki ./pki/
|
||||
ADD admin/sync ./sync/
|
||||
ADD admin/*.go ./
|
||||
|
||||
RUN go get -d -v
|
||||
RUN go build -v
|
||||
RUN go get -d -v ./admin
|
||||
RUN go build -v -o admin/admin ./admin
|
||||
|
||||
|
||||
FROM alpine
|
||||
|
@ -2,16 +2,15 @@ FROM golang:alpine as gobuild
|
||||
|
||||
RUN apk add --no-cache git
|
||||
|
||||
ENV GO111MODULE=off
|
||||
WORKDIR /go/src/srs.epita.fr/fic-server/
|
||||
|
||||
WORKDIR /go/src/srs.epita.fr/fic-server/backend
|
||||
ADD go.mod go.sum ./
|
||||
ADD settings settings/
|
||||
ADD libfic ./libfic/
|
||||
ADD backend ./backend/
|
||||
|
||||
ADD backend/*.go ./
|
||||
ADD libfic ../libfic/
|
||||
ADD settings ../settings/
|
||||
|
||||
RUN go get -d -v
|
||||
RUN go build -v
|
||||
RUN go get -d -v ./backend
|
||||
RUN go build -v -o backend/backend ./backend
|
||||
|
||||
|
||||
FROM alpine
|
||||
|
@ -2,17 +2,15 @@ FROM golang:alpine as gobuild
|
||||
|
||||
RUN apk add --no-cache git
|
||||
|
||||
ENV GO111MODULE=off
|
||||
WORKDIR /go/src/srs.epita.fr/fic-server/
|
||||
|
||||
WORKDIR /go/src/srs.epita.fr/fic-server/dashboard
|
||||
ADD go.mod go.sum ./
|
||||
ADD settings settings/
|
||||
ADD libfic ./libfic/
|
||||
ADD dashboard ./dashboard/
|
||||
|
||||
ADD dashboard/*.go ./
|
||||
ADD dashboard/api/*.go ./api/
|
||||
ADD libfic ../libfic/
|
||||
ADD settings ../settings/
|
||||
|
||||
RUN go get -d -v
|
||||
RUN go build -v
|
||||
RUN go get -d -v ./dashboard
|
||||
RUN go build -v -o dashboard/dashboard ./dashboard
|
||||
|
||||
|
||||
FROM alpine
|
||||
|
@ -2,16 +2,15 @@ FROM golang:alpine as gobuild
|
||||
|
||||
RUN apk add --no-cache git
|
||||
|
||||
ENV GO111MODULE=off
|
||||
WORKDIR /go/src/srs.epita.fr/fic-server/
|
||||
|
||||
WORKDIR /go/src/srs.epita.fr/fic-server/frontend
|
||||
ADD go.mod go.sum ./
|
||||
ADD settings settings/
|
||||
ADD libfic ./libfic/
|
||||
ADD frontend ./frontend/
|
||||
|
||||
ADD frontend/*.go ./
|
||||
ADD libfic ../libfic/
|
||||
ADD settings ../settings/
|
||||
|
||||
RUN go get -d -v
|
||||
RUN go build -v
|
||||
RUN go get -d -v ./frontend
|
||||
RUN go build -v -o ./frontend/frontend ./frontend
|
||||
|
||||
|
||||
FROM alpine
|
||||
|
@ -2,17 +2,15 @@ FROM golang:alpine as gobuild
|
||||
|
||||
RUN apk add --no-cache git
|
||||
|
||||
ENV GO111MODULE=off
|
||||
WORKDIR /go/src/srs.epita.fr/fic-server/
|
||||
|
||||
WORKDIR /go/src/srs.epita.fr/fic-server/qa
|
||||
ADD go.mod go.sum ./
|
||||
ADD settings settings/
|
||||
ADD libfic ./libfic/
|
||||
ADD qa ./qa/
|
||||
|
||||
ADD qa/*.go ./
|
||||
ADD qa/api/*.go ./api/
|
||||
ADD libfic ../libfic/
|
||||
ADD settings ../settings/
|
||||
|
||||
RUN go get -d -v
|
||||
RUN go build -v
|
||||
RUN go get -d -v ./qa
|
||||
RUN go build -v -o qa/qa ./qa
|
||||
|
||||
|
||||
FROM alpine
|
||||
|
@ -8,7 +8,7 @@ import (
|
||||
|
||||
"github.com/BurntSushi/toml"
|
||||
"github.com/julienschmidt/httprouter"
|
||||
"gopkg.in/russross/blackfriday.v2"
|
||||
"github.com/russross/blackfriday/v2"
|
||||
|
||||
"srs.epita.fr/fic-server/libfic"
|
||||
)
|
||||
|
@ -10,8 +10,8 @@ import (
|
||||
|
||||
"srs.epita.fr/fic-server/libfic"
|
||||
|
||||
"github.com/russross/blackfriday/v2"
|
||||
"golang.org/x/crypto/blake2b"
|
||||
"gopkg.in/russross/blackfriday.v2"
|
||||
)
|
||||
|
||||
func ProcessMarkdown(i Importer, input string, rootDir string) (output string, err error) {
|
||||
@ -52,7 +52,7 @@ func ProcessMarkdown(i Importer, input string, rootDir string) (output string, e
|
||||
} else {
|
||||
defer fdto.Close()
|
||||
writer := bufio.NewWriter(fdto)
|
||||
if err = getFile(i, rootDir + iPath, writer); err != nil {
|
||||
if err = getFile(i, rootDir+iPath, writer); err != nil {
|
||||
os.Remove(dPath)
|
||||
return
|
||||
}
|
||||
|
@ -12,8 +12,9 @@ import (
|
||||
"unicode"
|
||||
|
||||
"github.com/julienschmidt/httprouter"
|
||||
"github.com/russross/blackfriday/v2"
|
||||
"golang.org/x/image/draw"
|
||||
"gopkg.in/russross/blackfriday.v2"
|
||||
|
||||
"srs.epita.fr/fic-server/libfic"
|
||||
)
|
||||
|
||||
|
15
go.mod
Normal file
15
go.mod
Normal file
@ -0,0 +1,15 @@
|
||||
module srs.epita.fr/fic-server
|
||||
|
||||
go 1.9
|
||||
|
||||
require (
|
||||
github.com/BurntSushi/toml v0.3.1
|
||||
github.com/fsnotify/fsnotify v1.4.9 // indirect
|
||||
github.com/go-sql-driver/mysql v1.6.0
|
||||
github.com/julienschmidt/httprouter v1.3.0
|
||||
github.com/russross/blackfriday/v2 v2.1.0
|
||||
github.com/studio-b12/gowebdav v0.0.0-20210427212133-86f8378cf140
|
||||
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a
|
||||
golang.org/x/image v0.0.0-20210504121937-7319ad40d33e
|
||||
gopkg.in/fsnotify.v1 v1.4.7
|
||||
)
|
26
go.sum
Normal file
26
go.sum
Normal file
@ -0,0 +1,26 @@
|
||||
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
|
||||
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
|
||||
github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE=
|
||||
github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
|
||||
github.com/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U=
|
||||
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
|
||||
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
|
||||
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||
github.com/studio-b12/gowebdav v0.0.0-20210427212133-86f8378cf140 h1:JCSn/2k3AQ0aJGs5Yx2xv6qrW0CAULc1E+xtSxeeQ/E=
|
||||
github.com/studio-b12/gowebdav v0.0.0-20210427212133-86f8378cf140/go.mod h1:gCcfDlA1Y7GqOaeEKw5l9dOGx1VLdc/HuQSlQAaZ30s=
|
||||
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a h1:kr2P4QFmQr29mSLA43kwrOcgcReGTfbE9N577tCTuBc=
|
||||
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8=
|
||||
golang.org/x/image v0.0.0-20210504121937-7319ad40d33e h1:PzJMNfFQx+QO9hrC1GwZ4BoPGeNGhfeQEgcQFArEjPk=
|
||||
golang.org/x/image v0.0.0-20210504121937-7319ad40d33e/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68 h1:nxC68pudNYkKU6jWhgrqdreuFiOQWj1Fs7T3VrH4Pjw=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4=
|
||||
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
|
Loading…
Reference in New Issue
Block a user