Skip to content

Latest commit

 

History

History
75 lines (55 loc) · 2.44 KB

6.DebugApplicationinCRW2.adoc

File metadata and controls

75 lines (55 loc) · 2.44 KB

Deploy Golang App on Red Hat CodeReady Workspaces 2

Prerequisites

  • You have access to OpenShift Web Console URL. Ask your workshop coordinator for URL if you don’t have one.

  • You have credentials to login. Ask your workshop coordinator for credentials to log onto the OpenShift cluster

  • You have access to a CodeReady Workspaces URL. Ask your workshop coordinator for URL if you don’t have one.

  • Completed Using CodeReady Workspaces build containerized application in a container

Introduction

CodeReady Workspaces 2.0 provides developer environments that are Kubernetes pods running on OpenShift. In those sandboxes are the components and tools needed to code on a project: a browser-based editor, the plugins, the tools, and the different runtimes required for your project. Everything is running in containers, providing highly consistent, repeatable, and reproducible developer environments—zero config needed, zero pain.

Exercise

CodeReady Workspaces 2 Debugging

  • Using the application deployed in Excerise [5.whatever$] we will debug and then deploy the application to OpenShift

Application Debugging

Click on the debug icon on the right hand of the screen.

codeready debugmenu

Click on No Configuration then select Add Configuration.

Paste the following in the launch.json file

{
  // Use IntelliSense to learn about possible attributes.
  // Hover to view descriptions of existing attributes.
  "version": "0.2.0",
  "configurations": [
      {
          "name": "Launch file",
          "type": "go",
          "request": "launch",
          "mode": "debug",
          "program": "/projects/codeready-go-app/main.go"
      }
  ]
}

Navigate back to Explorer and select the main.go file

  • In Main.go navigate to line 19

  • Click next to 19 to add line to debug

codeready debugline19

Navigate back to debug window click the play icon to start debugging

View the results of the debug step thru as needed

codeready debugresults

Click on the stop icon to stop debugging

Delete project

$ oc delete project codeready-app-userXX

Summary

In this lab we learned the following.
  • How to debug an application in CodeReady Workspaces 2