2
2
parameters :
3
3
- name : customCommand
4
4
type : string
5
+ - name : gitHubToken
6
+ type : string
5
7
- name : workingDir
6
8
type : string
7
9
- name : submoduleDir
@@ -22,6 +24,9 @@ parameters:
22
24
- name : repositoryfy
23
25
type : boolean
24
26
default : false
27
+ - name : repositoryfyCommand
28
+ type : string
29
+ default : ' '
25
30
26
31
steps :
27
32
# - task: CmdLine@2
@@ -121,6 +126,11 @@ steps:
121
126
displayName: 'Update web.config file'
122
127
workingDirectory: ${{ parameters.workingDir }}
123
128
129
+ - script : |
130
+ mv "$(Build.SourcesDirectory)/${{ parameters.targetFolder }}/browser/index.csr.html" "$(Build.SourcesDirectory)/${{ parameters.targetFolder }}/browser/index.html"
131
+ echo "File renamed successfully."
132
+ displayName: Rename index.csr.html to index.html
133
+
124
134
- script : |
125
135
sourcePath="$(Build.SourcesDirectory)/${{ parameters.targetFolder }}/browser"
126
136
destinationZip="$(Build.ArtifactStagingDirectory)/output.zip"
@@ -137,32 +147,32 @@ steps:
137
147
138
148
- task : Npm@1
139
149
displayName : Staging - Repositorify Angular Demos and LOB Demos
140
- condition : and(eq(variables['Build.SourceBranchName'], 'vNext'), eq(variables[' repositoryfy'] , 'true'))
150
+ condition : and(eq(variables['Build.SourceBranchName'], 'vNext'), eq(${{ parameters. repositoryfy }} , 'true'))
141
151
inputs :
142
152
command : custom
143
153
workingDir : ${{ parameters.workingDir }}
144
154
verbose : false
145
- customCommand : run repositoryfyAngularDemosLob
155
+ customCommand : run ${{ parameters.repositoryfyCommand }}
146
156
147
157
- task : Npm@1
148
158
displayName : Production - Repositorify Angular Demos
149
- condition : and(eq(variables['Build.SourceBranchName'], 'master'), contains(variables['build.reason'], 'CI'), eq(variables[' repositoryfy'] , 'true'))
159
+ condition : and(eq(variables['Build.SourceBranchName'], 'master'), contains(variables['build.reason'], 'CI'), eq(${{ parameters. repositoryfy }} , 'true'))
150
160
inputs :
151
161
command : custom
152
162
workingDir : ${{ parameters.workingDir }}
153
163
verbose : false
154
- customCommand : run repositoryfyAngularDemosLob :prod
164
+ customCommand : run ${{ parameters.repositoryfyCommand }} :prod
155
165
156
166
- task : CmdLine@2
157
167
displayName : Stage changes
158
- condition : eq(variables[' repositoryfy'] , 'true')
168
+ condition : eq(${{ parameters. repositoryfy }} , 'true')
159
169
inputs :
160
170
script : git add .
161
171
workingDirectory : ${{ parameters.workingDir }}/igniteui-live-editing-samples/${{ parameters.submoduleDir }}
162
172
163
173
- task : CmdLine@2
164
174
displayName : ' Check if there are any changes to be committed'
165
- condition : eq(variables[' repositoryfy'] , 'true')
175
+ condition : eq(${{ parameters. repositoryfy }} , 'true')
166
176
inputs :
167
177
script : |
168
178
# Check for changes
@@ -171,24 +181,26 @@ steps:
171
181
echo "##vso[task.logissue type=warning]No changes to commit."
172
182
exit 0
173
183
else
174
- echo "##vso[task.setvariable variable=changesDetected;isOutput=true ]true"
184
+ echo "##vso[task.setvariable variable=changesDetected;]true"
175
185
fi
176
186
workingDirectory : ${{ parameters.workingDir }}/igniteui-live-editing-samples/${{ parameters.submoduleDir }}
177
187
178
- - task : CmdLine@2
188
+ - script : |
189
+ git config --global user.name "tfsbuild"
190
+ git config --global user.email "[email protected] "
191
+ git config --global credential.helper store
192
+ echo "https://x-access-token:$(GITHUB_TOKEN)@github.com" > ~/.git-credentials
193
+ git commit -m "Automated repository update"
179
194
displayName: Commit changes
180
- condition : and(eq(variables['changesDetected'], 'true'), eq(variables['repositoryfy'], 'true'))
181
- inputs :
182
- script : |
183
- git config user.name "tfsbuild"
184
- git config user.email "[email protected] "
185
- git add .
186
- git commit -m "Automated repository update"
187
- workingDirectory : ${{ parameters.workingDir }}/igniteui-live-editing-samples/${{ parameters.submoduleDir }}
195
+ condition: and(eq(variables['changesDetected'], true), eq(${{ parameters.repositoryfy }}, 'true'))
196
+ env:
197
+ GITHUB_TOKEN: ${{ parameters.gitHubToken }}
198
+ workingDirectory: ${{ parameters.workingDir }}/igniteui-live-editing-samples/${{ parameters.submoduleDir }}
188
199
189
200
- task : CmdLine@2
190
201
displayName : Push changes
191
- condition : and(eq(variables['changesDetected'], ' true' ), eq(variables[' repositoryfy'] , 'true'))
202
+ condition : and(eq(variables['changesDetected'], true), eq(${{ parameters. repositoryfy }} , 'true'))
192
203
inputs :
193
204
script : git push
194
205
workingDirectory : ${{ parameters.workingDir }}/igniteui-live-editing-samples/${{ parameters.submoduleDir }}
206
+ continueOnError : true
0 commit comments