-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
281 changed files
with
4,990 additions
and
72,668 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,17 @@ | ||
name: sqlc | ||
|
||
on: [push] | ||
|
||
jobs: | ||
testing: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout upstream repo | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
- uses: sqlc-dev/setup-sqlc@v4 | ||
with: | ||
sqlc-version: "1.21.0" | ||
- run: sqlc diff |
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 |
---|---|---|
@@ -1,18 +1,36 @@ | ||
name: Unit test | ||
name: test | ||
|
||
on: [push] | ||
|
||
jobs: | ||
testing: | ||
runs-on: ubuntu-latest | ||
services: | ||
postgres: | ||
image: postgres:14 | ||
env: | ||
POSTGRES_USER: pguser | ||
POSTGRES_PASSWORD: pgpass | ||
POSTGRES_DB: testdb | ||
ports: | ||
- 5432:5432 | ||
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | ||
|
||
steps: | ||
- name: Checkout upstream repo | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
- uses: actions/setup-go@v2 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: "1.16" | ||
go-version-file: "go.mod" | ||
- run: | | ||
curl -Lsf -O https://github.com/k0kubun/sqldef/releases/download/v0.16.5/psqldef_linux_amd64.tar.gz | ||
tar xzf psqldef_linux_amd64.tar.gz | ||
./psqldef -U pguser -f ./database/schema.sql testdb | ||
env: | ||
PGPASSWORD: pgpass | ||
- run: go test --tags github ./... | ||
env: | ||
TEST_DB_DSN: "user=pguser password=pgpass dbname=testdb sslmode=disable" | ||
- run: go vet --tags github ./... |
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 |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
node_modules | ||
assets/out | ||
assets/.next | ||
/*.json | ||
|
||
tmp | ||
|
||
|
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,20 +1,15 @@ | ||
FROM node:16.10.0-buster AS build-node | ||
ADD . /app | ||
WORKDIR /app/assets | ||
RUN npm i | ||
RUN npm run export | ||
# | ||
FROM golang:1.16 AS build-go | ||
COPY --from=build-node /app /app | ||
FROM golang:1.21 AS build-go | ||
COPY . /app | ||
WORKDIR /app | ||
ENV CGO_ENABLED=0 | ||
RUN go build . | ||
|
||
#gcr.io/distroless/static is not enough because of github.com/mattn/go-sqlite3 | ||
FROM gcr.io/distroless/base | ||
COPY --from=build-go /app/octovy /octovy | ||
COPY --from=aquasec/trivy:0.21.2 /usr/local/bin/trivy /trivy | ||
COPY --from=build-go /app/database /database | ||
COPY --from=aquasec/trivy:0.45.1 /usr/local/bin/trivy /trivy | ||
WORKDIR / | ||
ENV OCTOVY_ADDR="0.0.0.0" | ||
ENV OCTOVY_ADDR="0.0.0.0:8000" | ||
ENV OCTOVY_TRIVY_PATH=/trivy | ||
EXPOSE 9080 | ||
EXPOSE 8000 | ||
ENTRYPOINT ["/octovy"] |
Oops, something went wrong.