Sajeetharan Sinnathurai
With over 13 years of experience in the IT industry, Sajeetharan is a Cloud Solution Architect, an enthusiast in Cloud and Opensource.He currently works at Microsoft as a Senior Program Manager in the CosmosDB team
@kokkisajee
www.sajeetharan.com
Angular Colombo Meetup
@kokkisajee
My Desktop
deploy/ftp?
pray
smoke or manual test
did it worked?
no
yes
pray more
smoke or manual test
Create
Devops
Pipeline
Add
Code
Coverage
Add
Linting
Results
Add
E2E
Tests
Challenge for the Day!
Code
&
Build
Access code from:
Step 1 :
Navigate to https://dev.azure.com
Step 2 :
Add the web.config file under /src
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Angular" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="/" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
Step 3:
Create AppService on Azure
Step 3 :
Refer web.config in angular.json
Step 4 :
Select the source and target branch
"assets": [
"src/favicon.ico",
"src/assets",
"src/web.config"
]
Step 5 :
Add task to Install angular/cli
Step 5 :
Add task to Install packages
Step 6 :
Build the App
Step 7 :
Step 8 :
App service deploy
Publish Artifact
Step 9 :
Add the karma-junit-reporter
Step 10 :
npm install karma-junit-reporter --save-dev
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma'),
require('karma-junit-reporter')
],
client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, '../coverage/ngColomboAI'),
reports: ['html', 'lcovonly', 'text-summary','cobertura'],
fixWebpackSourcePaths: true
},
reporters: ['progress', 'kjhtml','junit'],
junitReporter: {
outputDir: '../junit'
},
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['ChromeHeadless'],
singleRun: false,
restartOnFileChange: true
});
};
Publish Test Results :
Step 10 :
Delete Junit Files
Step 11 :
When you build
Analyze and Optimize
ng build --prod
ng build --prod --build-optimizer=true
ng build --prod --source-map
npm i -g source-map-explorer
source-map-explorer dist/ngColombo/main.bundle.js
my laptop
run build on
create a pull request
unit and e2e tests
did it work?
no
yes
merge pull request
run build on
did it work?
yes
publish to staging
no
New version
Where to go from here?
- Automate everything
- Containerize your solution
- Build apps with Azure
- Send your queries @kokkisajee
- Be a part of Ng-SriLanka
By Sajeetharan Sinnathurai
With over 13 years of experience in the IT industry, Sajeetharan is a Cloud Solution Architect, an enthusiast in Cloud and Opensource.He currently works at Microsoft as a Senior Program Manager in the CosmosDB team