SpringBoot actual e-business project mall (30K + STAR) address: github.com/macrozheng/…

Abstract

I have used Gitlab to build Git services before, and if the server configuration is low, it will be very slow to start and access. Recently discovered Gogs this open source project, easy to install, especially lightweight, recommended to everyone!

Introduction of Gogs

Gogs is a self-service Git service that is easy to build. It is developed using Go language and supports all platforms supported by Go language, including Linux, Mac OS X, Windows and ARM platforms. Gogs requires so little hardware that you can build it on a Raspberry PI.

Project address: github.com/gogs/gogs

The installation

Gogs installation in Docker environment is very simple, only need two commands, recommended to use this method to install.

  • First, we need to download the Docker image of Gogs.
docker pull gogs/gogs
Copy the code
  • Use after downloadingdocker runCommand to run the service;
docker run -p 10022:22 -p 10080:3000 --name=gogs \
-v /mydata/gogs:/data  \
-d gogs/gogs
Copy the code
  • So here’s what’s interesting about the command,10022This corresponds to the SSH service port of Gogs,10080For the corresponding HTTP service port using Gogs, we also mount the container’s data directory to the host’s/mydata/gogsDirectory, so that data won’t be lost even if we recreate the container.

configuration

  • After the installation is complete, we first visited Gogs service will display a Settings page, access to the address: http://192.168.5.19:10080/

  • Database Settings, here we directly use the built-in SQLite3 database can use other need to build their own database;

  • To apply basic Settings, modify the domain name, SSH port number, and application URL.

use

registered

  • After the configuration is complete, the system directly jumps to the login page. Register an account first.

  • After registration, you can log in to the control Panel page.

Create a warehouse

  • Directly use the plus sign on the right of my warehouse to create the warehouse, simply set the warehouse name and visibility to complete the creation;

  • After successful creation, clone the warehouse directly using the clone address.

  • We can use Git check out function of IDEA directly.

  • After checking out, add our code to submit and push directly, and you can see our submitted code in Gogs.

Work order management

  • The work order management here is somewhat similar to the Issue function on Github, which we can passCreate a work orderButton to create;

  • Enter our title, content, and tag to create;

  • The following information is displayed after the creation.

Add user

  • Sometimes administrators need to create accounts for collaborative development, so we just clickProfile picture -> Admin Panel -> User ManagementCan open the user management interface;

  • And then clickCreating a new accountEnter related information to complete the creation.

Management collaborator

  • After the creation is complete, we can put it on the warehouse pageThe warehouse is setIn the openManagement collaboratorFunction;

  • Then enter the collaborator account and clickAdd new collaboratorsAnd set permissions so that collaborators can access and commit code to the repository.

Migrating external repositories

  • Gogs also provides the ability to migrate code from an external repository by using the plus sign to the left of the profile picture and then selectingMigrating external repositoriesCan;

  • Here to migrate themallFor example, project address:Gitee.com/macrozheng/…

  • After the migration is successful, you can see it in the GogsmallThe project!

Gogs VS Gitlab

Before, I wrote an article titled “Building my Own Git Repository in 10 Minutes”, using Gitlab. The following compares the advantages and disadvantages of Gogs and Gitlab in the process of installation and use, which only represents my personal opinion.

comparative Gogs Gitlab
Docker image size 44MB 836MB
startup Very quickly, a few seconds Slow, 10 minutes if the machine is not properly configured
Configuration requirements It’s low. Raspberry pie will do High, eat memory, eat CPU
Access speed Fast enough The machine can be configured just fine
function Function is less It’s very functional

The public,

Mall project full set of learning tutorials serialized, attention to the public number the first time access.