-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(SW-27127): add docker container for zips (#42)
* ci(SW-27127): add docker container for zips * ci(SW-27127): push branches only on main branch
- Loading branch information
1 parent
52ffe2b
commit 2d05cac
Showing
12 changed files
with
178 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,8 +5,6 @@ on: | |
- cron: | ||
'0 0 * * *' | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
setup-shopware: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ name: Setup older Shopware Version | |
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
|
||
jobs: | ||
setup-shopware: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
on: | ||
workflow_dispatch: | ||
push: | ||
|
||
jobs: | ||
setup-shopware: | ||
name: Setup Shopware | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
versions: | ||
- shopware-zip: 'install_5.6.10_b9471cf7c3f30dfc05d7c959f555c2a8d1c24420' | ||
shopware: '5.6.10' | ||
php: '7.4' | ||
mysql: '5.7' | ||
consentManager: 'none' | ||
|
||
- shopware-zip: 'install_5.4.6_f667f6471a77bb5af0c115f3e243594e6353747e' | ||
shopware: '5.4.5' | ||
php: '7.1' | ||
mysql: '5.7' | ||
consentManager: 'none' | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: current | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ github.token }} | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Create base image | ||
run: make running:shopware_${{ matrix.versions.shopware }}_${{ matrix.versions.mysql }}_${{ matrix.versions.php }} | ||
|
||
- name: Push base image | ||
if: ${{ github.ref == 'refs/heads/main' }} | ||
run: docker push ghcr.io/shopware5/docker-images-testing/running:shopware_${{ matrix.versions.shopware }}_${{ matrix.versions.mysql }}_${{ matrix.versions.php }} | ||
|
||
- name: Create zip Image | ||
run: make zip:shopware_${{ matrix.versions.shopware }}_${{ matrix.versions.shopware-zip }}_${{ matrix.versions.mysql }}_${{ matrix.versions.php }}_${{ matrix.versions.consentManager }} | ||
|
||
- name: Test zip Image | ||
run: make test-zip:shopware_${{ matrix.versions.shopware }}_${{ matrix.versions.shopware-zip }}_${{ matrix.versions.mysql }}_${{ matrix.versions.php }}_${{ matrix.versions.consentManager }} | ||
|
||
- name: Push zip Image | ||
if: ${{ github.ref == 'refs/heads/main' }} | ||
run: docker push ghcr.io/shopware5/docker-images-testing/zip:shopware_${{ matrix.versions.shopware }}_${{ matrix.versions.shopware-zip }}_${{ matrix.versions.mysql }}_${{ matrix.versions.php }}_${{ matrix.versions.consentManager }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
{% set shopwareVersion = imageName|split('_')[1] %} | ||
{% set shopwareUrl = imageName|split('_').slice(2, 5).join('_') %} | ||
{% set mysqlVersion = imageName|split('_')[5] %} | ||
{% set phpVersion = imageName|split('_')[6] %} | ||
{% set consentManagerVersion = imageName|split('_')[7] %} | ||
{% set consentManagerRequired = consentManagerVersion != 'none' %} | ||
|
||
# Check out shopware source | ||
FROM alpine/git:latest AS clone | ||
|
||
RUN wget --header="User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_0) AppleWebKit/600.1.17 (KHTML, like Gecko)a Version/8.0 Safari/600.1.17" https://releases.shopware.com/{{ shopwareUrl }}.zip -O install.zip && unzip install.zip -d /shopware | ||
RUN cd /shopware | ||
|
||
{% if consentManagerRequired %} | ||
RUN cd /shopware/custom/plugins && \ | ||
git clone https://github.com/shopware5/SwagCookieConsentManager.git SwagCookieConsentManager --depth=1 --branch={{ consentManagerVersion }} | ||
{% endif %} | ||
|
||
# Inherit files, install NodeJS-dependencies | ||
FROM node:10 AS js-deps | ||
|
||
COPY --from="clone" /shopware /shopware | ||
|
||
WORKDIR /shopware | ||
|
||
RUN npm install --prefix ./themes && \ | ||
npm install --prefix ./themes/Frontend/Resposnsive && \ | ||
touch .make.install.npm-dependencies | ||
|
||
|
||
FROM ghcr.io/shopware5/docker-images-testing/running:shopware_{{ shopwareVersion }}_{{ mysqlVersion }}_{{ phpVersion }} | ||
|
||
COPY --from="js-deps" /shopware /shopware | ||
COPY start-mysql.sh /shopware/start-mysql.sh | ||
|
||
|
||
WORKDIR /shopware | ||
|
||
ENV COMPOSER_ALLOW_SUPERUSER=1 | ||
ENV DB_USER=root | ||
ENV DB_PORT=3306 | ||
ENV DB_NAME=shopware | ||
ENV DB_HOST=127.0.0.1 | ||
ENV DB_PASSWORD=root | ||
ENV SW_HOST=localhost | ||
ENV SW_BASE_PATH= | ||
|
||
|
||
RUN ./start-mysql.sh \ | ||
&& mysqladmin --user=root password 'root' | ||
|
||
RUN ./start-mysql.sh \ | ||
&& mysql -e "CREATE DATABASE shopware" \ | ||
&& php recovery/install/index.php --db-port=${DB_PORT} --db-user=${DB_USER} --db-password=${DB_PASSWORD} --db-name=${DB_NAME} --shop-name=Demo --shop-host=${SW_HOST} --shop-path=${SW_BASE_PATH} --shop-locale=en_GB --admin-locale=en_GB --shop-currency=EUR --admin-username=demo --admin-password=demo --admin-name=Demo --admin-email=demo@demo.de --no-interaction | ||
|
||
{% if consentManagerRequired %} | ||
RUN ./start-mysql.sh \ | ||
&& php bin/console sw:plugin:refresh \ | ||
&& php bin/console sw:plugin:install SwagCookieConsentManager | ||
{% endif %} | ||
|
||
COPY --chown="root:root" entrypoint.sh /entrypoint.sh | ||
|
||
RUN chown -R www-data:www-data /shopware | ||
|
||
ENTRYPOINT ["bash", "-c", "/entrypoint.sh"] | ||
|
||
{#RUN php bin/console sw:cache:clear#} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ | |
], | ||
|
||
'logger' => [ | ||
'level' => \Shopware\Components\Logger::DEBUG, | ||
'level' => 100, | ||
], | ||
|
||
'front' => [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
server { | ||
listen 80; | ||
|
||
server_name localhost; | ||
root /shopware; | ||
|
||
set $shopware_env 'production'; | ||
set $fpm_upstream 127.0.0.1:9000; | ||
|
||
## Include shopware configuration. | ||
include global/shopware.conf; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -eu | ||
|
||
echo "Starting mysql server" | ||
/usr/bin/mysqld_safe --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql & | ||
|
||
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" | ||
exit | ||
fi | ||
done |