-
Notifications
You must be signed in to change notification settings - Fork 36
/
.gitpod.yml
77 lines (77 loc) · 3.64 KB
/
.gitpod.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
image:
file: .gitpod.Dockerfile
ports:
- port: 1000-9999
onOpen: ignore
- port: 8002
visibility: public
onOpen: open-preview
name: Magento - Nginx
description: Magento Application
- port: 15672
visibility: public
name: RabbitMQ
description: RabbitMQ Webinterface
onOpen: ignore
- port: 8025
visibility: private
name: Mailpit
description: Mailpit Webinterface
onOpen: ignore
- port: 49152
visibility: private
name: TabNine-vscode
description: TabNine.tabnine-vscode
onOpen: ignore
- port: 9200
visibility: private
name: ElasticSearch
description: ElasticSearch Server
onOpen: ignore
vscode:
extensions:
tasks:
- init: >
sudo composer self-update &&
cd $GITPOD_REPO_ROOT &&
composer config -g -a http-basic.repo.magento.com ${MAGENTO_COMPOSER_AUTH_USER} ${MAGENTO_COMPOSER_AUTH_PASS} &&
composer create-project --no-interaction --no-progress --repository-url=https://repo.magento.com/ magento/project-community-edition=${MAGENTO_VERSION} magento2 &&
cd magento2 && cp -avr .* $GITPOD_REPO_ROOT;
cd $GITPOD_REPO_ROOT && rm -r -f magento2 && git checkout -- .gitignore;
if [[ $MAGENTO_INSTALL_MAGE_CACHE_CLEANER == YES ]]; then composer require --dev mage2tv/magento-cache-clean; fi;
npm install cypress --save-dev;
mkdir -p .github/workflows && cp $GITPOD_REPO_ROOT/gitpod/end-2-end-test.yml .github/workflows/end-2-end-test.yml
command: gp ports await 3306 &&
cd $GITPOD_REPO_ROOT &&
test ! -f $GITPOD_REPO_ROOT/gitpod/db-installed.flag && $GITPOD_REPO_ROOT/gitpod/m2-install.sh ;
url=$(gp url | awk -F"//" {'print $2'}) && url="https://8002-"$url"/" &&
php bin/magento config:set web/unsecure/base_url $url &&
php bin/magento config:set web/unsecure/base_link_url $url &&
php bin/magento config:set web/secure/base_url $url &&
gp sync-done mage-ready
- name: "Supervisor Services"
command: cd $GITPOD_REPO_ROOT &&
test ! -f $GITPOD_REPO_ROOT/gitpod/db-installed.flag && sudo mv /var/lib/mysql $GITPOD_REPO_ROOT/ ;
sudo sed -i 's#$GITPOD_REPO_ROOT#'$GITPOD_REPO_ROOT'#g' /etc/supervisor/conf.d/sp-php-fpm.conf &&
sudo sed -i 's#$PHP_VERSION#'$PHP_VERSION'#g' /etc/supervisor/conf.d/sp-php-fpm.conf &&
sudo cp $GITPOD_REPO_ROOT/gitpod/sp-redis.conf /etc/supervisor/conf.d/redis.conf &&
sudo sed -i 's#$ELASTICSEARCH_VERSION#'$ELASTICSEARCH_VERSION'#g' $GITPOD_REPO_ROOT/gitpod/sp-elasticsearch.conf &&
sudo cp $GITPOD_REPO_ROOT/gitpod/sp-elasticsearch.conf /etc/supervisor/conf.d/elasticsearch.conf &&
sudo sed -i 's/^\(\[supervisord\]\)$/\1\nnodaemon=true/' /etc/supervisor/supervisord.conf &&
sed -i 's#/var/lib/mysql#'$GITPOD_REPO_ROOT'/mysql#g' /etc/mysql/conf.d/mysqld.cnf &&
sudo sed -i 's#/var/lib/mysql#'$GITPOD_REPO_ROOT'/mysql#g' /etc/supervisor/conf.d/mysql.conf &&
docker run -d --restart unless-stopped --name=mailpit -p 8025:8025 -p 1025:1025 axllent/mailpit ;
sudo /etc/init.d/supervisor start
- name: "Nginx"
command: gp ports await 3306 &&
sudo sed -i 's#$GITPOD_REPO_ROOT#'$GITPOD_REPO_ROOT'#g' /etc/nginx/nginx.conf &&
service nginx start
- name: "Mage Cache Cleaner"
init: gp sync-await mage-ready
command: if grep -q mage2tv/magento-cache-clean $GITPOD_REPO_ROOT/composer.json; then
vendor/bin/cache-clean.js --watch;
else
exit;
fi;