-
Notifications
You must be signed in to change notification settings - Fork 0
/
automated-dependency-pipeline.yml
71 lines (59 loc) · 1.93 KB
/
automated-dependency-pipeline.yml
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
# azure-pipelines-automated-dependency.yml
trigger: none
# schedules:
# - cron: "0 19 * * *"
# displayName: Every day at midnight GMT+5
# branches:
# include:
# - main
# always: true
pool:
vmImage: 'ubuntu-latest'
stages:
- stage: AutomatedDependencyUpdateServer
jobs:
- job: AutomatedDependencyUpdateServerJob
steps:
- checkout: self # Add this step to check out the source code
persistCredentials: true # Optionally persist credentials if needed
- task: UsePythonVersion@0
inputs:
versionSpec: '3.x'
addToPath: true
displayName: 'Set Python version'
- script: |
npm install -g npm-check-updates
cd server
ncu -u
displayName: 'Check and Update Dependencies (Server)'
- script: |
git config --global user.email "[email protected]"
git config --global user.name "Faraz Khawaja"
git add server/package.json
git commit -m "Update dependencies (Server)"
git push -u origin HEAD:main
displayName: 'Pushing to GitHub (Server)'
- stage: AutomatedDependencyUpdateClient
jobs:
- job: AutomatedDependencyUpdateClientJob
steps:
- checkout: self # Add this step to check out the source code
persistCredentials: true # Optionally persist credentials if needed
- task: UsePythonVersion@0
inputs:
versionSpec: '3.x'
addToPath: true
displayName: 'Set Python version'
- script: |
npm install -g npm-check-updates
cd client
ncu -u
displayName: 'Check and Update Dependencies (Client)'
- script: |
git config --global user.email "[email protected]"
git config --global user.name "Faraz Khawaja"
git pull origin main
git add client/package.json
git commit -m "Update dependencies (Client)"
git push -u origin HEAD:main
displayName: 'Pushing to GitHub (Client)'