-
Notifications
You must be signed in to change notification settings - Fork 25
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
Set up CI with Azure Pipelines #3577
Open
ChronosSF
wants to merge
10
commits into
master
Choose a base branch
from
azure-pipelines
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
f9e6616
Set up CI with Azure Pipelines
ChronosSF ce5a6b6
fix(ci): fixing issue with pipe trigger
ChronosSF dfa6d2f
fix(ci): modifying ci/cd
ChronosSF 3b8875b
fix(ci): fixing issue with work dir param
ChronosSF 235c813
fix(ci): trying another way to setup path
ChronosSF 6409269
fix(ci): resolving validation issue
ChronosSF 37dc231
fix(ci): replacing tasks that doesn't work on ubuntu
ChronosSF a607fcc
fix(ci): moving code to pws script
ChronosSF 1bb8780
fix(ci): try to fix licensing
ChronosSF d73f804
fix(ci): check the process env
ChronosSF File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
trigger: | ||
branches: | ||
include: | ||
- master | ||
- vnext | ||
|
||
# This pipeline is meant to build specific branches for deployment. It's not meant to be a part of PR validation. Ensure that this pipeline is reserved for deployment purposes. | ||
pr: none | ||
|
||
name: $(BuildDefinitionName)_$(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r) | ||
|
||
variables: | ||
githubToken: <value> # Add a GitHub token in Libraries | ||
ReplacementText: '@infragistics/igniteui-angular-extras' | ||
|
||
jobs: | ||
- job: CommonSteps | ||
displayName: Common Steps for All Jobs | ||
pool: | ||
vmImage: ubuntu-latest | ||
steps: | ||
- checkout: self | ||
clean: true | ||
fetchTags: true | ||
|
||
- task: NodeTool@0 | ||
displayName: Use Node 20.x | ||
inputs: | ||
versionSpec: 20.x | ||
|
||
- task: PowerShell@2 | ||
displayName: 'Replace with licensed angular-extras' | ||
inputs: | ||
targetType: 'inline' | ||
script: | | ||
# List of files to update | ||
$files = @( | ||
"projects/app-lob/src/app/grid-dynamic-chart-data/grid-dynamic-chart-data.module.ts", | ||
"projects/app-lob/src/app/grid-dynamic-chart-data/grid-dynamic-chart-data.component.ts", | ||
"projects/app-lob/src/app/app.module.ts", | ||
"package.json") | ||
foreach ($file in $files) { | ||
(Get-Content -Path $file) -replace 'igniteui-angular-extras', '$(ReplacementText)' | Set-Content -Path $file | ||
} | ||
|
||
- task: Npm@1 | ||
displayName: 'Register licensed npm registry in .npmrc' | ||
inputs: | ||
command: 'custom' | ||
workingDir: '$(Build.SourcesDirectory)' | ||
customCommand: 'config -L project set @infragistics:registry=https://packages.infragistics.com/npm/js-licensed/' | ||
customEndpoint: 'public proget' | ||
|
||
- task: Npm@1 | ||
displayName: npm install | ||
inputs: | ||
command: install | ||
workingDir: $(Build.SourcesDirectory) | ||
verbose: false | ||
customEndpoint: 'public proget' | ||
|
||
- task: CmdLine@2 | ||
displayName: Clone submodule | ||
inputs: | ||
script: git clone --recurse-submodules https://github.com/IgniteUI/igniteui-live-editing-samples igniteui-live-editing-samples | ||
workingDirectory: $(Build.SourcesDirectory) | ||
|
||
- task: PublishPipelineArtifact@1 | ||
inputs: | ||
targetPath: '$(Build.SourcesDirectory)' | ||
artifact: 'source-code' | ||
publishLocation: 'pipeline' | ||
|
||
- job: Job_1 | ||
displayName: App CD Build | ||
dependsOn: CommonSteps | ||
pool: | ||
vmImage: ubuntu-latest | ||
steps: | ||
- download: current | ||
artifact: source-code | ||
- template: templates/cd-template.yml | ||
parameters: | ||
customCommand: run generate-live-editing | ||
workingDir: $(Build.SourcesDirectory) | ||
submoduleDir: angular-demos | ||
baseHref: /angular-demos/ | ||
targetFolder: dist/app-lob | ||
findRegex: angular-demos | ||
npmBuildCommand: 'run build-ci' | ||
|
||
- job: Job_2 | ||
displayName: App CRM Build | ||
dependsOn: CommonSteps | ||
pool: | ||
vmImage: ubuntu-latest | ||
steps: | ||
- download: current | ||
artifact: source-code | ||
- template: templates/cd-template.yml | ||
parameters: | ||
customCommand: run generate-live-editing:app-crm | ||
workingDir: $(Build.SourcesDirectory) | ||
submoduleDir: angular-demos-crm | ||
baseHref: /angular-demos-grid-crm/ | ||
targetFolder: dist/app-crm | ||
findRegex: angular-demos | ||
npmBuildCommand: 'run build-ci:app-crm --loglevel verbose' | ||
|
||
- job: Job_3 | ||
displayName: App LOB Build | ||
dependsOn: CommonSteps | ||
pool: | ||
vmImage: ubuntu-latest | ||
steps: | ||
- download: current | ||
artifact: source-code | ||
- template: templates/cd-template.yml | ||
parameters: | ||
customCommand: run generate-live-editing:app-lob | ||
workingDir: $(Build.SourcesDirectory) | ||
submoduleDir: angular-demos-lob | ||
baseHref: /angular-demos-lob/ | ||
targetFolder: dist/app-lob | ||
findRegex: angular-demos | ||
npmBuildCommand: 'run build-ci:app-lob' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
# template.yml | ||
parameters: | ||
- name: customCommand | ||
type: string | ||
- name: workingDir | ||
type: string | ||
- name: submoduleDir | ||
type: string | ||
- name: baseHref | ||
type: string | ||
- name: targetFolder | ||
type: string | ||
default: 'dist' | ||
- name: findRegex | ||
type: string | ||
- name: npmBuildCommand | ||
type: string | ||
default: '' | ||
- name: runCleanup | ||
type: boolean | ||
default: true | ||
|
||
steps: | ||
# - task: CmdLine@2 | ||
# displayName: Clone submodule | ||
# inputs: | ||
# script: git clone --recurse-submodules https://github.com/IgniteUI/igniteui-live-editing-samples igniteui-live-editing-samples | ||
# workingDirectory: ${{ parameters.workingDir }} | ||
|
||
- task: CmdLine@2 | ||
displayName: Staging - Git checkout branch | ||
condition: eq(variables['Build.SourceBranchName'], 'vNext') | ||
inputs: | ||
script: git checkout vNext | ||
workingDirectory: ${{ parameters.workingDir }}/igniteui-live-editing-samples | ||
|
||
- task: CmdLine@2 | ||
displayName: Production - Git checkout branch | ||
condition: and(eq(variables['Build.SourceBranchName'], 'master'), contains(variables['build.reason'], 'CI')) | ||
inputs: | ||
script: git checkout master | ||
workingDirectory: ${{ parameters.workingDir }}/igniteui-live-editing-samples | ||
|
||
- script: | | ||
sed -i 's/--configuration production/--base-href=${{ parameters.baseHref }} --configuration production/g' package.json | ||
displayName: 'Update package.json file' | ||
workingDirectory: ${{ parameters.workingDir }} | ||
|
||
- task: Npm@1 | ||
displayName: generate live-editing | ||
inputs: | ||
command: custom | ||
workingDir: ${{ parameters.workingDir }} | ||
verbose: false | ||
customCommand: ${{ parameters.customCommand }} | ||
|
||
- task: CmdLine@2 | ||
displayName: Update to licensed igniteui-angular | ||
inputs: | ||
script: npx ng g @igniteui/angular-schematics:upgrade-packages --skip-install | ||
workingDirectory: ${{ parameters.workingDir }} | ||
|
||
- task: Npm@1 | ||
displayName: ${{ parameters.npmBuildCommand }} | ||
inputs: | ||
command: custom | ||
workingDir: ${{ parameters.workingDir }} | ||
verbose: false | ||
customCommand: ${{ parameters.npmBuildCommand }} | ||
|
||
- task: CopyFiles@2 | ||
displayName: Copy web.config | ||
inputs: | ||
SourceFolder: $(Build.SourcesDirectory) | ||
Contents: web.config | ||
TargetFolder: $(Build.SourcesDirectory)/${{ parameters.targetFolder }} | ||
|
||
- task: RegexReplace@3 | ||
displayName: RegEx Find & Replace | ||
inputs: | ||
InputSearchPattern: $(Build.SourcesDirectory)/${{ parameters.targetFolder }}/web.config | ||
FindRegex: ${{ parameters.findRegex }} | ||
ReplaceRegex: ${{ parameters.submoduleDir }} | ||
UseUTF8: false | ||
|
||
- task: PublishPipelineArtifact@1 | ||
displayName: Publish Artifact | ||
inputs: | ||
targetPath: $(Build.SourcesDirectory)/${{ parameters.targetFolder }} | ||
artifact: $(Build.SourceBranchName)-artifact | ||
publishLocation: pipeline | ||
|
||
- task: Npm@1 | ||
displayName: Staging - Repositorify Angular Demos and LOB Demos | ||
condition: eq(variables['Build.SourceBranchName'], 'vNext') | ||
inputs: | ||
command: custom | ||
workingDir: ${{ parameters.workingDir }} | ||
verbose: false | ||
customCommand: run repositoryfyAngularDemosLob | ||
|
||
- task: Npm@1 | ||
displayName: Production - Repositorify Angular Demos | ||
condition: and(eq(variables['Build.SourceBranchName'], 'master'), contains(variables['build.reason'], 'CI')) | ||
inputs: | ||
command: custom | ||
workingDir: ${{ parameters.workingDir }} | ||
verbose: false | ||
customCommand: run repositoryfyAngularDemosLob:prod | ||
|
||
- task: CmdLine@2 | ||
displayName: Stage changes | ||
inputs: | ||
script: git add . | ||
workingDirectory: ${{ parameters.workingDir }}/igniteui-live-editing-samples/${{ parameters.submoduleDir }} | ||
|
||
- task: CmdLine@2 | ||
displayName: 'Check if there are any changes to be committed' | ||
inputs: | ||
script: | | ||
# Check for changes | ||
changeCount=$(git status --porcelain | wc -l) | ||
if [ "$changeCount" -eq 0 ]; then | ||
echo "##vso[task.logissue type=warning]No changes to commit." | ||
exit 0 | ||
fi | ||
workingDirectory: ${{ parameters.workingDir }}/igniteui-live-editing-samples/${{ parameters.submoduleDir }} | ||
|
||
|
||
- task: CmdLine@2 | ||
displayName: Commit changes | ||
inputs: | ||
script: git commit -m "Automated repository update" | ||
workingDirectory: ${{ parameters.workingDir }}/igniteui-live-editing-samples/${{ parameters.submoduleDir }} | ||
|
||
- task: CmdLine@2 | ||
displayName: Push changes | ||
inputs: | ||
script: git push | ||
workingDirectory: ${{ parameters.workingDir }}/igniteui-live-editing-samples/${{ parameters.submoduleDir }} | ||
|
||
- task: PostBuildCleanup@4 | ||
displayName: Clean Agent Directories | ||
condition: eq('${{ parameters.runCleanup }}', 'true') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check failure
Code scanning / CodeQL
Clear-text logging of sensitive information High
Copilot Autofix AI 8 days ago
To fix the problem, we should avoid logging the entire
process.env
object. Instead, we can log only non-sensitive information or avoid logging environment variables altogether. In this case, we will remove the logging ofprocess.env
to ensure no sensitive information is exposed.process.env
.