-
Notifications
You must be signed in to change notification settings - Fork 0
Add azure pipeline for grid demos react #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,163 @@ | ||
| trigger: | ||
| branches: | ||
| include: | ||
| - vnext | ||
| - master | ||
|
|
||
| # This pipeline is meant to build specific branches for deployment. It's not meant to be a part of PR validation. | ||
| pr: none | ||
|
|
||
| parameters: | ||
| - name: isVerbose | ||
| displayName: 'Get verbose output from steps - where configurable' | ||
| type: boolean | ||
| default: false | ||
| - name: shouldCleanPostExecution | ||
| displayName: 'Clean all pipeline dirs after the pipeline finishes?' | ||
| type: boolean | ||
| default: true | ||
|
|
||
|
|
||
| name: $(Year:yyyy).$(Month).$(DayOfMonth)-r$(Rev:.r) | ||
|
|
||
| stages: | ||
| - stage: Build | ||
| pool: | ||
| vmImage: ubuntu-latest | ||
|
|
||
| demands: npm | ||
| jobs: | ||
| - job: BuildSamples | ||
| steps: | ||
| - checkout: 'self' | ||
| clean: true | ||
|
|
||
| - task: NodeTool@0 | ||
| displayName: 'Install Node' | ||
| inputs: | ||
| versionSource: 'spec' | ||
| versionSpec: '18.x' | ||
|
|
||
| - task: Bash@3 | ||
| displayName: 'Create download artifact per sample (Shell)' | ||
| inputs: | ||
| targetType: 'inline' | ||
| script: | | ||
| # Define the root path where projects are located | ||
| rootPath="$(Build.SourcesDirectory)/projects" | ||
|
|
||
| # Get all first-level subdirectories in the specified root path | ||
| subdirectories=$(find "$rootPath" -mindepth 1 -maxdepth 1 -type d) | ||
|
|
||
| for subdirectory in $subdirectories; do | ||
| # Extract the directory name from the path | ||
| dirName=$(basename "$subdirectory") | ||
|
|
||
| # Give each sample a version in its package.json file - for traceability | ||
| cd "$subdirectory" | ||
| echo "Calling npm version command" | ||
| npm version $(Build.BuildNumber) --no-git-tag-version | ||
|
|
||
| # Check if the directory name is already camel-case | ||
| if [[ "$dirName" =~ ^[A-Z]+[a-z]+([A-Z][a-z]*)*$ ]]; then | ||
| # If already camel-case, print it as is | ||
| echo "$dirName" | ||
| else | ||
| # Convert to camel-case (capitalize first letters and remove hyphens) | ||
| dirName=$(echo "$dirName" | sed -E 's/(^|-)([a-z])/\U\2/g') | ||
|
|
||
| fi | ||
|
|
||
| echo "Processing directory: $dirName" | ||
|
|
||
| # Define the name for the zip file | ||
| zipName="$(Build.ArtifactStagingDirectory)/IgniteUI_Grid_Demos_React_${dirName}_Source.zip" | ||
| echo "Creating ZIP: $zipName" | ||
|
|
||
| # Compress the directory into a ZIP file | ||
| (cd "$subdirectory" && zip -r "$zipName" .) | ||
| done | ||
|
|
||
| echo "All sample projects have been compressed and saved to the artifacts directory." | ||
|
|
||
| - task: PublishPipelineArtifact@1 | ||
| displayName: 'Publish Samples Sources zips' | ||
| inputs: | ||
| targetPath: '$(Build.ArtifactStagingDirectory)' | ||
| artifact: 'samplesSourcesZips' | ||
| publishLocation: 'pipeline' | ||
|
|
||
| - task: Npm@1 | ||
| displayName: 'Register licensed npm registry in .npmrc' | ||
| inputs: | ||
| verbose: ${{ parameters.isVerbose }} | ||
| command: 'custom' | ||
| workingDir: '$(Build.SourcesDirectory)' | ||
| customCommand: 'config -L project set @infragistics:registry=https://packages.infragistics.com/npm/js-licensed/' | ||
| customEndpoint: 'public proget' | ||
|
|
||
| - task: npmAuthenticate@0 | ||
| displayName: '[IG Production ProGet] npm authenticate' | ||
| inputs: | ||
| workingFile: '$(Build.SourcesDirectory)/.npmrc' | ||
| customEndpoint: 'public proget' | ||
|
|
||
| - task: Npm@1 | ||
| displayName: 'npm install --legacy-peer-deps' | ||
| inputs: | ||
| verbose: ${{ parameters.isVerbose }} | ||
| command: custom | ||
| workingDir: '$(Build.SourcesDirectory)' | ||
| customCommand: 'install --legacy-peer-deps' | ||
| customEndpoint: 'public proget' | ||
|
|
||
| # - task: Npm@1 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @rstratkovinfrag , please add a TODO comment as to why this commented-out code is important to be left here and what remains to be done so that we can uncomment it. |
||
| # displayName: 'Install Ignite UI CLI globally' | ||
| # inputs: | ||
| # verbose: ${{ parameters.isVerbose }} | ||
| # command: custom | ||
| # workingDir: '$(Build.SourcesDirectory)' | ||
| # customCommand: 'install -g igniteui-cli' | ||
|
|
||
| # - task: Bash@3 | ||
| # displayName: 'Run Ignite UI Upgrade in Root and All Project Subdirectories' | ||
| # inputs: | ||
| # targetType: 'inline' | ||
| # script: | | ||
| # echo "Running Ignite UI package upgrade at root level..." | ||
| # npx ig upgrade-packages --skip-install | ||
|
|
||
| # echo "Running Ignite UI package upgrade in all project subdirectories..." | ||
| # for dir in $(Build.SourcesDirectory)/projects/*/; do | ||
| # if [ -d "$dir" ]; then | ||
| # echo "Processing: $dir" | ||
| # (cd "$dir" && npx ig upgrade-packages --skip-install) | ||
| # fi | ||
| # done | ||
|
|
||
| - task: Npm@1 | ||
| displayName: 'npm install --legacy-peer-deps' | ||
| inputs: | ||
| verbose: ${{ parameters.isVerbose }} | ||
| command: custom | ||
| workingDir: '$(Build.SourcesDirectory)' | ||
| customCommand: 'install --legacy-peer-deps' | ||
|
|
||
| - task: Npm@1 | ||
| displayName: 'npm run build' | ||
| inputs: | ||
| verbose: ${{ parameters.isVerbose }} | ||
| command: custom | ||
| workingDir: '$(Build.SourcesDirectory)' | ||
| customCommand: 'run build' | ||
|
|
||
| - task: PublishPipelineArtifact@1 | ||
| displayName: 'Publish app' | ||
| inputs: | ||
| targetPath: '$(Build.SourcesDirectory)/dist' | ||
| artifact: 'dist.grid-demos-react' | ||
| publishLocation: 'pipeline' | ||
|
|
||
| - ${{ if eq(parameters.shouldCleanPostExecution, true) }}: | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since we are using Azure-procurred agents, we don't need optional post-execution cleanup. Please remove this step. |
||
| - task: PostBuildCleanup@4 | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we are using Azure-procurred agents, we don't need optional post-execution cleanup. Please remove this variable.