Changes for content/handbook/customer-experience/professional-services-engineering/education-services/ilt-labs/advgitlabcicdhandsonlab3.md: 49 added lines, 7 removed lines.
Original line number
Diff line number
Diff line
@@ -11,7 +11,47 @@ The purpose of this lab is to create a review app from a Node.js application. A
- Create a review app from the Node.js application
## Task A. Creating a Review App
## Task A. Creating a Web App
For this task, we will be creating a web application to run in our review environment. We will do this work on a separate `review-app` branch, so that the `main` branch keeps the search code and tests used in later labs.
1. Navigate to your project repository.
1. Select **Code > Branches**.
1. Select **New branch**.
1. Set the branch name to `review-app`, leave **Create from** set to `main`, and select **Create branch**.
1. Select **Build > Pipeline Editor**, and set the branch to **review-app**.
1. When we add express code into our `index.js` file, our tests will no longer be able to run against `index.js`, since running this will create a webserver that waits for connections. Thus, let's remove the `install deps`, `test binarysearch` and the `test linearsearch` jobs from the file. Remove the jobs from the `.gitlab-ci.yml` file, and select **Commit changes**.
1. Navigate back to your project repository, and set your branch to **review-app**.
1. Select your `index.js` file.
1. Select **Edit > Edit single file**.
1. Remove the binary search and linear search methods, and add the code below, which will run our web application:
```js
const express = require('express')
const app = express()
const port = 4001
app.get('/', (req, res) => {
res.send('Hello World!')
})
app.listen(port, () => {
console.log(`Example app listening on port ${port}`)
})
```
1. Commit your changes to the `review-app` branch.
## Task B. Creating a Review App
1. In the left sidebar, select **Operate > Environments**.
@@ -94,7 +134,8 @@ The purpose of this lab is to create a review app from a Node.js application. A
Changes for content/handbook/customer-experience/professional-services-engineering/education-services/ilt-labs/advgitlabcicdhandsonlab4.md: 4 added lines, 2 removed lines.
Original line number
Diff line number
Diff line
@@ -35,7 +35,7 @@ Follow these steps to set up and use a feature flag:
1. Select **Edit > Edit in single file**.
1. In your `index.js` file, remove all of your existing code and replace it with the following, ensuring to replace **your-instance-url** and **your-instance-id** with the values your made a note of earlier:
1. In your `index.js` file, remove all of your existing code and replace it with the following, ensuring to replace **your-instance-url** and **your-instance-id** with the values you made a note of earlier:
```js
const { initialize } = require('unleash-client');
@@ -59,6 +59,8 @@ Follow these steps to set up and use a feature flag:
1. Keep everything as the default value, and select **Create a merge request**.
> The pipeline for this commit fails, because the test jobs from earlier labs cannot load the new `index.js`. You replace these jobs in Task B.
>
> This code will continually run, attempting to check if the feature flag toggle is enabled or disabled. Since it is enabled for 50% of users, you should see it around half the time when this runs.
## Task B. Test the Feature Flag
@@ -89,7 +91,7 @@ Follow these steps to set up and use a feature flag:
1. Select the `test_flag` job.
1. Observe that sometimes this job outputs true and sometimes it outputs false. This is because the feature flag is active 50% of the time.
1. Observe that sometimes this job outputs `Toggle enabled` and sometimes it outputs `Toggle disabled`. This is because the feature flag is active 50% of the time.
1. Cancel the job by selecting the **Cancel** button.