Skip to content

Commit

Permalink
feat(commands): Clean Make Commands
Browse files Browse the repository at this point in the history
* drop lint
* remove unsupported php versions
* test updates with removal of not needed checks
* bump node version for github workflows
  • Loading branch information
mfilip authored and cblanc committed Oct 31, 2023
1 parent 93622e6 commit 09d1ae3
Show file tree
Hide file tree
Showing 28 changed files with 2,940 additions and 6,125 deletions.
29 changes: 0 additions & 29 deletions .github/workflows/ci-73.yml

This file was deleted.

9 changes: 3 additions & 6 deletions .github/workflows/ci-74.yml → .github/workflows/ci-81.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Magento 2.4 CI with PHP 7.4
name: Magento 2.4 CI with PHP 8.1

on:
- push
Expand All @@ -10,13 +10,10 @@ jobs:
- uses: actions/checkout@v1

- name: Launch Magento test environment
run: make up-74

- name: Run install script
run: >-
docker-compose exec -T web bash -c 'dockerize -wait tcp://db:3306 -timeout 60m /usr/local/bin/install-magento'
env:
PHP: "81"
COMPOSE_INTERACTIVE_NO_CLI: "1"
run: make up

- uses: cypress-io/github-action@v2
with:
Expand Down
15 changes: 5 additions & 10 deletions .github/workflows/ci-73-m24.yml → .github/workflows/ci-82.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,24 @@
name: Magento 2.4 CI
name: Magento 2.4.6 CI with PHP 8.2

on:
- push

jobs:
ci:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1

- name: Launch Magento test environment
run: make up-73-m24

- name: Run install script
run: >-
docker-compose exec -T web bash -c 'dockerize -wait tcp://db:3306 -timeout 60m /usr/local/bin/install-magento'
env:
PHP: "82"
COMPOSE_INTERACTIVE_NO_CLI: "1"

- name: Set Base URL
run: make fix-session-expire
run: make up

- uses: cypress-io/github-action@v2
with:
project: ./test/e2e
config: baseUrl=http://localhost:3000
env:
CYPRESS_API_KEY: ${{ secrets.API_KEY }}
CYPRESS_MAGENTO_VERSION: "2.4"
7 changes: 2 additions & 5 deletions .github/workflows/ci-bindings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ on:

jobs:
ci-bindings:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.x]
node-version: [16.x]

steps:
- uses: actions/checkout@v1
Expand All @@ -28,9 +28,6 @@ jobs:
- name: Install
run: npm install

- name: Lint
run: npm run lint

- name: Build
run: npm run build

Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG BASE_IMAGE=idealpostcodes/magento-test:m2.3-php7.2
ARG BASE_IMAGE=idealpostcodes/magento-test:m2.4-php8.1
FROM $BASE_IMAGE

COPY ./docker/install-magento /usr/local/bin/install-magento
COPY docker/install-magento /usr/local/bin/install-magento
RUN chmod u+x /usr/local/bin/install-magento

COPY ./docker/compile-magento /usr/local/bin/compile-magento
Expand Down
61 changes: 17 additions & 44 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,57 +1,27 @@
PHP ?= 81
.DEFAULT_GOAL := help
TAG=${git describe --tags}

## -- Container Launch --

## Bootstrap containers and compile magento internals
.PHONY: bootstrap
bootstrap: up init fix-session-expire

## Bootstrap containers and compile magento internals
.PHONY: bootstrap-74
bootstrap-74: up-74 init-74

## Initialise repository - run install-magento
.PHONY: init
init:
docker-compose exec web dockerize -wait tcp://db:3306 -timeout 60m /usr/local/bin/install-magento

## Initialise repository - run install-magento
.PHONY: init-74
init-74:
docker-compose exec web dockerize -wait tcp://db:3306 -wait tcp://elasticsearch:9200 -timeout 60m /usr/local/bin/install-magento

## Launch docker-compose as background daemon
.PHONY: up
up:
docker-compose up -d
up: build init


.PHONY: build
build:
docker-compose -f docker-compose.yml -f docker/${PHP}.yml up -d

