This repository has been archived by the owner on Nov 26, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
.gitlab-ci.yml
85 lines (78 loc) · 3.09 KB
/
.gitlab-ci.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
stages:
- setup
- test
- package
variables:
MYSQL_ROOT_PASSWORD: shopware
MYSQL_ROOT_HOST: '%'
MYSQL_DATABASE: shopware
MYSQL_USER: shopware
MYSQL_PASSWORD: shopware
PLUGIN_NAME: HeidelPayment6
SHOPWARE_VERSION: "v6.2.0" # Tag
cache:
key: "$PLUGIN_NAME-$CI_COMMIT_REF_SLUG"
composer:
stage: setup
image: "edbizarro/gitlab-ci-pipeline-php:7.2"
script:
- composer install --prefer-dist --no-ansi --no-interaction --no-progress --optimize-autoloader
artifacts:
paths:
- vendor/
expire_in: 1 days
when: always
cache:
paths:
- vendor/
phpstan:
stage: test
image: "edbizarro/gitlab-ci-pipeline-php:7.2"
dependencies:
- composer
script:
- git clone -b ${SHOPWARE_VERSION} https://github.com/shopware/development "${CI_PROJECT_DIR}/opt/shopware"
- rm -rf "${CI_PROJECT_DIR}/opt/shopware/platform"
- git clone -b ${SHOPWARE_VERSION} https://github.com/shopware/platform "${CI_PROJECT_DIR}/opt/shopware/platform"
- mv ${CI_PROJECT_DIR}/opt /tmp/opt
- cp -r ${CI_PROJECT_DIR} /tmp/opt/shopware/custom/plugins/${PLUGIN_NAME}
- mv /tmp/opt ${CI_PROJECT_DIR}/opt
- cd ${CI_PROJECT_DIR}/opt/shopware && composer install --no-interaction --optimize-autoloader --no-suggest --no-scripts
- cd ${CI_PROJECT_DIR}/opt/shopware && composer dump-autoload -d custom/plugins/${PLUGIN_NAME}
- cd ${CI_PROJECT_DIR}/opt/shopware/custom/plugins/${PLUGIN_NAME} && vendor/bin/phpstan analyse -c phpstan.neon --autoload-file=${CI_PROJECT_DIR}/opt/shopware/vendor/autoload.php src
codestyle:
stage: test
image: "edbizarro/gitlab-ci-pipeline-php:7.2"
dependencies:
- composer
script:
- vendor/bin/php-cs-fixer fix -v --dry-run
cache:
key: global
paths:
- .php_cs.cache
package:
image: kellerkinder/shopware-package-plugin:latest
stage: package
only:
- tags
- master
- integration*
services:
- mysql:5.7
script:
- mkdir /tmp/opt
- git clone -b ${SHOPWARE_VERSION} --depth 1 https://github.com/shopware/production /tmp/opt/shopware
- cp -r ${CI_PROJECT_DIR} /tmp/opt/shopware/custom/plugins/${CI_PROJECT_NAME}
- cd /tmp/opt/shopware && composer install --no-interaction -o
- cd /tmp/opt/shopware && php bin/console system:setup --database-url=mysql://${MYSQL_USER}:${MYSQL_PASSWORD}@mysql:3306/${MYSQL_DATABASE} --generate-jwt-keys -nq
- cd /tmp/opt/shopware && php bin/console system:install -fnq --create-database
- cd /tmp/opt/shopware && php bin/console plugin:refresh -nq && php bin/console plugin:install --activate -c ${CI_PROJECT_NAME} -nq
- cd /tmp/opt/shopware && bin/build-js.sh
- cd /tmp/opt/shopware && php bin/console theme:compile -nq
- rsync -r /tmp/opt/shopware/custom/plugins/${CI_PROJECT_NAME}/ ${CI_PROJECT_DIR}/
- cd ${CI_PROJECT_DIR} && git add -f .
- package-plugin
artifacts:
paths:
- ${CI_PROJECT_NAME}.zip