From 1c880744293c9f47ff1241109b72c035680251df Mon Sep 17 00:00:00 2001 From: crupest Date: Sat, 1 Feb 2020 20:36:24 +0800 Subject: Update CI. --- azure-pipelines.yml | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) (limited to 'azure-pipelines.yml') diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7e6cac68..a99fa595 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -63,23 +63,26 @@ stages: - publish: Timeline/publish artifact: timeline - - deployment: deploy + - job: deploy displayName: Deploy to Server - environment: - name: timeline-server - resourceType: VirtualMachine - tags: linux + pool: + vmImage: 'ubuntu-18.04' + variables: + - group: sshkey dependsOn: build - strategy: - runOnce: - deploy: - steps: - - download: current - artifact: timeline + + steps: + - download: current + artifact: timeline + + - task: InstallSSHKey@0 + inputs: + knownHostsEntry: $(knownHostsEntry) + sshPublicKey: $(sshPublicKey) + sshKeySecureFile: c4553c6f-a7f5-4778-b07c-763e71dd867a - - script: | - rm -rf /var/timeline/* - cp -r $PIPELINE_WORKSPACE/timeline/. /var/timeline/ - sudo systemctl restart timeline.service - displayName: 'Copy Files and Restart Service' - failOnStderr: true + - script: | + ssh timeline@crupest.xyz 'rm -rf /var/timeline/*' + scp -r $PIPELINE_WORKSPACE/timeline/* timeline@crupest.xyz:/var/timeline/ + ssh timeline@crupest.xyz 'sudo systemctl restart timeline.service' + displayName: 'Copy Files and Restart Service' \ No newline at end of file -- cgit v1.2.3