-
Notifications
You must be signed in to change notification settings - Fork 3
/
azure-pipelines.yaml
94 lines (88 loc) · 2.93 KB
/
azure-pipelines.yaml
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
trigger:
- main
- develop
parameters:
- name: validateOnPhpVersion
type: string
default: 8.2
- name: ShouldBuildReleasePackage
type: boolean
default: false
- name: ShouldDeployApplication
type: boolean
default: false
variables:
extensionName: NetsCheckout
publishDir: ./bin
pool:
vmImage: ubuntu-latest
resources:
repositories:
- repository: Infra
type: git
name: ECOM-EASY-PLUGINS/connect
ref: refs/heads/main
stages:
- stage: Validate
displayName: Validate
jobs:
- job: Validate_Code
steps:
- template: /pipelines/steps/install-php.yaml@Infra
parameters:
phpVersion: ${{ parameters.validateOnPhpVersion }}
- script: |
find ./src -type f -name '*.php' ! -path './src/vendor/*' -print0 \
| xargs -0 -n 1 php -l | (! grep -Ev '^No syntax errors detected in ')
displayName: 'PHP Syntax Checker (lint)'
- stage: Build_Release_Package
displayName: Build_Release_Package
condition: |
and(
succeeded(),
or(
in(variables['Build.SourceBranch'], 'refs/heads/main'),
and(${{ parameters.ShouldBuildReleasePackage }}, eq(variables['Build.Reason'], 'Manual'))
)
)
jobs:
- job: Build_Release_Package
steps:
- checkout: self
- script: |
curl -1sLf 'https://dl.cloudsmith.io/public/friendsofshopware/stable/setup.deb.sh' | sudo -E bash
sudo apt-get -o DPkg::Lock::Timeout=60 install shopware-cli
sudo apt-get -o DPkg::Lock::Timeout=60 install jq -y
displayName: 'Install dependencies'
- script: |
mkdir $(publishDir)
displayName: 'Create publish dir'
- task: UseNode@1
inputs:
version: '20.11'
displayName: 'Install Node.js 20'
- script: |
sed -i "s/{{ version }}/~6.6.1/g" .shopware-extension.yml
shopware-cli extension zip --disable-git . --release
mv $(extensionName).zip $(publishDir)/$(extensionName).zip
displayName: 'Build extension 6.6'
- script: |
shopware-cli extension validate $(publishDir)/$(extensionName).zip
displayName: 'Validate extension 6.6'
- publish: $(publishDir)
artifact: $(extensionName)
- stage: Deploy_Development # This stage success will trigger deployment of CD-Services-Shopware6
displayName: Deploy_Development
condition: |
and(
succeeded(),
or(
in(variables['Build.SourceBranch'], 'refs/heads/development'),
and(${{ parameters.ShouldDeployApplication }}, eq(variables['Build.Reason'], 'Manual'))
)
)
jobs:
- job: Trigger_Deploy_Development
steps:
- checkout: none
- bash: echo "CD-Services-Shopware6 runs after this completes"