Skip to content

Commit

Permalink
Merge branch 'automate'
Browse files Browse the repository at this point in the history
  • Loading branch information
netzkollektiv committed May 5, 2023
2 parents 8db062b + db0dd25 commit d8d39e1
Show file tree
Hide file tree
Showing 7 changed files with 126 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ jobs:
id: build-release
run: |
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
chmod +x ./bin/release.sh
./bin/release.sh
chmod +x ./bin/release
./bin/release
echo "build $(ls dist/* | head -1)"
echo "::set-output name=filepath::$(ls dist/* | head -1)"
echo "::set-output name=filename::$(basename `ls dist/* | head -1`)"
Expand Down
63 changes: 63 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Test

on:
push:
branches:
- 'main'
- 'automate'

jobs:
ci-current:
runs-on: ubuntu-latest
strategy:
max-parallel: 15
fail-fast: false
matrix:
include:
- shopware-version: 'v5.7.17'
php-version: 8.2

name: Shopware ${{ matrix.shopware-version }} @ ${{ matrix.php-version }}

container:
image: netzkollektivgmbh/docker-shopware:php-${{ matrix.php-version }}
env:
PLUGIN_DIR: /opt/shopware/engine/Shopware/Plugins/Local/Frontend/NetzkollektivEasyCredit
SW_DIR: /opt/shopware

steps:
- name: Checkout
uses: actions/checkout@master
- name: Debug
run: |
php -v
php -m
composer -V
env
- name: Initialize
run: |
ls -lia $GITHUB_WORKSPACE/bin
chmod +x $GITHUB_WORKSPACE/bin/*
$GITHUB_WORKSPACE/bin/init-mysql
$GITHUB_WORKSPACE/bin/setup-shopware
cd $SW_DIR
- name: Link plugin with shopware installation and install composer deps
run: |
composer config --working-dir=$GITHUB_WORKSPACE --no-plugins allow-plugins.phpstan/extension-installer true
composer update --working-dir=$GITHUB_WORKSPACE -n
cp -r $GITHUB_WORKSPACE/src/Frontend/NetzkollektivEasyCredit $PLUGIN_DIR
- name: Install & activate Plugin
run: |
cd $SW_DIR
$GITHUB_WORKSPACE/bin/setup-plugin
php bin/console sw:generate:attributes
php bin/console orm:generate:proxies
- name: Deactivate & uninstall Plugin
run: |
cd $SW_DIR
php bin/console sw:plugin:deactivate NetzkollektivEasyCredit
php bin/console sw:plugin:uninstall NetzkollektivEasyCredit
php bin/console sw:cache:clear
23 changes: 23 additions & 0 deletions bin/init-mysql
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env bash

set -eu

apt-get -y update && apt-get -y install mariadb-server

echo "Starting mysql server"
/usr/bin/mysqld_safe --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql >> /dev/null 2>&1 &

while true; do
sleep 1

exit_code=0
mysql -e ";" 2> /dev/null || exit_code=$?
if [ "${exit_code}" -eq "0" ]; then
echo "Started mysql server"

echo "creating mysql user & database"
mysql -e "CREATE DATABASE shopware"
mysqladmin --user=root password 'root'
exit
fi
done
File renamed without changes.
11 changes: 11 additions & 0 deletions bin/setup-plugin
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

set -eu

ln -s $GITHUB_WORKSPACE $PLUGIN_DIR
ls -lia $PLUGIN_DIR

php bin/console sw:plugin:refresh
php bin/console sw:plugin:list
php bin/console sw:plugin:install NetzkollektivEasyCredit
php bin/console sw:plugin:activate NetzkollektivEasyCredit
24 changes: 24 additions & 0 deletions bin/setup-shopware
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env bash

set -eu

git clone --depth=1 -b v5.7.17 https://github.com/shopware/shopware.git /opt/shopware
cd /opt/shopware

echo "
DB_USER=root
DB_PASSWORD=root
DB_HOST=127.0.0.1
DB_NAME=shopware
DB_PORT=3306
SW_HOST=localhost
SW_BASE_PATH=
SELENIUM_HOST=selenium
ELASTICSEARCH_HOST=elasticsearch
" > .env
make init

echo 'donwloading demo-data ...'
php bin/console sw:store:download SwagDemoDataDE
echo 'installing demo data ...'
php bin/console sw:plugin:install --activate SwagDemoDataDE
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ parameters:
- vendor
- ../../../../../../vendor
- ../../../../../../engine
- ../../../../../../var/cache/production_202211020949/doctrine
- ../../../../../../var/cache/production_202211020949/proxies
- ../../../../../../var/cache/production___REVISION__/doctrine
- ../../../../../../var/cache/production___REVISION__/proxies
symfony:
constant_hassers: false
container_xml_path: ../../../../../../var/cache/production_202211020949/container.xml
container_xml_path: ../../../../../../var/cache/production___REVISION__/container.xml
doctrine:
queryBuilderClass: Shopware\Components\Model\QueryBuilder
repositoryClass: Shopware\Components\Model\ModelRepository
Expand Down

0 comments on commit d8d39e1

Please sign in to comment.