Skip to content

Commit

Permalink
Updated scaffold files.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexSkrypnyk committed Oct 15, 2023
1 parent 0d9ddb4 commit 7cc4840
Show file tree
Hide file tree
Showing 16 changed files with 209 additions and 111 deletions.
32 changes: 17 additions & 15 deletions .ahoy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ commands:
cmd: |
ahoy clean
(docker network prune -f > /dev/null && docker network inspect amazeeio-network > /dev/null || docker network create amazeeio-network)
ahoy up -- --build --force-recreate
docker cp -L . "$(docker-compose ps -q cli)":/app/ || true
ahoy up -- --build --force-recreate
docker cp -L . "$(docker compose ps -q cli)":/app/ || true
ahoy install-site
ahoy info 1
Expand All @@ -21,7 +21,7 @@ commands:
echo " Site local URL : " $(ahoy cli echo \$LOCALDEV_URL)
echo " Path to project : " $(ahoy cli echo /app)
echo " Path to web root : " $(ahoy cli echo /app/build/web)
echo " DB port on host : " $(docker port $(docker-compose ps -q mariadb) 3306 | cut -d : -f 2)
echo " DB port on host : " $(docker port $(docker compose ps -q mariadb) 3306 | cut -d : -f 2)
echo " Xdebug : " $(ahoy cli php -v|grep -q Xdebug && echo "Enabled" || echo "Disabled")
if [ -n "$1" ]; then
echo " One-time login : " $(ahoy login -- --no-browser)
Expand All @@ -31,7 +31,7 @@ commands:
usage: Open DB in Sequel Ace.
cmd: |
uname -a | grep -i -q darwin && mdfind -name 'Sequel Ace'|grep -q "Ace" \
&& HOST_DB_PORT="$(docker port $(docker-compose ps -q mariadb 2>/dev/null) 3306 2>/dev/null | cut -d : -f 2)" \
&& HOST_DB_PORT="$(docker port $(docker compose ps -q mariadb 2>/dev/null) 3306 2>/dev/null | cut -d : -f 2)" \
&& open "mysql://drupal:[email protected]:${HOST_DB_PORT}/drupal" -a "Sequel Ace" \
|| echo "Not a supported OS or Sequel Ace is not installed."
Expand All @@ -41,43 +41,43 @@ commands:

up:
usage: Build and start Docker containers.
cmd: docker-compose up -d "$@" && if docker-compose logs | grep -q "\[Error\]"; then exit 1; fi
cmd: docker compose up -d "$@" && if docker compose logs | grep -q "\[Error\]"; then exit 1; fi

down:
usage: Stop Docker containers and remove container, images, volumes and networks.
cmd: if [ -f "docker-compose.yml" ]; then docker-compose down --volumes > /dev/null 2>&1; fi
cmd: if [ -f "docker-compose.yml" ]; then docker compose down --volumes > /dev/null 2>&1; fi

start:
usage: Start existing Docker containers.
cmd: docker-compose start "$@"
cmd: docker compose start "$@"

stop:
usage: Stop running Docker containers.
cmd: docker-compose stop "$@"
cmd: docker compose stop "$@"

restart:
usage: Restart all stopped and running Docker containers.
cmd: docker-compose restart
cmd: docker compose restart

logs:
usage: Show Docker logs.
cmd: docker-compose logs "$@"
cmd: docker compose logs "$@"

pull:
usage: Pull latest docker images.
cmd: if [ ! -z "$(docker image ls -q)" ]; then docker image ls --format \"{{.Repository}}:{{.Tag}}\" | grep uselagoon/ | grep -v none | xargs -n1 docker pull | cat; fi

cli:
usage: Start a shell inside CLI container or run a command.
cmd: if \[ "${#}" -ne 0 \]; then docker-compose exec -e DRUPAL_VERSION=${DRUPAL_VERSION:-10} -T cli bash -c "$*"; else docker-compose exec cli bash; fi
cmd: if \[ "${#}" -ne 0 \]; then docker compose exec -e DRUPAL_VERSION=${DRUPAL_VERSION:-10} -T cli bash -c "$*"; else docker compose exec cli bash; fi

composer:
usage: Run Composer commands in the CLI service container.
cmd: docker-compose exec -T cli composer "$@"
cmd: docker compose exec -T cli composer "$@"

drush:
usage: Run Drush commands in the CLI service container.
cmd: docker-compose exec -T cli bash -c "drush -r /app/build/web -l \${LOCALDEV_URL} $*"
cmd: docker compose exec -T cli bash -c "drush -r /app/build/web -l \${LOCALDEV_URL} $*"

