2020-02-08 04:14:56 +00:00
|
|
|
# Node.js with Angular
|
|
|
|
# Build a Node.js project that uses Angular.
|
|
|
|
# Add steps that analyze code, save build artifacts, deploy, and more:
|
|
|
|
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript
|
|
|
|
|
|
|
|
trigger:
|
|
|
|
- master
|
|
|
|
|
|
|
|
pool:
|
|
|
|
vmImage: 'ubuntu-latest'
|
|
|
|
|
|
|
|
steps:
|
2020-02-08 06:11:02 +00:00
|
|
|
- task: NodeTool@0
|
|
|
|
inputs:
|
|
|
|
versionSpec: '12.x'
|
|
|
|
displayName: 'Install Node.js'
|
|
|
|
|
|
|
|
- script: |
|
|
|
|
npm install -g @ionic/cli
|
2020-02-08 09:59:26 +00:00
|
|
|
npm update
|
2020-02-08 06:11:02 +00:00
|
|
|
npm install
|
|
|
|
ionic build --prod
|
|
|
|
displayName: 'npm install and build'
|
2020-02-08 04:14:56 +00:00
|
|
|
|
2020-02-08 06:08:08 +00:00
|
|
|
- task: CmdLine@2
|
2020-02-08 05:32:22 +00:00
|
|
|
inputs:
|
2020-02-08 06:08:08 +00:00
|
|
|
script: |
|
|
|
|
echo $(Build.Repository.LocalPath)
|
2020-02-08 06:09:13 +00:00
|
|
|
ls -la $(Build.Repository.LocalPath)
|
2020-02-08 06:08:08 +00:00
|
|
|
|
2020-02-08 06:11:02 +00:00
|
|
|
# # Archive files
|
|
|
|
- task: ArchiveFiles@2
|
|
|
|
inputs:
|
|
|
|
rootFolderOrFile: '$(Build.Repository.LocalPath)/www'
|
|
|
|
includeRootFolder: true
|
|
|
|
archiveType: 'tar'
|
|
|
|
archiveFile: '$(Build.ArtifactStagingDirectory)/target-www.tar.gz'
|
|
|
|
replaceExistingArchive: true
|
|
|
|
verbose: true
|
|
|
|
|
|
|
|
- task: PublishPipelineArtifact@1
|
|
|
|
inputs:
|
2020-02-08 06:29:05 +00:00
|
|
|
# targetPath: '$(Pipeline.Workspace)'
|
|
|
|
targetPath: '$(Build.ArtifactStagingDirectory)/target-www.tar.gz'
|
2020-02-08 06:11:02 +00:00
|
|
|
artifact: 'FrontEnd'
|
2020-02-08 19:55:03 +00:00
|
|
|
publishLocation: 'pipeline'
|
|
|
|
|
|
|
|
- task: CopyFilesOverSSH@0
|
|
|
|
displayName: 'Securely copy files to the remote machine'
|
|
|
|
inputs:
|
|
|
|
sshEndpoint: GoogleServer
|
2020-02-08 19:59:33 +00:00
|
|
|
sourceFolder: '$(Build.ArtifactStagingDirectory)'
|
2020-02-08 20:00:01 +00:00
|
|
|
targetFolder: /var/lib/app/pipeline/
|
2020-02-08 19:55:03 +00:00
|
|
|
failOnEmptySource: true
|
2020-02-08 20:09:50 +00:00
|
|
|
|
|
|
|
- task: SSH@0
|
|
|
|
displayName: 'Run shell commands on remote machine'
|
|
|
|
inputs:
|
|
|
|
sshEndpoint: GoogleServer
|
|
|
|
commands: '/var/lib/app/pipeline/frontend-deploy.sh'
|