Jenkins

Introduction

Application Details

In this article, we explore the Go Web App sample application, which is designed for deployment using Jenkins. This application, forked to the Admin Turn DevOps GitHub organization and available in the Go Web App sample repository, is a straightforward implementation that leverages GORM for seamless database operations.

The image shows a GitHub repository page for "go-webapp-sample," displaying branches, commits, and file directories.

When you run the application, you will first see a login page. Use the provided credentials (for example, "test" for both username and password) to log in. Once authenticated, you will gain access to several application features, including an integrated Swagger API documentation interface that details all available endpoints.

Tip

To explore all the endpoints, simply navigate to the Swagger UI after starting the application.

Installation and Usage

Follow these commands in your terminal to install and run the application:

go get -u github.com/ybkuroki/go-webapp-sample
go run main.go

Once the application is running, open the Swagger UI to review the list of available API endpoints and their documentation.

The image shows a Swagger UI for the "go-webapp-sample API," detailing authentication and book-related endpoints with HTTP methods like POST, GET, and PUT.

API Endpoints Overview

For example, the API features an endpoint that checks the login status, confirming a successful authentication when queried. Additionally, the application enables you to fetch account details. Below is an example JSON response detailing the attributes of the logged-in account:

{
  "id": 1,
  "name": "test",
  "authority_id": 1,
  "authority": {
    "id": 1,
    "name": "Admin"
  }
}

Note

Feel free to explore the repository further, download the source code, and experiment with the application locally.

Next Steps

This article covers the initial setup and exploration of the Go Web App. In the subsequent sections, we will delve into the full deployment process, guiding you through each step in detail.

Thank you for reading!

Watch Video

Watch video content

Previous
Course Introduction