Skip to content

Commit

Permalink
Merge pull request #416 from KTH/stratus-templates
Browse files Browse the repository at this point in the history
pipeline: migrate stratus-templates
  • Loading branch information
Saulopv authored Jan 9, 2025
2 parents b87bbdd + 1b3290e commit ba3af4a
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 95 deletions.
34 changes: 21 additions & 13 deletions .azure/azure-pipelines.pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,30 @@ 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.x
- template: templates/test/docker-test.yml@cet-iac
parameters:
dockerComposeFilePaths:
- '$(Pipeline.Workspace)/github/docker-compose-unit-tests.yml'
dockerfilePath: $(dockerfilePath)
imageName: $(imageName)
tag: $(tag)
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

- template: /templates/test/docker.yml@stratus-templates
parameters:
dockerComposeFilePaths:
- '$(Pipeline.Workspace)/github/docker-compose-unit-tests.yml'
dockerfilePath: $(dockerfilePath)
imageName: $(imageName)
tag: $(tag)
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: kurs-pm-web-prod
- name: imageName
value: kurs-pm-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 }}
82 changes: 48 additions & 34 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: kurs-pm-web-ref
- name: imageName
value: kurs-pm-web
- name: tag
Expand All @@ -20,43 +17,60 @@ 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.x
- template: templates/docker/build.yml@cet-iac
parameters:
runScan: false
dockerFilePath: $(dockerfilePath)
imageName: $(imageName)
tag: $(tag)
extends:
template: templates/security/security-scans.yml@stratus-templates
parameters:
break: false
jobs:
- job: test
displayName: 'Docker Compose Test'
steps:
- template: /templates/test/docker.yml@stratus-templates
parameters:
imageName: $(imageName)
dockerfilePath: $(dockerfilePath)
tag: $(tag)
dockerComposeFilePaths:
- '$(Pipeline.Workspace)/github/docker-compose-unit-tests.yml'

- template: templates/test/docker-test.yml@cet-iac
parameters:
imageName: $(imageName)
dockerfilePath: $(dockerfilePath)
tag: $(tag)
dockerComposeFilePaths:
- '$(Pipeline.Workspace)/github/docker-compose-unit-tests.yml'
- 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/docker/push.yml@cet-iac
parameters:
dockerFilePath: $(dockerfilePath)
imageName: $(imageName)
tag: $(tag)
- 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)

- template: templates/app-service/update-image.yml@cet-iac
parameters:
parametersFileName: $(parametersFileName)
appName: $(appName)
imageName: $(imageName)
tag: $(tag)
isApi: false
- 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": "kurs-pm-web-prod"
"value": "kurs-pm-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": "kurs-pm-web-ref"
"value": "kurs-pm-web"
},
"env": {
"value": "ref"
},
"secretNames": {
"value": [
Expand Down

0 comments on commit ba3af4a

Please sign in to comment.