Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
163 changes: 163 additions & 0 deletions wc-grid-examples-react.yml
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?'

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.

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

Choose a reason for hiding this comment

The 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.
This is crucial to the not-yet-complete implementation of the pipeline.

# 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) }}:

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 step.

- task: PostBuildCleanup@4