gitness/README.md

113 lines
2.4 KiB
Markdown
Raw Normal View History

2022-09-13 06:39:22 +08:00
[![CI pipeline](https://github.com/harness/gitness/actions/workflows/ci.yml/badge.svg)](https://github.com/harness/gitness/actions/workflows/ci.yml)
2022-09-13 07:56:42 +08:00
[![CodeQL](https://github.com/harness/gitness/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/harness/gitness/actions/workflows/codeql-analysis.yml)
[![](https://img.shields.io/badge/go-%3E%3D%201.17-green)](#)
2022-08-10 03:37:37 +08:00
# Pre-Requisites
2022-10-04 03:17:43 +08:00
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](https://go.dev/doc/gopath_code#GOPATH) is added to your PATH.
2022-08-10 03:37:37 +08:00
```bash
$ make all
2022-08-10 03:37:37 +08:00
```
# Build
Build the user interface:
```bash
2022-08-10 03:37:37 +08:00
$ pushd web
$ yarn install
$ yarn run build
2022-08-10 03:37:37 +08:00
$ popd
```
Build the server and command line tools:
```bash
2022-08-10 03:37:37 +08:00
$ go generate ./...
2022-08-30 01:12:07 +08:00
$ go build -o release/gitness
2022-08-10 03:37:37 +08:00
```
# Test
Execute the unit tests:
```bash
$ make test
2022-08-10 03:37:37 +08:00
```
# 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`
```bash
2022-08-30 01:12:07 +08:00
$ release/gitness server
2022-08-10 03:37:37 +08:00
```
# 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.
# Command Line
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:
```bash
2022-08-30 01:12:07 +08:00
$ release/gitness register
2022-08-10 03:37:37 +08:00
```
Login to the application:
```bash
2022-08-30 01:12:07 +08:00
$ release/gitness login
2022-08-10 03:37:37 +08:00
```
Logout from the application:
```bash
2022-08-30 01:12:07 +08:00
$ release/gitness logout
2022-08-10 03:37:37 +08:00
```
View your account details:
```bash
2022-08-30 01:12:07 +08:00
$ release/gitness account
2022-08-10 03:37:37 +08:00
```
Generate a personal access token:
2022-08-10 03:37:37 +08:00
```bash
2022-08-30 01:12:07 +08:00
$ release/gitness token
2022-08-10 03:37:37 +08:00
```
Create a pipeline:
```bash
2022-08-30 01:12:07 +08:00
$ release/gitness pipeline create <name>
2022-08-10 03:37:37 +08:00
```
List pipelines:
```bash
2022-08-30 01:12:07 +08:00
$ release/gitness pipeline ls
2022-08-10 03:37:37 +08:00
```
Debug and output http responses from the server:
```bash
2022-08-30 01:12:07 +08:00
$ DEBUG=true release/gitness pipeline ls
2022-08-10 03:37:37 +08:00
```
View all commands:
```bash
2022-08-30 01:12:07 +08:00
$ release/gitness --help
2022-08-10 03:37:37 +08:00
```