apiVersion: console.openshift.io/v1
kind: ConsoleQuickStart
metadata:
  annotations:
    include.release.openshift.io/ibm-cloud-managed: 'true'
    include.release.openshift.io/self-managed-high-availability: 'true'
    include.release.openshift.io/single-node-developer: 'true'
  name: node-with-s2i
spec:
  description: 'Import a Node Application from git, build, and deploy it onto OpenShift.'
  displayName: Get started with Node
  durationMinutes: 10
  icon: >-
    data:image/svg+xml;base64,[encoded data, 12588 characters]
  introduction: >-
    **Node.js** is based on the V8 JavaScript engine and allows you to write server-side JavaScript applications. It provides an I/O model based on events and non-blocking operations that enables you to write efficient applications.
    
    - The Node.js runtime enables you to run Node.js applications and services on OpenShift while providing all the advantages and conveniences of the OpenShift platform such as:
    
      - Rolling updates
    
      - Continuous delivery pipelines
      
      - Service discovery
    
      - Externalized configuration
    
      - Load balancing
    
    OpenShift also makes it easier for your applications to implement common microservice patterns such as externalized configuration, health check, circuit breaker, and failover.

  tasks:
    - description: >-
        To create a Node application:
        
        1. Click on the [perspective switcher]{{highlight qs-perspective-switcher}} at the top of the navigation, and select **Developer**.
        
        1. In the navigation menu, click [Add]{{highlight qs-nav-add}}.
        
        1. Click the **Project** dropdown menu and select **Create Project** to create a project for your Node application.

        1. In the **Name** field, enter a name for your new project. Then click **Create**.
        
        1. On the **+Add page**, click **From Git**. 
        
        1. In the **Git Repo URL** field, add 
        
          ```
            https://github.com/nodeshift-starters/nodejs-rest-http-redhat
          ``` 
        
        1. At the end of the form, click **Create**. 

      review:
        failedTaskHelp: This task isn’t verified yet. Try the task again.
        instructions: |-
          The application is represented by the light grey area with the white border.  The deployment is a white circle.  Verify that the application was successfully created:
          
          - Can you identify a **nodejs-rest-http-redhat-app** application?
          
          - Can you identify a **nodejs-rest-http-redhat** deployment?

      summary:
        failed: Try the steps again.
        success: Your Node application has been deployed onto OpenShift.
      title: Create a Node application
    - description: >-
        To view the build status of your Node application:
        
        1. To view build status in a tooltip, hover over the status icon on the bottom left quadrant of the **nodejs-rest-http-redhat** deployment.
        
        1. Click on the icon for quick access to the build log.  
        
            - You should be able to see the log stream of the **nodejs-rest-http-redhat-1** build on the **Build Details** page.
          
            - The application and its dependencies will be built into a container image and pushed to the OpenShift container registry.

      review:
        failedTaskHelp: This task isn’t verified yet. Try the task again.
        instructions: >-
          Verify the build is complete:

          - This build may take a few minutes. When it's finished, a **Complete** badge will surface on the page header beside build name **nodejsrest-http-redhat-1**. Did this badge appear?

      summary:
        failed: Try the steps again.
        success: Your build is complete.
      title: View the build status
    - description: >-
        To view the associated code:
        
        1. In the navigation menu, click [Topology]{{highlight qs-nav-topology}}.
        
        1. The icon on the bottom right quadrant of the **nodejs-rest-http-redhat** deployment represents the Git repository of the associated code.  
        
            - The icon shown can be for Bitbucket, GitHub, GitLab or generic Git.  
          
        1. Click on the icon to navigate to the associated Git repository.
      review:
        failedTaskHelp: >-
          This task isn’t verified yet. Try the task again.
        instructions: |-
          Verify that you can see the code associated with the sample app:
          
          - Was a new browser tab opened with **https://github.com/nodeshift-starters/nodejs-rest-http-redhat** ?

          - Return to the browser tab running OpenShift.  

      summary:
        failed: Try the steps again.
        success: You accessed the Git repository associated with your deployment.
      title: View the associated Git repository
    - description: >-
        To view the pod status:

        1. Hover over the pod donut to see the pod status in a tooltip.

             - Notice that the **nodejs-rest-http-redhat** deployment has a pod donut imposed on the circle, representing the pod status (i.e. blue = running).  
        
              - The color of the donut indicates the pod status.  

      review:
        failedTaskHelp: >-
          This task isn’t verified yet. Try the task again.
        instructions: |-
          Verify you see the pod status:
          
          - Do you see the number of associated pods and their statuses?

      summary:
        failed: Try the steps again.
        success: Your deployment has one running pod.
      title: View the pod status

    - description: >-
        The external link icon on the top right quadrant of the **nodejs-rest-http-redhat** deployment represents the route URL.  
        
        1. Click the external link icon to open the URL and run the application in a new browser tab.
      review:
        failedTaskHelp: >-
          This task isn’t verified yet. Try the task again.
        instructions: |-
          Verify your Node application is running:
          
          - Is the new tab titled **API Level 0 Example - Node.js**?

      summary:
        failed: Try the steps again.
        success: Your Node application is running.
      title: Run the Node application
  conclusion: >-
    Your Node application is deployed and ready.
