-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
67 lines (64 loc) · 2.28 KB
/
azure-pipelines.yml
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# PHP
# Test and package your PHP project.
# Add steps that run tests, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/php
pool:
vmImage: 'ubuntu-latest'
variables:
phpVersion: 8.2
scriptDir: ./scripts
steps:
- task: InstallSSHKey@0
displayName: 'Install SSH Key for GitHub'
inputs:
knownHostsEntry: $(github_known_hosts)
sshPublicKey: $(github_public_key)
sshKeySecureFile: 'github_secret_key'
- task: InstallSSHKey@0
displayName: 'Install SSH Key for Acquia Cloud'
inputs:
knownHostsEntry: $(acquia_known_hosts)
sshPublicKey: $(acquia_public_key)
sshKeySecureFile: 'acquia_secret_key'
- task: Bash@3
displayName: 'Set PHP and MySQL'
inputs:
targetType: 'inline'
script: |
sudo update-alternatives --set php /usr/bin/php$(phpVersion)
sudo update-alternatives --set phar /usr/bin/phar$(phpVersion)
sudo update-alternatives --set phpdbg /usr/bin/phpdbg$(phpVersion)
sudo update-alternatives --set php-cgi /usr/bin/php-cgi$(phpVersion)
sudo update-alternatives --set phar.phar /usr/bin/phar.phar$(phpVersion)
sudo service mysql start
- task: Bash@3
displayName: 'Install Dependencies'
inputs:
targetType: 'inline'
script: |
composer clearcache
sudo composer self-update --2
composer validate --no-check-all --ansi
composer install
- task: Bash@3
displayName: 'Setup Environment'
inputs:
filePath: '$(scriptDir)/setup_env.sh'
- task: Bash@3
displayName: 'Setup App'
inputs:
filePath: '$(scriptDir)/setup_app.sh'
- task: Bash@3
displayName: 'Setup Acquia CLI'
inputs:
filePath: '$(scriptDir)/setup_acli.sh $(acli_api_key) $(acli_api_secret) $(acquia_application)'
- task: Bash@3
displayName: 'Deploy Branch'
condition: and(succeeded(), in(variables['Build.Reason'], 'IndividualCI', 'Schedule', 'BatchedCI'))
inputs:
filePath: '$(scriptDir)/deploy_branch.sh'
- task: Bash@3
displayName: 'Deploy Tag'
condition: and(succeeded(), in(variables['Build.Reason'], 'IndividualCI', 'Schedule', 'BatchedCI'), contains(variables['build.sourceBranch'], 'refs/tags/'))
inputs:
filePath: '$(scriptDir)/deploy_tag.sh'