Configuring Gogs

Let's configure the SCM server and push a tiny microservice to it:

  1.  Start up Docker Compose from our CI services bundle with this command:
docker-compose up
  1. When all services are started, open http://localhost:10080 in a browser to configure the Gogs server. You will see the following configuration form:

  1. Set SQLite3 in the Database Type field (because we won't spend time configuring an external database), leave the default values in the other fields, and hit the Install Gogs button. It will redirect you to port 3000, but recall that, it's available inside Docker only and you have to open the previous URL again.
  1. Click the Register link and register a new account:

I set developer as the username and secret as the password. We need these credentials to both upload our code to a created repository and to pull it with CI.

  1. Create a new private repository with the + sing button and call it microservice. Now you can upload the code to this repository using http://localhost:3000/developer/microservice.git. If you use the code of this chapter from the repository of the book, you can use the microservice crate in that folder, but you have to initialize it and add the remote server with these commands:

 

git init
git add -A
git commit
git remote add origin http://localhost:10080/developer/microservice.git
git push origin master

It's a trivial command, but one to remember if you forget something.

  1. Enter the username and password we set before, and you have got an empty repository in SCM:

Now we can configure CI to get this code for building.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.206.25