Deploy and Run Go Git Service in the Cloud

16

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.

1841-1-create-golang-environment

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.

1841-1-open-my-gogs-in-a-browser

Use your database 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.

1841-1-create-a-gogs-database

Tip: For production usage, it is recommended to create separate database user (the User accounts tab) instead of using the database root account.

4. Deploy the Gogs project using the following repository link:

https://github.com/gogs/gogs.git

1841-1-deploy-the-gogs-project

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

1841-my-gogs-web-ssh

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/”.

1841-1-adjust-the-server-section-of-app-ini

Don’t forget to Save the changes.

7. Add the GO_RUN_OPTIONS environment variable with the web value.

1841-1-go-run-option

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

1841-1-gogs-installation-page

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

1841-1-gogs-login-screen

That’s it! You can start using Gogs immediately!

Feel free to explore the benefits and usability of this Go Git service by registering at our Jelastic PaaS platform.

SOURCEJelastic, Inc.