Sails (Part 1)

Neil HaddleyOctober 12, 2021

Azure DevOps and Sails.

DevOpsAzuresails-jsazure-devopsnodemvc

I used the Azure DevOps Starter to set up a Sails.js Node.js web application with a CI/CD pipeline, container registry, and database.

I navigated to DevOps Starter

I navigated to DevOps Starter

I created a DevOps Starter

I created a DevOps Starter

I set up a Node.js web app with GitHub

I set up a Node.js web app with GitHub

I selected Sails.js and added a database

I selected Sails.js and added a database

I selected Web App for Containers

I selected Web App for Containers

I connected to GitHub

I connected to GitHub

I configured the Web App, Container Registry, and Database settings

I configured the Web App, Container Registry, and Database settings

I reviewed the settings and clicked Create

I reviewed the settings and clicked Create

The deployment was in progress

The deployment was in progress

The deployment was complete

The deployment was complete

The GitHub action was running

The GitHub action was running

I authorised the deployment

I authorised the deployment

The action built and pushed the application to the Container Repository

The action built and pushed the application to the Container Repository

The action ran functional tests (connecting to the website using Selenium and checking the site title)

The action ran functional tests (connecting to the website using Selenium and checking the site title)

The action set up the test environment and ran tests

The action set up the test environment and ran tests

The GitHub action/job completed

The GitHub action/job completed

The website was published

The website was published

I opened the GitHub repository using GitHub Desktop

I opened the GitHub repository using GitHub Desktop

I cloned the repository

I cloned the repository

I opened the project in Visual Studio Code

I opened the project in Visual Studio Code

I reviewed the sample functional tests

I reviewed the sample functional tests

local development environment

I opened a Visual Studio Code terminal, navigated to the Application folder, and started the application.

BASH
1% cd Application
BASH
1% sails lift
I ran sails lift

I ran sails lift

I opened http://localhost:1337 in the browser

I opened http://localhost:1337 in the browser

Testing testing

I updated the default page title (in the layout file), which caused the functional test to fail.

I updated the web page title without updating the web page title test

I updated the web page title without updating the web page title test

I pushed the update

I pushed the update

The code was deployed and the functional test failed (as expected)

The code was deployed and the functional test failed (as expected)

References