-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathazure-pipelines.yml
64 lines (61 loc) · 1.92 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
# 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: 7.4
scriptDir: $(Build.Repository.LocalPath)/vendor/mikemadison13/blt-azure-pipelines/scripts/azure
steps:
- task: InstallSSHKey@0
inputs:
knownHostsEntry: $(host)
sshPublicKey: $(public)
sshKeySecureFile: 'private'
- checkout: self
persistCredentials: true
- task: Bash@3
displayName: 'Setup 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: NodeTool@0
displayName: 'Install Node JS'
inputs:
versionSpec: '12.x'
- task: Bash@3
displayName: 'Install Dependencies'
inputs:
targetType: 'inline'
script: |
composer validate --no-check-all --ansi
composer install
npm install npm@latest -g
- task: Bash@3
displayName: 'Validate'
inputs:
filePath: '$(scriptDir)/validate.sh'
- 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: 'Run Tests'
inputs:
filePath: '$(scriptDir)/test.sh'
- task: Bash@3
displayName: 'Deploy'
condition: and(succeeded(), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI'))
inputs:
filePath: '$(scriptDir)/deploy_artifact.sh'