# ----------------------------------------------------------------------------
# Application commands.
Expand All @@ -94,7 +94,7 @@ commands:
clean:
usage: Remove containers and all build files.
cmd: |
ahoy down
ahoy down || true
sleep 5
chmod -Rf 777 build 2>&1 > /dev/null || true
rm -rf \
Expand All @@ -110,7 +110,9 @@ commands:
lint:
usage: Lint code.
cmd: |
ahoy cli "cd /app/build && ./vendor/bin/phpcs --standard=../phpcs.xml" \
ahoy cli "cp -Rf phpcs.xml phpstan.neon build > /dev/null" \
&& ahoy cli "cd /app/build && ./vendor/bin/phpcs" \
&& ahoy cli "cd /app/build && ./vendor/bin/phpstan" \
&& ahoy cli "cd /app/build && ./vendor/bin/drupal-check --drupal-root=web ../src && cd .." \
&& ahoy cli "cd /app/build && ./vendor/bin/rector process ../src --dry-run && cd .."
Expand Down
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ aliases:
- &container_config
working_directory: /app
docker:
- image: drevops/ci-builder
- image: drevops/ci-runner:23.10.0
environment:
DRUPAL_VERSION: 10

Expand All @@ -30,7 +30,7 @@ aliases:
command: |
ahoy cli "mkdir -p /app/screenshots"
mkdir -p /tmp/artifacts/behat
docker cp "$(docker-compose ps -q cli)":/app/screenshots /tmp/artifacts/behat
docker cp "$(docker compose ps -q cli)":/app/screenshots /tmp/artifacts/behat
when: always
- store_test_results:
path: /tmp/test_results
Expand All @@ -45,7 +45,7 @@ jobs:
build_d9:
<<: *build
docker:
- image: drevops/ci-builder
- image: drevops/ci-runner:23.10.0
environment:
DRUPAL_VERSION: 9

Expand Down
19 changes: 17 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
# This is the top-most .editorconfig file; do not search in parent directories.
root = true

# All files.
[*]
end_of_line = LF
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.php]
indent_size = 2

[*.js]
indent_size = 2

[composer.{json,lock}]
[*.{json,lock}]
indent_size = 4

[*.{yml,yaml}]
Expand All @@ -10,5 +25,5 @@ indent_size = 2
[*.{sh,bash,bats}]
indent_size = 2

[*.{xml}]
[*.xml]
indent_size = 4
25 changes: 14 additions & 11 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
# Ignore files for distribution archives.
.circleci export-ignore
.ahoy.yml export-ignore
.editorconfig export-ignore
.env export-ignore
.gitattributes export-ignore
.gitignore export-ignore
behat.yml export-ignore
default.docker-compose.override.yml export-ignore
docker-compose.yml export-ignore
phpcs.xml export-ignore
tests export-ignore
/.circleci export-ignore
/.ahoy.yml export-ignore
/.editorconfig export-ignore
/.env export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/behat.yml export-ignore
/default.docker-compose.override.yml export-ignore
/docker-compose.yml export-ignore
/phpcs.xml export-ignore
/phpmd.xml export-ignore
/phpstan.neon export-ignore
/phpunit.xml export-ignore
/tests export-ignore
6 changes: 3 additions & 3 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name-template: '$RESOLVED_VERSION'
tag-template: '$RESOLVED_VERSION'
name-template: '$NEXT_MINOR_VERSION'
tag-template: '$NEXT_MINOR_VERSION'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
template: |
## What's new since $PREVIOUS_TAG
$CHANGES
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...$RESOLVED_VERSION
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...$NEXT_MINOR_VERSION
$CONTRIBUTORS
6 changes: 4 additions & 2 deletions .github/workflows/auto-assign-pr-author.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ name: 'Auto Author Assign'

on:
pull_request_target:
types: [opened, reopened]
types:
- opened
- reopened

permissions:
pull-requests: write
Expand All @@ -11,4 +13,4 @@ jobs:
assign-author:
runs-on: ubuntu-latest
steps:
- uses: toshimaru/auto-author-assign@v1.4.0
- uses: toshimaru/auto-author-assign@v2.0.1
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
name: Release Drafter
name: Release

on:
push:
tags:
- '*'
branches:
- main
pull_request:
types: [opened, reopened, synchronize]

permissions:
contents: read
contents: write

jobs:
update_release_draft:
release-drafter:
permissions:
contents: write
pull-requests: write
Expand Down
17 changes: 12 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
vendor
# To ignore OS temporary files use global .gitignore
# https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files#configuring-ignored-files-for-all-repositories-on-your-computer

/.coverage-html
/.phpunit.cache
/build
/cobertura.xml
/composer.lock
build
screenshots
docker-compose.override.yml
todo.txt
/docker-compose.override.yml
/screenshots
/vendor
/vendor-bin
/todo.txt
Loading

0 comments on commit 7cc4840

Please sign in to comment.