Skip to content

Commit

Permalink
Merge pull request #400 from KTH/stratus-templates
Browse files Browse the repository at this point in the history
pipeline: migrate to stratus-templates
  • Loading branch information
Saulopv authored Jan 9, 2025
2 parents 59a0fec + 41b4cd9 commit 0522a7a
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 81 deletions.
25 changes: 13 additions & 12 deletions .azure/azure-pipelines.pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,25 @@ pr:

variables:
- group: studadm-general-params
- name: imageName
value: kursinfo-web
- name: dockerfilePath
value: '$(Pipeline.Workspace)/github/Dockerfile'
- name: tag
value: '$(Build.SourceVersion)'

resources:
repositories:
- repository: cet-iac
- repository: stratus-templates
type: git
name: Cloud Excellence Team/cet-iac
name: Cloud Excellence Team/stratus-templates
ref: main

pool:
vmImage: 'ubuntu-latest'

steps:
- template: templates/test/npm-test.yml@cet-iac
parameters:
nodeVersion: '18'
extends:
template: templates/security/security-scans.yml@stratus-templates
parameters:
break: false
jobs:
- job: test
displayName: 'Test'
steps:
- template: /templates/test/npm.yml@stratus-templates
parameters:
nodeVersion: 18.x
28 changes: 15 additions & 13 deletions .azure/azure-pipelines.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,31 @@ parameters:

variables:
- group: studadm-general-params
- group: studadm-spoke1-prod
- name: appName
value: kursinfo-web-prod
- name: imageName
value: kursinfo-web
- name: parametersFileName
value: prod.parameters.json

resources:
repositories:
- repository: cet-iac
- repository: stratus-templates
type: git
name: Cloud Excellence Team/cet-iac
name: Cloud Excellence Team/stratus-templates
ref: main

pool:
vmImage: 'ubuntu-latest'

steps:
- template: templates/app-service/update-image.yml@cet-iac
parameters:
parametersFileName: $(parametersFileName)
appName: $(appName)
imageName: $(imageName)
tag: ${{ parameters.imageTag }}
isApi: false
extends:
template: templates/security/security-scans.yml@stratus-templates
parameters:
break: false
jobs:
- job: update
displayName: 'Update App Service'
steps:
- template: /templates/app-service/update-image.yml@stratus-templates
parameters:
parametersFileName: $(parametersFileName)
imageName: $(imageName)
tag: ${{ parameters.imageTag }}
60 changes: 39 additions & 21 deletions .azure/azure-pipelines.ref.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@ trigger:

variables:
- group: studadm-general-params
- group: studadm-spoke1-ref
- name: dockerfilePath
value: '$(Pipeline.Workspace)/github/Dockerfile'
- name: appName
value: kursinfo-web-ref
- name: imageName
value: kursinfo-web
- name: tag
Expand All @@ -20,28 +17,49 @@ variables:

resources:
repositories:
- repository: cet-iac
- repository: stratus-templates
type: git
name: Cloud Excellence Team/cet-iac
name: Cloud Excellence Team/stratus-templates
ref: main

pool:
vmImage: 'ubuntu-latest'

steps:
- template: templates/test/npm-test.yml@cet-iac
parameters:
nodeVersion: '18'
- template: templates/docker/push.yml@cet-iac
parameters:
dockerFilePath: $(dockerfilePath)
imageName: $(imageName)
tag: $(tag)
extends:
template: templates/security/security-scans.yml@stratus-templates
parameters:
break: false
jobs:
- job: sonarqube
displayName: 'SonarQube and NPM Test'
steps:
- template: /templates/codescan/sonarqube.yml@stratus-templates
parameters:
projectName: $(imageName)
steps:
- template: /templates/test/npm.yml@stratus-templates
parameters:
nodeVersion: 18.x

- template: templates/app-service/update-image.yml@cet-iac
parameters:
parametersFileName: $(parametersFileName)
appName: $(appName)
imageName: $(imageName)
tag: $(tag)
isApi: false
- job: build_push
dependsOn: sonarqube
displayName: 'Build and Push image'
steps:
- template: /templates/docker/push.yml@stratus-templates
parameters:
build: true
break: false
dockerFilePath: $(dockerfilePath)
imageName: $(imageName)
tag: $(tag)

- job: update
dependsOn:
- build_push
displayName: 'Update App Service'
steps:
- template: /templates/app-service/update-image.yml@stratus-templates
parameters:
parametersFileName: $(parametersFileName)
imageName: $(imageName)
tag: $(tag)
33 changes: 0 additions & 33 deletions .azure/deploy-infra.yml

This file was deleted.

5 changes: 4 additions & 1 deletion .azure/prod.parameters.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
"contentVersion": "1.0.0.0",
"parameters": {
"appName": {
"value": "kursinfo-web-prod"
"value": "kursinfo-web"
},
"env": {
"value": "prod"
},
"secretNames": {
"value": [
Expand Down
5 changes: 4 additions & 1 deletion .azure/ref.parameters.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
"contentVersion": "1.0.0.0",
"parameters": {
"appName": {
"value": "kursinfo-web-ref"
"value": "kursinfo-web"
},
"env": {
"value": "ref"
},
"secretNames": {
"value": [
Expand Down

0 comments on commit 0522a7a

Please sign in to comment.