Total Pageviews

Friday, 8 December 2023

Gitness

 Gitness: Open-Source Code Hosting & CI/CD Pipeline Engine

Unlock superior Git workflows with Gitness. Experience seamless code reviews, robust CI/CD solutions, and up to 4x faster pipeline execution。

Gitness 是一个开源开发者平台,具有源代码控制管理、持续集成和持续交付功能;它是最新出现的 GitHub 开源替代品,您可以用于自己架设服务,托管代码。Gitness 具有如下功能特征:
熟悉的 Git 体验。包含基本功能

具有分支、合并、代码审查、通知和警报、Web 钩子、浏览代码等功能,适合各种规模的工程团队的完整解决方案。
快速交付代码,使一切自动化

Gitness 提供了一个完全集成的 CI/CD 引擎,该引擎功能强大且学习曲线轻松。只需单击一下, Gitness 就可以自动从 GitHub、GitLab、Bitbucket、Circle 等迁移代码存储库和管道。
您的代码 您的语言 您的平台

集强大的代码托管、通过代码审查无缝协作以及适用于任何语言的灵活管道的强大功能于一身。所有这些都具有开发人员充满信心地编写和交付代码所需的安全和治理策略。为任何语言或平台构建管道。适用于 Linux、Windows 和 Mac。
管道执行速度提高高达 4 倍

通过智能测试选择和缓存,将管道执行减少高达 90%。由先进的仪器和调用图分析提供支持。

Gitness 的目标是最终在管道功能方面与 Drone 完全同等,允许用户无缝地从 Drone 迁移到 Gitness。您可以使用单个 Docker 命令进行安装,30 秒内设置 Gitness。重量轻,足以在 4 美元的 Digital Ocean Droplet 上运行。如果您对该项目感兴趣,不妨移步 Gitness 在 Github 开源仓库:https://github.com/harness/gitness (截止 2023 年 10 月 18 日,已收获 29.9K+ Star),从而了解更多。

-----------------------

Gitness is an Open Source developer platform with Source Control management, Continuous Integration and Continuous Delivery.

gitness.com

Gitness is an open source development platform packed with the power of code hosting and automated DevOps pipelines.

Overview

Gitness is an open source development platform packed with the power of code hosting and automated continuous integration pipelines.

Running Gitness locally

The latest publicly released docker image can be found on harness/gitness.

To install Gitness yourself, simply run the command below. Once the container is up, you can visit http://localhost:3000 in your browser.

docker run -d \
  -p 3000:3000 \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v /tmp/gitness:/data \
  --name gitness \
  --restart always \
  harness/gitness

The Gitness image uses a volume to store the database and repositories. It is highly recommended to use a bind mount or named volume as otherwise all data will be lost once the container is stopped.

See docs.gitness.com to learn how to get the most out of Gitness.

Where is Drone?

Gitness represents a massive investment in the next generation of Drone. Where Drone focused on continuous integration, Gitness adds source code hosting, bringing code management and pipelines closer together.

The goal is for Gitness to eventually be at full parity with Drone in terms of pipeline capabilities, allowing users to seemlessly migrate from Drone to Gitness.

But, we expect this to take some time, which is why we took a snapshot of Drone as a feature branch drone (README) so it can continue development.

As for Gitness, the development is taking place on the main branch.

For more information on Gitness, please visit gitness.com.

For more information on Drone, please visit drone.io.

Gitness Development

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 dep
$ make tools

Build

First step is to build the user interface artifacts:

$ pushd web
$ yarn install
$ yarn build
$ popd

After that, you can build the gitness binary:

$ make build

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.

To start the server at localhost:3000, simply run the following command:

./gitness server .local.env

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
  • navigate into the web folder and run yarn services

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

User Interface

This project includes a full 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.

REST API

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).

For testing, it's simplest to just use the cli to create a token (this requires gitness server to run):

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

# GENERATE PAT (1 YEAR VALIDITY)
$ ./gitness user pat "my-pat-uid" 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"

CLI

This project includes VERY basic command line tools for development and running the service. Please remember that you must start the server before you can execute commands.

For a full list of supported operations, please see

$ ./gitness --help
from  https://github.com/harness/gitness 

 

No comments:

Post a Comment