aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-02-01 20:36:24 +0800
committercrupest <crupest@outlook.com>2020-02-01 20:36:24 +0800
commit673fa5f0645308bfa8d17dc4e0e145bbaf239329 (patch)
treeadeab95333f4289f4fcff00187eb933e03633192
parent7b962cd876719fb871569ba3c97fb5545721a3f8 (diff)
downloadtimeline-673fa5f0645308bfa8d17dc4e0e145bbaf239329.tar.gz
timeline-673fa5f0645308bfa8d17dc4e0e145bbaf239329.tar.bz2
timeline-673fa5f0645308bfa8d17dc4e0e145bbaf239329.zip
Update CI.
-rw-r--r--azure-pipelines.yml37
1 files changed, 20 insertions, 17 deletions
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