-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #88 from GSA-TTS/circleci-project-setup
Circleci project setup
- Loading branch information
Showing
84 changed files
with
1,692 additions
and
1,046 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
process.yml |
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,118 @@ | ||
# Use the latest 2.1 version of CircleCI pipeline process engine. | ||
# See: https://circleci.com/docs/configuration-reference | ||
version: 2.1 | ||
|
||
<<<<<<< HEAD | ||
commands: | ||
apt-packages: | ||
description: Performs a common install in each job | ||
steps: | ||
- run: | ||
name: "common apt packages" | ||
command: | | ||
sudo apt-get update | ||
sudo apt-get -y install build-essential \ | ||
curl \ | ||
libpoppler-dev \ | ||
libpoppler-glib-dev \ | ||
poppler-utils \ | ||
software-properties-common \ | ||
tree \ | ||
wget | ||
install-linter: | ||
description: Installs the golangci linter | ||
parameters: | ||
linter-version: | ||
default: 1.63.4 | ||
type: string | ||
steps: | ||
- run: | ||
name: "install golangci-lint" | ||
command: | | ||
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v<< parameters.linter-version >> | ||
install-go-utilities: | ||
description: Installs the golang utilities | ||
steps: | ||
- run: | ||
name: "install jsonnet" | ||
command: | | ||
go install golang.org/x/tools/cmd/goimports@latest | ||
go install golang.org/x/tools/cmd/stringer@latest | ||
go install github.com/google/go-jsonnet/cmd/jsonnet@latest | ||
go install github.com/google/go-jsonnet/cmd/jsonnet-lint@latest | ||
go install github.com/google/go-jsonnet/cmd/jsonnetfmt@latest | ||
- run: | ||
name: "install sqlc" | ||
command: | | ||
wget https://downloads.sqlc.dev/sqlc_1.27.0_linux_amd64.tar.gz | ||
tar xvzf sqlc_1.27.0_linux_amd64.tar.gz | ||
chmod 755 sqlc | ||
sudo mv sqlc /bin/sqlc | ||
prep-the-build: | ||
description: Generates files required for the build | ||
steps: | ||
- run: | ||
name: "generate sqlc models" | ||
command: make generate | ||
jobs: | ||
lint: | ||
docker: | ||
- image: cimg/go:1.23.3 | ||
steps: | ||
- checkout | ||
- apt-packages | ||
- install-go-utilities | ||
- install-linter | ||
- prep-the-build | ||
- run: | ||
name: "find the lint" | ||
command: golangci-lint run -v | ||
no_output_timeout: 5m | ||
|
||
setup-and-build: | ||
docker: | ||
- image: cimg/go:1.23.3 | ||
steps: | ||
# Checkout the code as the first step. | ||
- checkout | ||
- apt-packages | ||
- install-go-utilities | ||
- run: make build | ||
|
||
======= | ||
# Define a job to be invoked later in a workflow. | ||
# See: https://circleci.com/docs/jobs-steps/#jobs-overview & https://circleci.com/docs/configuration-reference/#jobs | ||
jobs: | ||
say-hello: | ||
# Specify the execution environment. You can specify an image from Docker Hub or use one of our convenience images from CircleCI's Developer Hub. | ||
# See: https://circleci.com/docs/executor-intro/ & https://circleci.com/docs/configuration-reference/#executor-job | ||
docker: | ||
# Specify the version you desire here | ||
# See: https://circleci.com/developer/images/image/cimg/base | ||
- image: cimg/base:current | ||
|
||
# Add steps to the job | ||
# See: https://circleci.com/docs/jobs-steps/#steps-overview & https://circleci.com/docs/configuration-reference/#steps | ||
steps: | ||
# Checkout the code as the first step. | ||
- checkout | ||
- run: | ||
name: "Say hello" | ||
command: "echo Hello, World!" | ||
>>>>>>> db97d998cf4d8b6c042529d8c655c3ea8a750117 | ||
|
||
# Orchestrate jobs using workflows | ||
# See: https://circleci.com/docs/workflows/ & https://circleci.com/docs/configuration-reference/#workflows | ||
workflows: | ||
<<<<<<< HEAD | ||
build-and-deploy: | ||
jobs: | ||
- lint | ||
- setup-and-build: | ||
requires: [ lint ] | ||
======= | ||
say-hello-workflow: # This is the name of the workflow, feel free to change it to better match your workflow. | ||
# Inside the workflow, you define the jobs you want to run. | ||
jobs: | ||
- say-hello | ||
>>>>>>> db97d998cf4d8b6c042529d8c655c3ea8a750117 |
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,80 @@ | ||
linters: | ||
enable-all: true | ||
# Some things here we may want to leave disabled. | ||
# Some we may want to enable, and then pay down as debt. | ||
# Anything included here represented a more invasive set of changes to | ||
# satisfy the linter than was desired during initial cleanup. | ||
disable: | ||
- canonicalheader | ||
- contextcheck | ||
- depguard | ||
- err113 | ||
- errchkjson | ||
- exhaustruct | ||
- exportloopref | ||
- forbidigo | ||
- gochecknoglobals | ||
- gocritic | ||
- intrange | ||
- ireturn | ||
- musttag | ||
- nilerr | ||
- noctx | ||
- paralleltest | ||
- perfsprint | ||
- tagalign | ||
- tagliatelle | ||
- tenv | ||
- testifylint | ||
- unconvert | ||
- unparam | ||
- varnamelen | ||
- wastedassign | ||
depguard: | ||
# Rules to apply. | ||
# | ||
# Variables: | ||
# - File Variables | ||
# you can still use and exclamation mark ! in front of a variable to say not to use it. | ||
# Example !$test will match any file that is not a go test file. | ||
# | ||
# `$all` - matches all go files | ||
# `$test` - matches all go test files | ||
# | ||
# - Package Variables | ||
# | ||
# `$gostd` - matches all of go's standard library (Pulled from `GOROOT`) | ||
# | ||
# Default: Only allow $gostd in all files. | ||
rules: | ||
main: | ||
list-mode: lax | ||
# List of file globs that will match this list of settings to compare against. | ||
# Default: $all | ||
files: | ||
- $all | ||
# List of allowed packages. | ||
allow: | ||
- $gostd | ||
- github.com/GSA-TTS/jemison/config | ||
# Packages that are not allowed where the value is a suggestion. | ||
deny: | ||
- pkg: "github.com/sirupsen/logrus" | ||
desc: not allowed | ||
- pkg: "github.com/pkg/errors" | ||
desc: Should be replaced by standard lib errors package | ||
|
||
run: | ||
timeout: 5m | ||
issues-exit-code: 2 | ||
concurrency: 4 | ||
allow-parallel-runners: true | ||
|
||
output: | ||
formats: | ||
- format: json | ||
path: stderr | ||
- format: checkstyle | ||
path: report.xml | ||
- format: colored-line-number | ||
show-stats: true |
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 |
---|---|---|
|
@@ -2,4 +2,5 @@ FROM jemison/dev | |
|
||
WORKDIR /app | ||
|
||
ENTRYPOINT ["make", "build"] | ||
ENTRYPOINT ["make"] | ||
CMD ["build"] |
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 |
---|---|---|
@@ -1,28 +1,9 @@ | ||
package main | ||
|
||
import ( | ||
"os" | ||
|
||
common "github.com/GSA-TTS/jemison/internal/common" | ||
"github.com/GSA-TTS/jemison/internal/queueing" | ||
"github.com/jackc/pgx/v5" | ||
"github.com/riverqueue/river" | ||
"github.com/riverqueue/river/riverdriver/riverpgxv5" | ||
"go.uber.org/zap" | ||
) | ||
|
||
// GLOBAL TO THE APP | ||
var insertClient *river.Client[pgx.Tx] | ||
|
||
func InitializeQueues() { | ||
queueing.InitializeRiverQueues() | ||
|
||
// Insert-only client | ||
_, pool, _ := common.CommonQueueInit() | ||
ic, err := river.NewClient(riverpgxv5.New(pool), &river.Config{}) | ||
if err != nil { | ||
zap.L().Error("could not establish insert-only client") | ||
os.Exit(1) | ||
} | ||
insertClient = ic | ||
} |
Oops, something went wrong.