Drone is a Container-Native, Continuous Delivery Platform
Go to file
Johannes Batzill 94dc365d3e move commitcheck report permission under repo 2023-09-01 00:48:39 -07:00
.githooks [MAINT] initial config for ci linter (#17) 2022-09-19 18:13:18 +02:00
.github/workflows use useHistory inside MarkdownViewer (#358) 2023-02-27 12:04:49 -08:00
.vscode initial work - diff stats, (files changed) 2023-08-02 14:34:39 +02:00
cache introduce last commit cache mode env var 2023-08-15 13:07:22 +02:00
cli [CODE-717]: redis sentinel mode (#292) 2023-08-11 16:28:53 +00:00
client fix: Update the code to use registerInput along with createInput for user registration and subsequent creation 2023-08-11 00:52:05 +05:30
cmd/gitness Add plugins list API (#349) 2023-08-28 19:02:46 +00:00
contrib Rename project to 'gitness' 2022-08-29 10:12:07 -07:00
encrypt fix some formatting 2023-08-22 15:28:30 +01:00
events fixed linter issues 2023-05-17 21:56:23 +02:00
githook [GIHA] Introduce `githa` custom githook binary (#186) 2023-07-12 15:49:06 +00:00
gitrpc errors are properly returned from diff-stats and merge-check api 2023-08-17 17:00:39 +02:00
http [GITHA] Move `server.Server` out of `internal` (#145) 2023-06-19 15:36:20 +00:00
internal move commitcheck report permission under repo 2023-09-01 00:48:39 -07:00
livelog fix lint/format 2023-08-17 12:15:45 +01:00
lock retry improved 2023-08-28 11:22:17 +02:00
mocks Run make format 2023-08-22 15:08:46 +01:00
profiler change order of TrimSpace and ToLower for minor perf improvement 2023-06-26 11:42:48 -07:00
pubsub [scm-58] Add `merge-check` and Integrate with PR (#318) 2023-02-11 23:22:12 -08:00
resources [MAINT] added repos endpoints to swagger (#33) 2022-10-18 00:10:36 +02:00
scripts [MAINT] Isolate harness app into harness package (#133) 2023-06-15 13:35:12 +00:00
store [GITHA] Expose RepoHash/Dirty Fields via Store (#318) 2023-08-15 18:56:37 +00:00
stream fixed linter issues 2023-05-17 21:56:23 +02:00
types move commitcheck report permission under repo 2023-09-01 00:48:39 -07:00
version [MISC] Hide `pre`/`dev` vars from `version` package (#299) 2023-02-02 17:52:37 -08:00
web fix: [code-788]: fix delete repo call 2023-08-28 15:57:40 -06:00
.dockerignore [GITHA] Add `githaserver` executable (#331) 2023-08-17 17:51:38 +00:00
.gitignore [GITHA] Add `githaserver` executable (#331) 2023-08-17 17:51:38 +00:00
.golangci.yml add replication helper methods 2023-08-17 16:57:40 -07:00
.local.env [CODE-617]: Update variable name and merge with main 2023-08-01 18:53:01 +05:30
.npmrc minor improvement 2023-06-08 18:11:53 +02:00
CHANGELOG.md Initial commit 2022-08-09 12:37:37 -07:00
Dockerfile Reduce Image Sizes & Uniform Dockerfiles (#152) 2023-06-20 15:51:29 +00:00
LICENSE.md Initial commit 2022-08-09 12:37:37 -07:00
Makefile initial docker file 2023-08-28 15:37:54 +02:00
README.md Update README.md (#309) 2023-08-13 23:51:22 +00:00
Taskfile.yml Rename project to 'gitness' 2022-08-29 10:12:07 -07:00
go.mod move commitcheck report permission under repo 2023-09-01 00:48:39 -07:00
go.sum move commitcheck report permission under repo 2023-09-01 00:48:39 -07:00
wait-for-gitness.sh [MAINT] initial work on local dev env (#13) 2022-09-12 19:09:04 +02:00
yarn.lock Initial commit 2022-08-09 12:37:37 -07:00

README.md

Pre-Requisites

Install the latest stable version of Node and Go version 1.19 or higher, and then install the below Go programs. Ensure the GOPATH bin directory is added to your PATH.

Install protobuf

  • Check if you've already installed protobuf protoc --version
  • If your version is different than v3.21.11, run brew unlink protobuf
  • Get v3.21.11 curl -s https://raw.githubusercontent.com/Homebrew/homebrew-core/9de8de7a533609ebfded833480c1f7c05a3448cb/Formula/protobuf.rb > /tmp/protobuf.rb
  • Install it brew install /tmp/protobuf.rb
  • Check out your version protoc --version

Install protoc-gen-go and protoc-gen-go-rpc:

  • Install protoc-gen-go v1.28.1 go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28.1 (Note that this will install a binary in $GOBIN so make sure $GOBIN is in your $PATH)

  • Install protoc-gen-go-grpc v1.2.0 go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2.0

$ make all

Setup github access token required for UI dependencies:

$ yarn setup-github-registry

Build

Build the user interface:

$ pushd web
$ yarn install
$ yarn run build
$ popd

Build the server and command line tools:

# STANDALONE
$ make build

Test

Execute the unit tests:

$ make test

Run

This project supports all operating systems and architectures supported by Go. This means you can build and run the system on your machine; docker containers are not required for local development and testing.

Start the server at localhost:3000

# STANDALONE
./gitness server .local.env

User Interface

This project includes a simple user interface for interacting with the system. When you run the application, you can access the user interface by navigating to http://localhost:3000 in your browser.

Swagger

This project includes a swagger specification. When you run the application, you can access the swagger specification by navigating to http://localhost:3000/swagger in your browser (for raw yaml see http://localhost:3000/openapi.yaml).

Auto-Generate Gitness API Client used by UI using Swagger

Please make sure to update the autogenerated client code used by the UI when adding new rest APIs.

To regenerate the code, please execute the following steps:

  • Run local gitness instance with latest changes
  • Get latest OpenAPI specs from http://localhost:3000/openapi.yaml and store it in web/src/services/code/swagger.yaml

Simply copy the whole content of the web response and store it in the swagger.yaml file

  • Regenerate client code by running yarn services in the web directory

The latest API changes should now be reflected in web/src/services/code/index.tsx

CLI

This project includes simple command line tools for interacting with the system. Please remember that you must start the server before you can execute commands.

Register a new user:

$ ./gitness register

NOTE: A user admin (pw: changeit) gets created by default.

Login to the application:

$ ./gitness login

Logout from the application:

$ ./gitness logout

View your account details:

$ ./gitness user self

Generate a personal access token:

$ ./gitness user pat $UID $LIFETIME_IN_S

Debug and output http responses from the server:

$ DEBUG=true ./gitness user self

View all commands:

$ ./gitness --help

REST API

Please refer to the swagger for the specification of our rest API.

For testing, it's simplest to execute operations as the default user admin using a PAT:

# LOGIN (user: admin, pw: changeit)
$ ./gitness login

# GENERATE PAT (1 YEAR VALIDITY)
$ ./gitness user pat mypat 2592000

The command outputs a valid PAT that has been granted full access as the user. The token can then be send as part of the Authorization header with Postman or curl:

$ curl http://localhost:3000/api/v1/user \
-H "Authorization: Bearer $TOKEN"