Skip to content

Commit c2e2a54

Browse files
authored
Merge pull request #10 from IgniteUI/rstratkov/grid-demos-react-new-azure-pipeline
Add azure pipeline for grid demos react
2 parents f1a3483 + 3ea732b commit c2e2a54

File tree

1 file changed

+163
-0
lines changed

1 file changed

+163
-0
lines changed

wc-grid-examples-react.yml

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
trigger:
2+
branches:
3+
include:
4+
- vnext
5+
- master
6+
7+
# This pipeline is meant to build specific branches for deployment. It's not meant to be a part of PR validation.
8+
pr: none
9+
10+
parameters:
11+
- name: isVerbose
12+
displayName: 'Get verbose output from steps - where configurable'
13+
type: boolean
14+
default: false
15+
- name: shouldCleanPostExecution
16+
displayName: 'Clean all pipeline dirs after the pipeline finishes?'
17+
type: boolean
18+
default: true
19+
20+
21+
name: $(Year:yyyy).$(Month).$(DayOfMonth)-r$(Rev:.r)
22+
23+
stages:
24+
- stage: Build
25+
pool:
26+
vmImage: ubuntu-latest
27+
28+
demands: npm
29+
jobs:
30+
- job: BuildSamples
31+
steps:
32+
- checkout: 'self'
33+
clean: true
34+
35+
- task: NodeTool@0
36+
displayName: 'Install Node'
37+
inputs:
38+
versionSource: 'spec'
39+
versionSpec: '18.x'
40+
41+
- task: Bash@3
42+
displayName: 'Create download artifact per sample (Shell)'
43+
inputs:
44+
targetType: 'inline'
45+
script: |
46+
# Define the root path where projects are located
47+
rootPath="$(Build.SourcesDirectory)/projects"
48+
49+
# Get all first-level subdirectories in the specified root path
50+
subdirectories=$(find "$rootPath" -mindepth 1 -maxdepth 1 -type d)
51+
52+
for subdirectory in $subdirectories; do
53+
# Extract the directory name from the path
54+
dirName=$(basename "$subdirectory")
55+
56+
# Give each sample a version in its package.json file - for traceability
57+
cd "$subdirectory"
58+
echo "Calling npm version command"
59+
npm version $(Build.BuildNumber) --no-git-tag-version
60+
61+
# Check if the directory name is already camel-case
62+
if [[ "$dirName" =~ ^[A-Z]+[a-z]+([A-Z][a-z]*)*$ ]]; then
63+
# If already camel-case, print it as is
64+
echo "$dirName"
65+
else
66+
# Convert to camel-case (capitalize first letters and remove hyphens)
67+
dirName=$(echo "$dirName" | sed -E 's/(^|-)([a-z])/\U\2/g')
68+
69+
fi
70+
71+
echo "Processing directory: $dirName"
72+
73+
# Define the name for the zip file
74+
zipName="$(Build.ArtifactStagingDirectory)/IgniteUI_Grid_Demos_React_${dirName}_Source.zip"
75+
echo "Creating ZIP: $zipName"
76+
77+
# Compress the directory into a ZIP file
78+
(cd "$subdirectory" && zip -r "$zipName" .)
79+
done
80+
81+
echo "All sample projects have been compressed and saved to the artifacts directory."
82+
83+
- task: PublishPipelineArtifact@1
84+
displayName: 'Publish Samples Sources zips'
85+
inputs:
86+
targetPath: '$(Build.ArtifactStagingDirectory)'
87+
artifact: 'samplesSourcesZips'
88+
publishLocation: 'pipeline'
89+
90+
- task: Npm@1
91+
displayName: 'Register licensed npm registry in .npmrc'
92+
inputs:
93+
verbose: ${{ parameters.isVerbose }}
94+
command: 'custom'
95+
workingDir: '$(Build.SourcesDirectory)'
96+
customCommand: 'config -L project set @infragistics:registry=https://packages.infragistics.com/npm/js-licensed/'
97+
customEndpoint: 'public proget'
98+
99+
- task: npmAuthenticate@0
100+
displayName: '[IG Production ProGet] npm authenticate'
101+
inputs:
102+
workingFile: '$(Build.SourcesDirectory)/.npmrc'
103+
customEndpoint: 'public proget'
104+
105+
- task: Npm@1
106+
displayName: 'npm install --legacy-peer-deps'
107+
inputs:
108+
verbose: ${{ parameters.isVerbose }}
109+
command: custom
110+
workingDir: '$(Build.SourcesDirectory)'
111+
customCommand: 'install --legacy-peer-deps'
112+
customEndpoint: 'public proget'
113+
114+
# - task: Npm@1
115+
# displayName: 'Install Ignite UI CLI globally'
116+
# inputs:
117+
# verbose: ${{ parameters.isVerbose }}
118+
# command: custom
119+
# workingDir: '$(Build.SourcesDirectory)'
120+
# customCommand: 'install -g igniteui-cli'
121+
122+
# - task: Bash@3
123+
# displayName: 'Run Ignite UI Upgrade in Root and All Project Subdirectories'
124+
# inputs:
125+
# targetType: 'inline'
126+
# script: |
127+
# echo "Running Ignite UI package upgrade at root level..."
128+
# npx ig upgrade-packages --skip-install
129+
130+
# echo "Running Ignite UI package upgrade in all project subdirectories..."
131+
# for dir in $(Build.SourcesDirectory)/projects/*/; do
132+
# if [ -d "$dir" ]; then
133+
# echo "Processing: $dir"
134+
# (cd "$dir" && npx ig upgrade-packages --skip-install)
135+
# fi
136+
# done
137+
138+
- task: Npm@1
139+
displayName: 'npm install --legacy-peer-deps'
140+
inputs:
141+
verbose: ${{ parameters.isVerbose }}
142+
command: custom
143+
workingDir: '$(Build.SourcesDirectory)'
144+
customCommand: 'install --legacy-peer-deps'
145+
146+
- task: Npm@1
147+
displayName: 'npm run build'
148+
inputs:
149+
verbose: ${{ parameters.isVerbose }}
150+
command: custom
151+
workingDir: '$(Build.SourcesDirectory)'
152+
customCommand: 'run build'
153+
154+
- task: PublishPipelineArtifact@1
155+
displayName: 'Publish app'
156+
inputs:
157+
targetPath: '$(Build.SourcesDirectory)/dist'
158+
artifact: 'dist.grid-demos-react'
159+
publishLocation: 'pipeline'
160+
161+
- ${{ if eq(parameters.shouldCleanPostExecution, true) }}:
162+
- task: PostBuildCleanup@4
163+

0 commit comments

Comments
 (0)