Deploy and Run Go Git Service in the Cloud
Gogs (Go Git Service) is an open-sourced self-hosted Git service, which can be easily deployed and hosted at Jelastic PaaS. Get your own GitHub-like fully configurable and isolated instance with unlimited private repositories and a tiny resource footprint.
Follow the step-by-step guide below to deploy Gogs:
1. Create a new environment with the Golang application server and the MySQL database.
Set the required resource limits for nodes, adjust name and click Create to proceed.
2. Once your environment is created, click the Open in Browser button next to the MySQL node to access the database admin panel.
Use your DB credentials (sent via the appropriate email) to log in.
3. Navigate to the Databases tab and Create a new gogs database, which will be used with your Git service.
Tip: For production usage, it is recommended to create separate DB user (the User accounts tab) instead of using database root account.
4. Deploy the Gogs project using the following repository link:
5. After successful deployment, you need to adjust the default settings.
First of all, make a copy of the /home/jelastic/webapp/ROOT/conf/app.ini config file and paste it into the newly created /home/jelastic/webapp/ROOT/custom/conf/ folder.
This can be easily done via Web SSH, just run the following two commands:
mkdir -p /home/jelastic/webapp/ROOT/custom/conf
cp /home/jelastic/webapp/ROOT/conf/app.ini /home/jelastic/webapp/ROOT/custom/conf/app.ini
6. Adjust the server section of your custom app.ini config file:
- PROTOCOL – set the protocol to be used (e.g. http)
- DOMAIN – provide your environment domain name (my-gogs.jelastic.com)
- ROOT_URL – change to the following %(PROTOCOL)s://%(DOMAIN)s/
Don’t forget to Save the changes.
7. Add the GO_RUN_OPTIONS environment variable with the web value.
Restart your Golang node to apply changes.
8. Open your environment in a browser and you’ll be automatically redirected to the Gogs installation page:
- Database Settings (Type, Host, User, Password, DB name) – provide the database connection data (use the previously received email to get the required credentials)
- Application General Settings – change the Run User field value to golang
- Optional Settings – configure Admin Account Settings (can be registered later – the very first user will be automatically provided with administrator permissions)
Click the Install Gogs at the bottom of the page.
9. You’ll be automatically logged in or redirected to the login screen (where you can sign up a new user).
That’s it! You can start using Gogs immediately!
Feel free to explore the benefits and usability of this Go Git service within Jelastic PaaS at one of the available service providers.