Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Magepack #138

Merged
merged 10 commits into from
Jun 20, 2020
22 changes: 22 additions & 0 deletions .github/workflows/docker-image-magepack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Docker Image Magepack
on:
schedule:
- cron: "0 6 * * 1" # 6 AM UTC on Monday
push:
paths:
- version
- images/.trigger
- images/magepack/**
branches:
- develop
jobs:
magepack:
name: Magepack
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- run: ./images/scripts/build.sh --push "${BUILD_GROUP}"
env:
BUILD_GROUP: magepack
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
1 change: 1 addition & 0 deletions commands/env-init.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ if [[ "${WARDEN_ENV_TYPE}" == "magento2" ]]; then
WARDEN_SPLIT_SALES=0
WARDEN_SPLIT_CHECKOUT=0
WARDEN_TEST_DB=0
WARDEN_MAGEPACK=0

BLACKFIRE_CLIENT_ID=
BLACKFIRE_CLIENT_TOKEN=
Expand Down
3 changes: 3 additions & 0 deletions commands/env.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ fi
[[ ${WARDEN_SELENIUM} -eq 1 ]] \
&& appendEnvPartialIfExists "selenium"

[[ ${WARDEN_MAGEPACK} -eq 1 ]] \
&& appendEnvPartialIfExists "${WARDEN_ENV_TYPE}.magepack"

if [[ -f "${WARDEN_ENV_PATH}/.warden/warden-env.yml" ]]; then
DOCKER_COMPOSE_ARGS+=("-f")
DOCKER_COMPOSE_ARGS+=("${WARDEN_ENV_PATH}/.warden/warden-env.yml")
Expand Down
13 changes: 13 additions & 0 deletions environments/magento2/magento2.magepack.base.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: "3.5"
services:
magepack:
hostname: "${WARDEN_ENV_NAME}-magepack"
image: docker.io/wardenenv/magepack:${MAGEPACK_VERSION:-2.3}
environment:
- TRAEFIK_DOMAIN
- TRAEFIK_SUBDOMAIN
extra_hosts:
- ${TRAEFIK_DOMAIN}:${TRAEFIK_ADDRESS:-0.0.0.0}
- ${TRAEFIK_SUBDOMAIN:-app}.${TRAEFIK_DOMAIN}:${TRAEFIK_ADDRESS:-0.0.0.0}
depends_on:
- php-fpm
8 changes: 8 additions & 0 deletions environments/magento2/magento2.magepack.darwin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: "3.5"

x-volumes: &volumes
- .${WARDEN_WEB_ROOT:-}/pub/media:/var/www/html/pub/media:delegated
- appdata:/var/www/html

services:
magepack: { volumes: *volumes }
7 changes: 7 additions & 0 deletions environments/magento2/magento2.magepack.linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: "3.5"

x-volumes: &volumes
- .${WARDEN_WEB_ROOT:-}/:/var/www/html

services:
magepack: { volumes: *volumes }
13 changes: 13 additions & 0 deletions images/magepack/2.3/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM zenika/alpine-chrome:with-puppeteer

USER root

WORKDIR /var/www/html
COPY generate.sh /usr/bin/generate
COPY bundle.sh /usr/bin/bundle

RUN npm install -g magepack@^2.3 && npm cache clean --force

CMD tail -f /dev/null

USER chrome
3 changes: 3 additions & 0 deletions images/magepack/context/bundle.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

/usr/bin/magepack bundle
3 changes: 3 additions & 0 deletions images/magepack/context/generate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

/usr/bin/magepack generate "$@"