-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathazure-pipelines.yml
More file actions
113 lines (108 loc) · 3.66 KB
/
azure-pipelines.yml
File metadata and controls
113 lines (108 loc) · 3.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# Docker
# Build and push an image to Azure Container Registry
# https://docs.microsoft.com/azure/devops/pipelines/languages/docker
trigger:
- main
- demo
resources:
- repo: self
variables:
# Container registry service connection established during pipeline creation
dockerRegistryServiceConnection: "f96295a4-0752-4228-ad35-419f404433a0" # FONTOS: Ezt módosítsd az Azure DevOps "service conection" azinisítójának megfelelően
imageRepository: "trn-node-docker-app" # FONTOS: Ezt módosítsd a kép nevének megfelelően
containerRegistry: "mentorklub.azurecr.io" # FONTOS: Ezt módosítsd az ACR nevének megfelelően
dockerfilePath: "$(Build.SourcesDirectory)/Dockerfile"
tag: "$(Build.BuildId)"
# Agent VM image name
vmImageName: "ubuntu-latest"
stages:
- stage: cd_build_and_push
displayName: CD - Épít és feltölt
condition: eq(variables['Build.reason'], 'IndividualCI')
jobs:
- job: Build
displayName: Építés (Build)
pool:
vmImage: $(vmImageName)
steps:
- task: Docker@2
displayName: Kép építése és feltöltése a Azure ACR-be
inputs:
command: buildAndPush
repository: $(imageRepository)
dockerfile: $(dockerfilePath)
containerRegistry: $(dockerRegistryServiceConnection)
tags: |
$(tag)
latest
- stage: ci_code_lint
displayName: CI - Kód formátum ellenőrzés
condition: eq(variables['Build.Reason'], 'PullRequest')
jobs:
- job: basic_check
displayName: Kód ellenőrzés
steps:
- task: NodeTool@0
displayName: "NodeJs 22 telepítés"
inputs:
versionSpec: "22.x"
- task: Bash@3
name: install_dependencies
displayName: Függőségek teleptése
inputs:
targetType: "inline"
script: |
npm upgrade
npm install
- task: Bash@3
name: node_check
displayName: "NodeJS - Kód ellenőrzés"
inputs:
targetType: "inline"
script: |
echo "##[command]A kód rendben?"
npm run lint:js
- task: Bash@3
name: ejs_check
displayName: "EJS - Kód ellenőrzés"
inputs:
targetType: "inline"
script: |
echo "##[command]A kód rendben?"
npm run lint:ejs
- task: Bash@3
name: html_check
displayName: "HTML - Kód ellenőrzés"
inputs:
targetType: "inline"
script: |
echo "##[command]A kód rendben?"
npm run lint:html
- stage: ci_code_check
displayName: CI - Funkció ellenőrzés
condition: eq(variables['Build.Reason'], 'PullRequest')
dependsOn: ci_code_lint
jobs:
- job: basic_check
displayName: Funkció ellenőrzés
steps:
- task: NodeTool@0
displayName: "NodeJs 22 telepítés"
inputs:
versionSpec: "22.x"
- task: Bash@3
name: install_dependencies
displayName: Függőségek teleptése
inputs:
targetType: "inline"
script: |
npm upgrade
npm install
- task: Bash@3
name: unit_tests
displayName: "Funkcionális tesztek futtatása"
inputs:
targetType: "inline"
script: |
echo "##[command]Funkciók rendben?"
npm run test