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 downloading
docker run
Command 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,
10022
This corresponds to the SSH service port of Gogs,10080
For the corresponding HTTP service port using Gogs, we also mount the container’s data directory to the host’s/mydata/gogs
Directory, 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 pass
Create a work order
Button 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 click
Profile picture -> Admin Panel -> User Management
Can open the user management interface;
- And then click
Creating a new account
Enter related information to complete the creation.
Management collaborator
- After the creation is complete, we can put it on the warehouse page
The warehouse is set
In the openManagement collaborator
Function;
- Then enter the collaborator account and click
Add new collaborators
And 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 selecting
Migrating external repositories
Can;
- Here to migrate the
mall
For example, project address:Gitee.com/macrozheng/…
- After the migration is successful, you can see it in the Gogs
mall
The 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.