-
Notifications
You must be signed in to change notification settings - Fork 18
Lando #109
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
base: master
Are you sure you want to change the base?
Lando #109
Changes from all commits
080fbc9
6f05cbe
8e81776
17e91a0
de3a595
1d4ed9c
7f2cdf1
406a45a
02b46fa
8e7f2fb
a8114f7
ff5b720
6a89eb8
2a12140
4c90fe1
37bafd8
0354e2e
b10425b
a6fe26c
37902c9
12d9beb
81c6949
19b1fae
ba972b2
de3fb76
35cee91
70ff7ca
9413c42
aaadd55
99941bf
237db6c
f7d595a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,10 +13,10 @@ | |
| # | ||
| # * TERMINUS_MACHINE_TOKEN | ||
| # | ||
| # It also depends on the following environment variables declared in docker/drupal.env: | ||
| # It also depends on the following environment variables declared in .env/drupal.env: | ||
| # | ||
| # * TERMINUS_SITE | ||
| # * TERMINUS_SOURCE_ENVIRONMENT | ||
| # * TERMINUS_ENV | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a compelling reason to rename this variable? If not, I'd prefer to leave it as |
||
| # | ||
| version: 2.1 | ||
|
|
||
|
|
@@ -81,10 +81,10 @@ jobs: | |
| - run: | ||
| name: Prepare Environment | ||
| command: | | ||
| echo "source /var/www/code/docker/drupal.env" >> $BASH_ENV && source /var/www/code/docker/drupal.env | ||
| echo "source /var/www/code/.env/drupal.env" >> $BASH_ENV && source /var/www/code/.env/drupal.env | ||
| mkdir /tmp/junit /tmp/artifacts web/sites/simpletest web/sites/default/files && chown www-data:www-data /tmp/junit web/sites/default/files web/sites/simpletest | ||
| terminus auth:login --machine-token="$TERMINUS_MACHINE_TOKEN" | ||
| terminus backup:info "$TERMINUS_SITE.$TERMINUS_SOURCE_ENVIRONMENT" --element=db --field=file > /tmp/db-cache-indicator | ||
| terminus backup:info "$TERMINUS_SITE.$TERMINUS_ENV" --element=db --field=file > /tmp/db-cache-indicator | ||
| # Run linting steps up front. If these fail, they should provide fast feedback. | ||
| - run: {name: 'ESLint', command: 'node_modules/.bin/eslint -f junit . > /tmp/junit/eslint.xml'} | ||
| - run: {name: 'PHPCS', command: 'vendor/bin/phpcs --report-junit=/tmp/junit/phpcs.xml --report-summary'} | ||
|
|
@@ -98,22 +98,22 @@ jobs: | |
| - run: {name: 'Nightcrawler', command: 'node_modules/.bin/nightcrawler crawl --json /tmp/artifacts/results.json --junit /tmp/junit/crawler.xml'} | ||
| # Run PHPUnit as www-data to support BrowserTestBase installing the site. | ||
| - run: {name: 'Run PHPUnit', command: 'su -s /bin/bash www-data -c "vendor/bin/phpunit --log-junit=/tmp/junit/phpunit.xml"'} | ||
| - run: {name: 'Run Behat', command: 'vendor/bin/behat -f junit -o /tmp/junit'} | ||
| - run: {name: 'Run Behat', command: 'vendor/bin/behat --profile=ci -f junit -o /tmp/junit'} | ||
| - store_test_results: { path: '/tmp/junit' } | ||
| - store_artifacts: {path: '/tmp/artifacts'} | ||
|
|
||
| deploy: | ||
| executor: php | ||
| steps: | ||
| - attach_workspace: {at: /var/www} | ||
| - run: {name: 'Source environment variables', command: 'echo "source /var/www/code/docker/drupal.env" >> $BASH_ENV'} | ||
| - run: {name: 'Source environment variables', command: 'echo "source /var/www/code/.env/drupal.env" >> $BASH_ENV'} | ||
| - run: {name: 'Terminus Login', command: 'terminus auth:login --machine-token="$TERMINUS_MACHINE_TOKEN"'} | ||
| - run: {name: 'Export git variables', command: 'terminus connection:info --fields=git_host,git_port,git_url --format=json "$TERMINUS_SITE.dev" | bin/json-to-bash >> $BASH_ENV'} | ||
| - run: {name: 'Trust host key', command: 'ssh-keyscan -p $GIT_PORT $GIT_HOST >> /etc/ssh/ssh_known_hosts'} | ||
| - run: {name: 'Set git committer', command: 'git config --global user.email "$GIT_AUTHOR_EMAIL" && git config --global user.name "$GIT_AUTHOR_NAME"'} | ||
| - run: {name: 'Lean Composer install', command: 'composer install --no-dev -o -n'} | ||
| - run: {name: 'Push Artifact', command: 'node_modules/.bin/artifactsh -a $GIT_URL -b $CIRCLE_BRANCH'} | ||
| - run: {name: 'Ensure multidev', command: 'test $CIRCLE_BRANCH == "master" || bin/create-artifact-environment-pantheon -b $CIRCLE_BRANCH -s $TERMINUS_SOURCE_ENVIRONMENT'} | ||
| - run: {name: 'Ensure multidev', command: 'test $CIRCLE_BRANCH == "master" || bin/create-artifact-environment-pantheon -b $CIRCLE_BRANCH -s $TERMINUS_ENV'} | ||
| - run: {name: 'Prune multidev environments', command: 'bin/prune-artifact-environments-pantheon -p "p-*"'} | ||
| - run: {name: 'Prune branches', command: 'bin/prune-artifact-branches -a $GIT_URL -p "p-*"'} | ||
| workflows: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| # This file contains environment variables for sensitive information that | ||
| # should not be committed to the repository. | ||
|
|
||
| # This default file is included in the repository as a guideline for things | ||
| # that may be useful to pass into the application services. | ||
|
|
||
| # Machine token from Pantheon that allows terminus commands to be executed | ||
| # from within the appserver service. | ||
| TERMINUS_MACHINE_TOKEN=abcdefghijklmnopqrstuvwxyz1234567890 | ||
|
|
||
| # Blackfire client and server ids. Required for Blackfire profiling. Obtain | ||
| # these by creating an account at blackfire.io and visiting | ||
| # https://blackfire.io/my/settings/credentials | ||
| BLACKFIRE_CLIENT_ID=abcdefghijklmnopqrstuvwxyz1234567890 | ||
| BLACKFIRE_CLIENT_TOKEN=abcdefghijklmnopqrstuvwxyz1234567890 | ||
| BLACKFIRE_SERVER_ID=abcdefghijklmnopqrstuvwxyz1234567890 | ||
| BLACKFIRE_SERVER_TOKEN=abcdefghijklmnopqrstuvwxyz1234567890 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| name: drupal-scaffold | ||
| recipe: drupal8 | ||
| config: | ||
| webroot: web #@docroot | ||
| php: 7.2 | ||
| via: nginx | ||
| drush: ^8 | ||
| xdebug: false | ||
| env_file: | ||
| - .env/drupal.env | ||
| - .env/private.env | ||
| proxy: | ||
| mannequin: | ||
| - mannequin.lndo.site | ||
| services: | ||
| appserver: | ||
| build: | ||
| - composer install | ||
| build_as_root: | ||
| - .lando/init/terminus.sh | ||
| - .lando/init/blackfire.sh | ||
| overrides: | ||
| environment: | ||
| BLACKFIRE_CLIENT_ID: | ||
| BLACKFIRE_CLIENT_TOKEN: | ||
|
|
||
| node: | ||
| type: node | ||
| build: | ||
| - yarn install | ||
| globals: | ||
| gulp-cli: latest | ||
| mannequin: | ||
| type: compose | ||
| services: | ||
| image: devwithlando/php:7.3-apache | ||
| command: docker-php-entrypoint /app/vendor/bin/mannequin start -c /app/.mannequin.php *:80 | ||
| blackfire: | ||
| type: compose | ||
| keys: false | ||
| app_mount: false | ||
| services: | ||
| image: "blackfire/blackfire" | ||
| user: root | ||
| command: blackfire-agent | ||
| environment: | ||
| BLACKFIRE_SERVER_ID: # Set in .env if you want to use Blackfire. | ||
| BLACKFIRE_SERVER_TOKEN: # Set in .env if you want to use Blackfire. | ||
| LANDO_DROP_USER: blackfire | ||
|
|
||
| tooling: | ||
| gulp: | ||
| service: node | ||
| yarn: | ||
| service: node | ||
| npm: | ||
| service: node | ||
| cmd: "echo 'NPM is disabled in favor of yarn'" | ||
| behat: | ||
| service: appserver | ||
| cmd: vendor/bin/behat | ||
| phpunit: | ||
| service: appserver | ||
| cmd: vendor/bin/phpunit | ||
| phpcs: | ||
| service: appserver | ||
| cmd: vendor/bin/phpcs | ||
| eslint: | ||
| service: node | ||
| cmd: node_modules/.bin/eslint | ||
| terminus: | ||
| service: appserver | ||
| latest_db_pantheon: | ||
| service: appserver | ||
| description: Updates the database from the latest Pantheon backup | ||
| cmd: bin/refresh-local-pantheon | ||
| blackfire: | ||
| service: appserver | ||
| user: root |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| #!/usr/bin/env bash | ||
| set -e | ||
|
|
||
| echo "Installing Blackfire PHP Probe..." | ||
| curl -o $(php -r "echo ini_get('extension_dir');")/blackfire.so -L -s https://packages.blackfire.io/binaries/blackfire-php/1.34.0/blackfire-php-linux_amd64-php-$(php -r "echo PHP_MAJOR_VERSION . PHP_MINOR_VERSION;").so | ||
| printf "extension=blackfire.so\nblackfire.agent_socket=tcp://blackfire:8707\n" > $PHP_INI_DIR/conf.d/blackfire.ini | ||
|
|
||
| echo "Installing Blackfire CLI..." | ||
| curl -o /usr/local/bin/blackfire -L -s https://packages.blackfire.io/binaries/blackfire-agent/1.35.1/blackfire-cli-linux_static_amd64 | ||
| chmod +x /usr/local/bin/blackfire |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| wget https://github.com/pantheon-systems/terminus/releases/download/2.3.0/terminus.phar -O /usr/local/bin/terminus | ||
| chmod +x /usr/local/bin/terminus | ||
| [ -z "$TERMINUS_MACHINE_TOKEN" ] && echo "Terminus machine token not set" || terminus auth:login --machine-token=$TERMINUS_MACHINE_TOKEN |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| TODO | ||
| ==== | ||
|
|
||
| - [ ] BLACKFIRE: Enable Blackfire in Lando (see [this issue](https://github.com/lando/lando/issues/511) and [this gist](https://gist.github.com/tylerssn/8923149702d4a796c5e103412c2370c3)) | ||
| - Update Blackfire docs in docs/tools/blackfire.md | ||
| - [x] WDIO: | ||
| - Disable, remove WDIO configuration | ||
| - Documentation at docs/tools/wdio.md | ||
| - [x] MANNEQUIN: | ||
| - Add mannequin service to Lando config | ||
| - Update Mannequin docs at docs/tools/mannequin.md | ||
| - [x] VARNISH: | ||
| - Determine if we still want a varnish service | ||
| - [ ] If yes: | ||
| - add varnish service to .lando.yml | ||
| - [x] If no: | ||
| - Remove docker/default.vcl, docs in docs/tools/varnish.md | ||
| - [ ] DOCKER-COMPOSE: Since we're switching from docker-compose to lando it would be confusing to leave the docker-compose functionality in here, documented or not. We should remove config and references to the old docker-compose local infrastructure | ||
| - [ ] Remove `docker-compose.yml` | ||
| - [x] Remove `docker` directory | ||
| - [x] LOCAL DEVELOPMENT TOOLS: | ||
| - Determine if we need the `site-import` tooling in `appserver` | ||
| - If yes: | ||
| - [x] Add terminus commands and scripts for importing a database | ||
| - ~~[ ] Add acquia API commands for importing databases~~ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,7 +12,7 @@ Refresh your local environment from Pantheon. | |
| Options: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this file needed anymore? We can just use |
||
| -h: Show help | ||
| -i: Set the Pantheon site that will be used (defaults to TERMINUS_SITE). | ||
| -s: Set the Pantheon environment that will be used (defaults to TERMINUS_SOURCE_ENVIRONMENT/live) | ||
| -s: Set the Pantheon environment that will be used (defaults to TERMINUS_ENV/live) | ||
| -c: Set the cache directory to work from. | ||
| -n: Dry run (does not create environment). | ||
|
|
||
|
|
@@ -29,7 +29,7 @@ error_out() { | |
| } | ||
|
|
||
| site="$TERMINUS_SITE" | ||
| source="${TERMINUS_SOURCE_ENVIRONMENT:-live}" | ||
| source="${TERMINUS_ENV:-live}" | ||
| cache="/tmp/site-import-cache" | ||
| dryrun=0 | ||
| while getopts "hi:s:c:n" opt; do | ||
|
|
@@ -43,7 +43,7 @@ while getopts "hi:s:c:n" opt; do | |
| done | ||
|
|
||
| test -n "$site" || error_out "Site must be set using the -i flag or the TERMINUS_SITE environment variable" 1 | ||
| test -n "$source" || error_out "Source environment must be set using the -s flag or the TERMINUS_SOURCE_ENVIRONMENT environment variable" 1 | ||
| test -n "$source" || error_out "Source environment must be set using the -s flag or the TERMINUS_ENV environment variable" 1 | ||
|
|
||
|
|
||
| mkdir -p "$cache" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| This directory contains configuration to be imported into your Drupal site. To make this configuration active, visit admin/config/development/configuration/sync. For information about deploying configuration between servers, see https://www.drupal.org/documentation/administer/config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should use .env as a directory, because it prevents us from ever using a .env file. In #111, we discussed moving this into
.landoinstead.