Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

Commit

Permalink
Initial setup.
Browse files Browse the repository at this point in the history
  • Loading branch information
otarza committed Oct 7, 2020
0 parents commit fd7d3dd
Show file tree
Hide file tree
Showing 150 changed files with 20,498 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#
# Copy and rename this file to .env at root of this project.
#

# A common use case is to supply database creds via the environment. Edit settings.php
# like so:
#
# $databases['default']['default'] = [
# 'database' => getenv('MYSQL_DATABASE'),
# 'driver' => 'mysql',
# 'host' => getenv('MYSQL_HOSTNAME'),
# 'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
# 'password' => getenv('MYSQL_PASSWORD'),
# 'port' => getenv('MYSQL_PORT'),
# 'prefix' => '',
# 'username' => getenv('MYSQL_USER'),
# ];
#
# Uncomment and populate as needed.
# MYSQL_DATABASE=
# MYSQL_HOSTNAME=
# MYSQL_PASSWORD=
# MYSQL_PORT=
# MYSQL_USER=

# Another common use case is to set Drush's --uri via environment.
# DRUSH_OPTIONS_URI=http://example.com
26 changes: 26 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Ignore directories generated by Composer
/drush/contrib/
/vendor/
/web/core/
/web/modules/contrib/
/web/themes/contrib/
/web/profiles/contrib/
/web/libraries/

# Ignore sensitive information
/web/sites/*/settings.php
/web/sites/*/settings.local.php

