Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This service does not replace the old ways of adding information for the database, the binaries in the /bin folder they still continue to develop the same function as the new service, so that backward compatibility can be maintained. Signed-off-by: asakiz <asakizin@gmail.com>
- Loading branch information
1 parent
54a17cf
commit 06db347
Showing
23 changed files
with
1,134 additions
and
191 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,4 @@ api/api | |
ssh/ssh | ||
agent/agent | ||
agent/shellhub.key | ||
cli/cli |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# base stage | ||
FROM golang:1.13-alpine3.11 AS base | ||
|
||
RUN apk add --no-cache git ca-certificates | ||
|
||
WORKDIR $GOPATH/src/github.com/shellhub-io/shellhub | ||
|
||
COPY ./go.mod ./ | ||
COPY ./api/go.mod ./api/go.mod | ||
|
||
WORKDIR $GOPATH/src/github.com/shellhub-io/shellhub/cli | ||
|
||
COPY ./cli/go.mod ./cli/go.sum ./ | ||
|
||
RUN go mod download | ||
|
||
# builder stage | ||
FROM base AS builder | ||
|
||
COPY ./api $GOPATH/src/github.com/shellhub-io/shellhub/api | ||
COPY ./pkg $GOPATH/src/github.com/shellhub-io/shellhub/pkg | ||
COPY ./cli . | ||
|
||
WORKDIR $GOPATH/src/github.com/shellhub-io/shellhub | ||
|
||
RUN go mod download | ||
|
||
WORKDIR $GOPATH/src/github.com/shellhub-io/shellhub/cli | ||
|
||
RUN go build | ||
|
||
# development stage | ||
FROM base AS development | ||
|
||
RUN apk add --update openssl build-base docker-cli | ||
RUN go get github.com/markbates/refresh && \ | ||
go get github.com/golangci/golangci-lint/cmd/golangci-lint@v1.37.1 && \ | ||
go get github.com/vektra/mockery/v2/.../ | ||
|
||
WORKDIR $GOPATH/src/github.com/shellhub-io/shellhub | ||
|
||
RUN go mod download | ||
|
||
COPY ./cli/entrypoint-dev.sh /entrypoint.sh | ||
COPY ./.revive.toml / | ||
|
||
WORKDIR $GOPATH/src/github.com/shellhub-io/shellhub/cli | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] | ||
|
||
# production stage | ||
FROM alpine:3.11 AS production | ||
|
||
COPY --from=builder /go/src/github.com/shellhub-io/shellhub/cli/cli /cli | ||
|
||
ENTRYPOINT /cli |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh | ||
|
||
refresh run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/sh | ||
|
||
gomplate -f /etc/nginx/conf.d/shellhub.conf -o /etc/nginx/conf.d/shellhub.conf | ||
|
||
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
module github.com/shellhub-io/shellhub/cli | ||
|
||
go 1.14 | ||
|
||
require ( | ||
github.com/kelseyhightower/envconfig v1.4.0 | ||
github.com/satori/go.uuid v1.2.0 | ||
github.com/shellhub-io/shellhub v0.5.2 | ||
github.com/shellhub-io/shellhub/api v0.5.2 | ||
github.com/sirupsen/logrus v1.8.1 | ||
github.com/spf13/cobra v1.1.3 | ||
github.com/stretchr/testify v1.7.0 | ||
go.mongodb.org/mongo-driver v1.5.1 | ||
gopkg.in/go-playground/validator.v9 v9.31.0 | ||
) | ||
|
||
replace github.com/shellhub-io/shellhub => ../ | ||
|
||
replace github.com/shellhub-io/shellhub/api => ../api |
Oops, something went wrong.