I created a simple project of Angular with Angular Universal for Server Side Rendering and I am trying to publish it as an Azure App Service in Azure through Azure DevOpds pipelines.
This is my YAML of the pipeline I created :
pool:
name: Azure Pipelines
steps:
- task: NodeTool@0
displayName: 'Use Node 12.x'
inputs:
versionSpec: 12.x
- task: Npm@1
displayName: 'Angular CLI'
inputs:
command: custom
workingDir: MySSRSite
verbose: false
customCommand: 'install @angular/cli@10.2.0'
- task: Npm@1
displayName: 'npm install'
inputs:
workingDir: MySSRSite
verbose: false
- task: Npm@1
displayName: Build
inputs:
command: custom
workingDir: MySSRSite
verbose: false
customCommand: 'run build:ssr'
- task: CopyFiles@2
displayName: 'Copy Files to: MySSRSite/dist/MySSRSite'
inputs:
SourceFolder: MySSRSite/dist/MySSRSite/server
TargetFolder: MySSRSite/dist/MySSRSite
- task: DeleteFiles@1
displayName: 'Delete files from MySSRSite/dist/MySSRSite/server'
inputs:
SourceFolder: MySSRSite/dist/MySSRSite/server
Contents: '**'
RemoveSourceFolder: true
- task: ArchiveFiles@2
displayName: 'Archive MySSRSite/dist/MySSRSite/browser'
inputs:
rootFolderOrFile: MySSRSite/dist/MySSRSite/browser
- task: ArchiveFiles@2
displayName: 'Archive MySSRSite/dist/MySSRSite/main.js'
inputs:
rootFolderOrFile: MySSRSite/dist/MySSRSite/main.js
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: drop'
I have connected this pipeline with a Release in Azure DevOps that when the pipeline runs succesfully it automaticaly runs the Release
So these are the settings.
Everything works fine but when I am going to check what is uploaded this is what I get :
And this is what is uplaoded to the Azure App Service :
Is the problem located in the pipeline or in the release ?
EDIT
I have tried to change the pipeline to this :
pool:
name: Azure Pipelines
steps:
- task: NodeTool@0
displayName: 'Use Node 12.x'
inputs:
versionSpec: 12.x
- task: Npm@1
displayName: 'Angular CLI'
inputs:
command: custom
workingDir: MySSRSite
verbose: false
customCommand: 'install @angular/cli@10.2.0'
- task: Npm@1
displayName: 'npm install'
inputs:
workingDir: MySSRSite
verbose: false
- task: Npm@1
displayName: Build
inputs:
command: custom
workingDir: MySSRSite
verbose: false
customCommand: 'run build:ssr'
- task: CopyFiles@2
displayName: 'Copy Files to: MySSRSite/dist/MySSRSite'
inputs:
SourceFolder: MySSRSite/dist/MySSRSite/server
TargetFolder: MySSRSite/dist/MySSRSite
- task: DeleteFiles@1
displayName: 'Delete files from MySSRSite/dist/MySSRSite/server'
inputs:
SourceFolder: MySSRSite/dist/MySSRSite/server
Contents: '**'
RemoveSourceFolder: true
- task: ArchiveFiles@2
displayName: 'Archive MySSRSite/dist/MySSRSite/browser'
inputs:
rootFolderOrFile: MySSRSite/dist/MySSRSite/browser
archiveFile: '_MySSRSite-CI/drop/deploy.zip'
- task: ArchiveFiles@2
displayName: 'Archive MySSRSite/dist/MySSRSite'
inputs:
rootFolderOrFile: MySSRSite/dist/MySSRSite/main.js
archiveFile: '_MySSRSite-CI/drop/deploy1.zip'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: drop'
inputs:
PathtoPublish: '_MySSRSite-CI/drop'
But still nothing. With this change it just uploads the 2 zip files deploy.zip & deploy1.zip to the Azure App Service.
So there are 2 questions:
What am I supposed to upload to Azure App Service ?
Is the pipeline format right ?