# Ignore Drupal's file directory
/web/sites/*/files/

# Ignore SimpleTest multi-site environment.
/web/sites/simpletest

# Ignore files generated by PhpStorm
/.idea/

# Ignore .env files as they are personal
/.env
/.editorconfig
/.gitattributes
40 changes: 40 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
language: php
dist: trusty
sudo: false

php:
- 7.0
- 7.1
- 7.2
- 7.3

env:
global:
- SIMPLETEST_DB=sqlite://tmp/site.sqlite
- SIMPLETEST_BASE_URL="http://127.0.0.1:8080"
matrix:
- RELEASE=stable COMPOSER_CHANNEL=stable
- RELEASE=dev COMPOSER_CHANNEL=stable
- RELEASE=stable COMPOSER_CHANNEL=snapshot

before_install:
- echo 'sendmail_path = /bin/true' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- phpenv config-rm xdebug.ini
- composer --verbose self-update --$COMPOSER_CHANNEL
- composer --version

install:
- composer --verbose validate
- composer --verbose install

script:
- if [[ $RELEASE = dev ]]; then composer --verbose remove --no-update drupal/console; fi;
- if [[ $RELEASE = dev ]]; then composer --verbose require --no-update drupal/core:8.8.x-dev; composer --verbose require --no-update --dev drupal/core-dev:8.8.x-dev; fi;
- if [[ $RELEASE = dev ]]; then composer --verbose update; fi;
- ./vendor/bin/drush site-install --verbose --yes --db-url=sqlite://tmp/site.sqlite
- ./vendor/bin/drush runserver $SIMPLETEST_BASE_URL &
- until curl -s $SIMPLETEST_BASE_URL; do true; done > /dev/null
# Run a single unit test to verfiy the testing setup.
- ./vendor/bin/phpunit -c ./web/core ./web/core/modules/system/tests/src/Unit/SystemRequirementsTest.php
- ./vendor/bin/drush
- if [[ $RELEASE = stable ]]; then ./vendor/bin/drupal; fi;
339 changes: 339 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

90 changes: 90 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
include .env

default: up

COMPOSER_ROOT ?= /var/www/html
DRUPAL_ROOT ?= /var/www/html/web

## help : Print commands help.
.PHONY: help
ifneq (,$(wildcard docker.mk))
help : docker.mk
@sed -n 's/^##//p' $<
else
help : Makefile
@sed -n 's/^##//p' $<
endif

## up : Start up containers.
.PHONY: up
up:
@echo "Starting up containers for $(PROJECT_NAME)..."
docker-compose pull
docker-compose up -d --remove-orphans

.PHONE: mutagen
mutagen:
docker-compose up -d mutagen
mutagen project start -f mutagen/config.yml

## down : Stop containers.
.PHONY: down
down: stop

## start : Start containers without updating.
.PHONY: start
start:
@echo "Starting containers for $(PROJECT_NAME) from where you left off..."
@docker-compose start

## stop : Stop containers.
.PHONY: stop
stop:
@echo "Stopping containers for $(PROJECT_NAME)..."
@docker-compose stop

## prune : Remove containers and their volumes.
## You can optionally pass an argument with the service name to prune single container
## prune mariadb : Prune `mariadb` container and remove its volumes.
## prune mariadb solr : Prune `mariadb` and `solr` containers and remove their volumes.
.PHONY: prune
prune:
@echo "Removing containers for $(PROJECT_NAME)..."
@docker-compose down -v $(filter-out $@,$(MAKECMDGOALS))

## ps : List running containers.
.PHONY: ps
ps:
@docker ps --filter name='$(PROJECT_NAME)*'

## shell : Access `php` container via shell.
## You can optionally pass an argument with a service name to open a shell on the specified container
.PHONY: shell
shell:
docker exec -ti -e COLUMNS=$(shell tput cols) -e LINES=$(shell tput lines) $(shell docker ps --filter name='$(PROJECT_NAME)_$(or $(filter-out $@,$(MAKECMDGOALS)), 'php')' --format "{{ .ID }}") sh

## composer : Executes `composer` command in a specified `COMPOSER_ROOT` directory (default is `/var/www/html`).
## To use "--flag" arguments include them in quotation marks.
## For example: make composer "update drupal/core --with-dependencies"
.PHONY: composer
composer:
docker exec $(shell docker ps --filter name='^/$(PROJECT_NAME)_php' --format "{{ .ID }}") composer --working-dir=$(COMPOSER_ROOT) $(filter-out $@,$(MAKECMDGOALS))

## drush : Executes `drush` command in a specified `DRUPAL_ROOT` directory (default is `/var/www/html/web`).
## To use "--flag" arguments include them in quotation marks.
## For example: make drush "watchdog:show --type=cron"
.PHONY: drush
drush:
docker exec $(shell docker ps --filter name='^/$(PROJECT_NAME)_php' --format "{{ .ID }}") drush -r $(DRUPAL_ROOT) $(filter-out $@,$(MAKECMDGOALS))

## logs : View containers logs.
## You can optinally pass an argument with the service name to limit logs
## logs php : View `php` container logs.
## logs nginx php : View `nginx` and `php` containers logs.
.PHONY: logs
logs:
@docker-compose logs -f $(filter-out $@,$(MAKECMDGOALS))

# https://stackoverflow.com/a/6273809/1826109
%:
@:
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Drupal instance for BitCamp

## Installation
1. `make up`
1. `docker-compose exec php composer install`
1. `docker-compose exec php drush si --existing-config --account-name="oto"
--account-pass="1234" --account-mail="[email protected]" -y`
81 changes: 81 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
{
"name": "drupal-composer/drupal-project",
"description": "Project template for Drupal 8 projects with composer",
"type": "project",
"license": "GPL-2.0-or-later",
"authors": [
{
"name": "",
"role": ""
}
],
"repositories": [
{
"type": "composer",
"url": "https://packages.drupal.org/8"
}
],
"require": {
"php": ">=7.0.8",
"composer/installers": "^1.2",
"cweagans/composer-patches": "^1.6.5",
"drupal/admin_toolbar": "^2.4",
"drupal/console": "^1.0.2",
"drupal/core": "^8.8.0",
"drupal/core-composer-scaffold": "^8.8.0",
"drush/drush": "^9.7.1 | ^10.0.0",
"vlucas/phpdotenv": "^4.0",
"webflo/drupal-finder": "^1.0.0",
"zaporylie/composer-drupal-optimizations": "^1.0"
},
"require-dev": {
"drupal/core-dev": "^8.8.0"
},
"conflict": {
"drupal/drupal": "*"
},
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"sort-packages": true
},
"autoload": {
"classmap": [
"scripts/composer/ScriptHandler.php"
],
"files": ["load.environment.php"]
},
"scripts": {
"pre-install-cmd": [
"DrupalProject\\composer\\ScriptHandler::checkComposerVersion"
],
"pre-update-cmd": [
"DrupalProject\\composer\\ScriptHandler::checkComposerVersion"
],
"post-install-cmd": [
"DrupalProject\\composer\\ScriptHandler::createRequiredFiles"
],
"post-update-cmd": [
"DrupalProject\\composer\\ScriptHandler::createRequiredFiles"
]
},
"extra": {
"composer-exit-on-patch-failure": true,
"patchLevel": {
"drupal/core": "-p2"
},
"drupal-scaffold": {
"locations": {
"web-root": "web/"
}
},
"installer-paths": {
"web/core": ["type:drupal-core"],
"web/libraries/{$name}": ["type:drupal-library"],
"web/modules/contrib/{$name}": ["type:drupal-module"],
"web/profiles/contrib/{$name}": ["type:drupal-profile"],
"web/themes/contrib/{$name}": ["type:drupal-theme"],
"drush/Commands/contrib/{$name}": ["type:drupal-drush"]
}
}
}
Loading

0 comments on commit fd7d3dd

Please sign in to comment.