## Shut down docker-compose services
.PHONY: down
down:
docker-compose down
docker-compose -f docker-compose.yml -f docker/${PHP}.yml down

## Shut down docker-compose services
.PHONY: down-74
down-74:
docker-compose -f docker-compose.yml -f docker/74.yml down

## -- CI Test Methods --

## Start up PHP 7.3
.PHONY: up-73
up-73:
docker-compose -f docker-compose.yml -f docker/73.yml up -d

## Start up PHP 7.3 Magento 2.4
.PHONY: up-73-m24
up-73-m24:
docker-compose -f docker-compose.yml -f docker/73.yml up -d

## Start up PHP 7.3 Magento 2.4
.PHONY: up-74
up-74:
docker-compose -f docker-compose.yml -f docker/74.yml up -d
## Initialise repository - run install-magento
.PHONY: init
init:
docker-compose exec -T web dockerize -wait tcp://db:3306 -wait tcp://elasticsearch:9200 -timeout 60m /usr/local/bin/install-magento

## -- Development Methods --

Expand All @@ -70,6 +40,10 @@ static_deploy:
shell:
docker-compose exec web bash

.PHONY: shell-db
shell-db:
docker-compose exec db bash

## Enable magento cache. Should be disabled to load extensions
.PHONY: cache-enable
cache-enable:
Expand All @@ -88,8 +62,7 @@ cache-flush:
## Set base URL as 127.0.0.1 instead of localhost - fixes session expirey issue
.PHONY: set-base-url
set-base-url:
docker-compose exec -T db mysql -u magento -pmagento -D magento -e 'UPDATE `core_config_data` SET `value`="http://127.0.0.1:3000/" WHERE path="web/secure/base_url"'
docker-compose exec -T db mysql -u magento -pmagento -D magento -e 'UPDATE `core_config_data` SET `value`="http://127.0.0.1:3000/" WHERE path="web/unsecure/base_url"'
docker-compose exec -T db mysql -u magento -pmagento -D magento -e 'UPDATE `core_config_data` SET `value`="http://127.0.0.1:3000/" WHERE path="web/secure/base_url"'

## Fix for session expired error in development
.PHONY: fix-session-expire
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3.0'
services:
db:
image: mariadb
image: library/mariadb:10.4-bionic
volumes:
- db-data:/var/lib/mysql/data
env_file:
Expand Down
7 changes: 0 additions & 7 deletions docker/73-m24.yml

This file was deleted.

7 changes: 0 additions & 7 deletions docker/73.yml

This file was deleted.

9 changes: 2 additions & 7 deletions docker/74.yml → docker/81.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
version: "3.0"
services:
db:
image: library/mariadb:10.2-bionic
volumes:
- db-data:/var/lib/mysql/data
env_file:
- ./docker/.env
es:
image: library/elasticsearch:7.0.0
container_name: elasticsearch
Expand All @@ -26,5 +20,6 @@ services:
- es
build:
context: "."
dockerfile: "Dockerfile-es"
args:
BASE_IMAGE: idealpostcodes/magento-test:m2.4-php7.4
BASE_IMAGE: idealpostcodes/magento-test:m2.4-php8.1
25 changes: 25 additions & 0 deletions docker/82.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
version: "3.0"
services:
es:
image: library/elasticsearch:7.0.0
container_name: elasticsearch
ports:
- "9200:9200"
- "9300:9300"
environment:
- bootstrap.memory_lock=true
- discovery.type=single-node
- "ES_JAVA_OPTS=-Xms2g -Xmx2g"
- cluster.routing.allocation.disk.threshold_enabled=false
ulimits:
memlock:
soft: -1
hard: -1
web:
depends_on:
- es
build:
context: "."
dockerfile: "Dockerfile"
args:
BASE_IMAGE: idealpostcodes/magento-test:m2.4.6-php8.2
78 changes: 0 additions & 78 deletions docker/magento23-php72/Dockerfile

This file was deleted.

Loading

0 comments on commit 09d1ae3

Please sign in to comment.