63 lines
2.0 KiB
YAML
63 lines
2.0 KiB
YAML
|
|
Prepare config:
|
||
|
|
|
||
|
|
steps:
|
||
|
|
- task: qetza.replacetokens.replacetokens-task.replacetokens@5
|
||
|
|
displayName: 'Prepare config'
|
||
|
|
inputs:
|
||
|
|
rootDirectory: '$(System.DefaultWorkingDirectory)/_Duina/drop'
|
||
|
|
targetFiles: |
|
||
|
|
Frontend/main*.js
|
||
|
|
WebAPI/appsettings.json
|
||
|
|
WebAPI/client_secrets.json
|
||
|
|
verbosity: detailed
|
||
|
|
actionOnMissing: fail
|
||
|
|
actionOnNoFiles: warn
|
||
|
|
|
||
|
|
|
||
|
|
Create fronternd archive:
|
||
|
|
|
||
|
|
steps:
|
||
|
|
- task: ArchiveFiles@2
|
||
|
|
displayName: 'Create Frontend archive'
|
||
|
|
inputs:
|
||
|
|
rootFolderOrFile: '$(System.DefaultWorkingDirectory)/_Duina/drop/Frontend'
|
||
|
|
archiveFile: '$(System.DefaultWorkingDirectory)/_Duina/drop/zip/DiunaBI-Staging-Frontend.zip'
|
||
|
|
|
||
|
|
Create backend archive:
|
||
|
|
|
||
|
|
steps:
|
||
|
|
- task: ArchiveFiles@2
|
||
|
|
displayName: 'Create Backend archive'
|
||
|
|
inputs:
|
||
|
|
rootFolderOrFile: '$(System.DefaultWorkingDirectory)/_Duina/drop/WebAPI'
|
||
|
|
archiveFile: '$(System.DefaultWorkingDirectory)/_Duina/drop/zip/DiunaBI-Staging-WebAPI.zip'
|
||
|
|
|
||
|
|
Securely copy files to the remote machine:
|
||
|
|
|
||
|
|
steps:
|
||
|
|
- task: ArchiveFiles@2
|
||
|
|
displayName: 'Create Backend archive'
|
||
|
|
inputs:
|
||
|
|
rootFolderOrFile: '$(System.DefaultWorkingDirectory)/_Duina/drop/WebAPI'
|
||
|
|
archiveFile: '$(System.DefaultWorkingDirectory)/_Duina/drop/zip/DiunaBI-Staging-WebAPI.zip'
|
||
|
|
|
||
|
|
Run shell commands on remote machine:
|
||
|
|
|
||
|
|
steps:
|
||
|
|
- task: SSH@0
|
||
|
|
displayName: 'Run shell commands on remote machine'
|
||
|
|
inputs:
|
||
|
|
sshEndpoint: 'crm.bim-it.pl'
|
||
|
|
commands: |
|
||
|
|
rm -rf /srv/diunabi.bim-it.pl/*
|
||
|
|
unzip -o /home/mz/deployment/DiunaBI-Staging-Frontend.zip -d /home/mz/deployment
|
||
|
|
bash /home/mz/deployment/updateSWHash.sh
|
||
|
|
cp -R /home/mz/deployment/Frontend/* /srv/diunabi.bim-it.pl/
|
||
|
|
sudo systemctl stop DiunaBI-WebAPI
|
||
|
|
rm -rf /home/mz/services/DiunaBI-WebAPI/*
|
||
|
|
unzip -o /home/mz/deployment/DiunaBI-Staging-WebAPI.zip -d /home/mz/deployment
|
||
|
|
cp -R /home/mz/deployment/WebAPI/* /home/mz/services/DiunaBI-WebAPI/
|
||
|
|
sudo systemctl start DiunaBI-WebAPI
|
||
|
|
rm -rf /home/mz/deployment/Frontend
|
||
|
|
rm -rf /home/mz/deployment/WebAPI
|