1. Azure VM 에 대한 빌드 구성
[DevOps CI] - azure-pipelines.yml
- 빌드 파이프라인에서는 nuxt build 시 생성되는 client와 server 리소스를 각각 분리하여 Artifact에 저장
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
| - task: CopyFiles@2 inputs: Contents: '.nuxt/dist/client/**' TargetFolder: '$(Build.ArtifactStagingDirectory)' CleanTargetFolder: true displayName: 'Copy Files to: $(Build.ArtifactStagingDirectory)'
- task: ArchiveFiles@2 inputs: rootFolderOrFile: '$(Build.ArtifactStagingDirectory)/.nuxt/dist' includeRootFolder: false archiveFile: '$(Build.ArtifactStagingDirectory)/$(clientName).zip' replaceExistingArchive: true displayName: 'Archive Files'
- task: PublishBuildArtifacts@1 inputs: pathToPublish: '$(Build.ArtifactStagingDirectory)/$(clientName).zip' displayName: 'Publish Artifact: drop'
- task: CopyFiles@2 inputs: Contents: | .nuxt/dist/server/** server-middleware/** static/** node_modules/** nuxt.config.ts package.json TargetFolder: '$(Build.ArtifactStagingDirectory)' CleanTargetFolder: true displayName: 'Copy Files to: $(Build.ArtifactStagingDirectory)'
- task: ArchiveFiles@2 inputs: rootFolderOrFile: '$(Build.ArtifactStagingDirectory)' includeRootFolder: false archiveFile: '$(Build.ArtifactStagingDirectory)/$(serverName).zip' replaceExistingArchive: true displayName: 'Archive Files'
- task: PublishBuildArtifacts@1 inputs: pathToPublish: '$(Build.ArtifactStagingDirectory)/$(serverName).zip' displayName: 'Publish Artifact: drop'
|
- 배포 파이프라인에서 client 리소스는 blob storage로 Azure Copy하고, server 리소스는 Azure Web App으로 배포하여 서비스 가능.
[DevOps CD]