├── .circleci └── config.yml ├── .dockerignore ├── .env ├── .gitignore ├── .gitpod.Dockerfile ├── .gitpod.yml ├── .lagoon.yml ├── .lando.yml ├── LICENSE ├── README.md ├── TESTING_dockercompose.md ├── TESTING_lando.md ├── assets ├── README.md └── all.settings.php ├── composer.json ├── composer.lock ├── config └── sync │ └── .gitkeep ├── docker-compose.yml ├── lagoon ├── cli.dockerfile ├── nginx.dockerfile └── php.dockerfile └── renovate.json /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | # CircleCI configuration file 2 | 3 | version: 2.1 4 | 5 | commands: 6 | install_and_check: 7 | description: "Install Drupal and check it works" 8 | steps: 9 | # build docker compose project and setup network 10 | - run: 11 | name: Update codebase to follow CI configuration 12 | command: | 13 | sed -i -e "/###/d" docker-compose.yml 14 | - run: docker network prune -f && docker network inspect amazeeio-network >/dev/null || docker network create amazeeio-network 15 | - run: docker-compose up -d 16 | - run: docker info 17 | - run: 18 | name: Check all services are up 19 | command: | 20 | sleep 10 21 | docker-compose ps -a 22 | docker network ls 23 | docker-compose logs 24 | # ensure DB is up prior to install 25 | - run: 26 | name: Check mariadb (or postgres) is responsive with dockerize 27 | command: | 28 | docker run --rm --net circleci_default jwilder/dockerize dockerize -wait tcp://mariadb:3306 -timeout 30s || \ 29 | docker run --rm --net circleci_default jwilder/dockerize dockerize -wait tcp://postgres:5432 -timeout 30s 30 | # install Drupal demo_umami profile 31 | - run: 32 | name: Ensure all modules are installed and test install Drupal 33 | command: | 34 | docker-compose exec cli composer install 35 | docker-compose exec cli drush si -y demo_umami --site-name="Lagoon CI Umami" 36 | # check that the site is installed 37 | - run: 38 | name: Check page title matches site-name 39 | command: docker-compose exec cli curl -Ls http://nginx:8080 | grep -i "Lagoon CI Umami" 40 | # perform some informational checks 41 | - run: 42 | name: Get environment, site and module version status 43 | command: | 44 | docker-compose exec cli php -v 45 | docker-compose exec cli drush sqlq 'SHOW VARIABLES LIKE "%version%";' 46 | docker-compose exec cli drush st 47 | docker-compose exec cli drush pml 48 | remove_all: 49 | description: "Remove all containers etc" 50 | steps: 51 | - run: 52 | name: Stops and removes circleci containers, images, networks and volumes created by docker-compose up 53 | command: | 54 | sed -i -e "/###/d" docker-compose.yml 55 | docker-compose -p circleci down -v --remove-orphans 56 | docker image rm circleci_php circleci_nginx circleci || true 57 | executors: 58 | php_docker: 59 | docker: 60 | - image: circleci/php:8.0-cli 61 | user: root 62 | environment: 63 | COMPOSER_ALLOW_SUPERUSER: 1 64 | COMPOSE_PROJECT_NAME: circleci 65 | 66 | jobs: 67 | composer: 68 | executor: php_docker 69 | steps: 70 | - checkout 71 | # Download and cache dependencies 72 | - restore_cache: 73 | keys: 74 | - v1-dependencies-{{ checksum "composer.json" }} 75 | - v1-dependencies- 76 | - run: composer install -n --prefer-dist --ignore-platform-reqs 77 | - save_cache: 78 | key: v1-dependencies-{{ checksum "composer.json" }} 79 | paths: 80 | - ./vendor 81 | # run tests 82 | - run: composer validate 83 | 84 | docker-compose: 85 | executor: php_docker 86 | steps: 87 | - checkout 88 | - setup_remote_docker: 89 | version: 20.10.6 90 | - install_and_check 91 | - remove_all 92 | 93 | leia-tests: 94 | docker: 95 | - image: circleci/php:8.0-cli-node 96 | user: root 97 | environment: 98 | COMPOSER_ALLOW_SUPERUSER: 1 99 | steps: 100 | - checkout 101 | - setup_remote_docker: 102 | version: 20.10.6 103 | - run: 104 | name: Install Leia and dependencies 105 | command: yarn add leia-parser mocha chai command-line-test 106 | - run: 107 | name: Generate test files 108 | command: yarn leia TESTING_dockercompose.md test -r 2 -s 'Start up tests' -t 'Verification commands' -c 'Destroy tests' 109 | - run: 110 | name: Run tests 111 | command: yarn mocha --timeout 900000 test/*.func.js 112 | 113 | leia-tests-latest: 114 | docker: 115 | - image: circleci/php:8.0-cli-node 116 | user: root 117 | environment: 118 | COMPOSER_ALLOW_SUPERUSER: 1 119 | steps: 120 | - checkout 121 | - setup_remote_docker: 122 | version: 20.10.6 123 | - run: 124 | name: use testlagoon repo instead of uselagoon 125 | command: | 126 | grep -rl uselagoon ./lagoon/*.dockerfile | xargs sed -i '/^FROM/ s/uselagoon/testlagoon/' 127 | grep -rl uselagoon ./docker-compose.yml | xargs sed -i '/image:/ s/uselagoon/testlagoon/' 128 | - run: 129 | name: Install Leia and dependencies 130 | command: yarn add leia-parser mocha chai command-line-test 131 | - run: 132 | name: Generate test files 133 | command: yarn leia TESTING_dockercompose.md test -r 2 -s 'Start up tests' -t 'Verification commands' -c 'Destroy tests' 134 | - run: 135 | name: Run tests 136 | command: yarn mocha --timeout 900000 test/*.func.js 137 | - run: 138 | name: revert to testlagoon repo instead of uselagoon 139 | command: | 140 | grep -rl testlagoon ./lagoon/*.dockerfile | xargs sed -i '/^FROM/ s/testlagoon/uselagoon/' 141 | grep -rl testlagoon ./docker-compose.yml | xargs sed -i '/image:/ s/testlagoon/uselagoon/' 142 | 143 | workflows: 144 | version: 2 145 | commit: 146 | jobs: 147 | - composer 148 | - docker-compose 149 | - leia-tests 150 | nightly: 151 | triggers: 152 | - schedule: 153 | cron: "0 0 * * *" 154 | filters: 155 | branches: 156 | only: 157 | - 9.x-advanced 158 | - 8.x-advanced 159 | jobs: 160 | - composer 161 | - docker-compose 162 | - leia-tests 163 | - leia-tests-latest 164 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | .git 2 | vendor 3 | web/sites/default/files 4 | -------------------------------------------------------------------------------- /.env: -------------------------------------------------------------------------------- 1 | # Local project name - setting this here aligns container names with routes 2 | COMPOSE_PROJECT_NAME=drupal9-example-simple 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore directories generated by Composer 2 | /.drush-lock-update 3 | /drush/Commands/contrib/ 4 | /drush/sites/lagoon.site.yml 5 | /vendor/ 6 | /web 7 | 8 | # Ignore Drupal's file directory 9 | /web/sites/*/files/ 10 | 11 | # Ingore files that are only for the current local environment 12 | web/sites/*/settings.local.php 13 | web/sites/*/services.local.yml 14 | 15 | # Ignore SimpleTest multi-site environment. 16 | web/sites/simpletest 17 | 18 | # Ignore files generated by PhpStorm 19 | /.idea/ 20 | /.editorconfig 21 | /.gitattributes 22 | -------------------------------------------------------------------------------- /.gitpod.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM gitpod/workspace-full 2 | # Make runc's proc mount work again https://github.com/gitpod-io/gitpod/issues/5124#issuecomment-897048987 3 | RUN curl -o olderrunc -L https://github.com/opencontainers/runc/releases/download/v1.0.0-rc93/runc.amd64 && chmod 755 olderrunc 4 | RUN sudo rm /usr/bin/runc && sudo cp olderrunc /usr/bin/runc 5 | RUN curl -OL https://github.com/lando/lando/releases/download/v3.1.4/lando-v3.1.4.deb && sudo dpkg -i lando-v3.1.4.deb && rm -rf lando-v3.1.4.deb 6 | RUN mkdir -p ~/.lando && echo "proxy: 'ON'\nproxyHttpPort: '8080'\nproxyHttpsPort: '4443'\nbindAddress: '0.0.0.0'\nproxyBindAddress: '0.0.0.0'" > ~/.lando/config.yml 7 | -------------------------------------------------------------------------------- /.gitpod.yml: -------------------------------------------------------------------------------- 1 | image: 2 | file: .gitpod.Dockerfile 3 | 4 | tasks: 5 | - name: Drupal start 6 | init: | 7 | lando start 8 | lando composer install 9 | lando drush si -y --account-pass=admin --site-name='gitpod_lando' demo_umami 10 | gp preview $(gp url $(lando info --format=json | jq -r ".[0].urls[1]" | sed -e 's#http://localhost:\(\)#\1#')) 11 | 12 | vscode: 13 | extensions: 14 | - felixfbecker.php-debug 15 | - dbaeumer.vscode-eslint 16 | - eamodio.gitlens 17 | - EditorConfig.EditorConfig 18 | - esbenp.prettier-vscode 19 | - stylelint.vscode-stylelint 20 | - tombonnike.vscode-status-bar-format-toggle 21 | - usernamehw.errorlens 22 | - whatwedo.twig 23 | - marcostazi.vs-code-drupal 24 | -------------------------------------------------------------------------------- /.lagoon.yml: -------------------------------------------------------------------------------- 1 | docker-compose-yaml: docker-compose.yml 2 | 3 | project: drupal9-example-simple 4 | 5 | tasks: 6 | # pre-rollout: 7 | # - run: 8 | # name: drush sql-dump 9 | # command: mkdir -p /app/web/sites/default/files/private/ && drush sql-dump --ordered-dump --gzip --result-file=/app/web/sites/default/files/private/pre-deploy-dump.sql.gz || true 10 | # service: cli 11 | 12 | post-rollout: 13 | # Enable once config sync has been setup. 14 | # - run: 15 | # name: drush cim 16 | # command: drush -y cim 17 | # service: cli 18 | - run: 19 | name: drush updb 20 | command: drush -y updb 21 | service: cli 22 | - run: 23 | name: drush cr 24 | command: drush -y cr 25 | service: cli 26 | 27 | 28 | 29 | environments: 30 | 9.x: 31 | # routes: 32 | cronjobs: 33 | - name: drush cron 34 | schedule: "*/15 * * * *" 35 | command: drush cron 36 | service: cli 37 | -------------------------------------------------------------------------------- /.lando.yml: -------------------------------------------------------------------------------- 1 | name: drupal9-example-simple 2 | recipe: lagoon 3 | config: 4 | flavor: drupal 5 | services: 6 | cli: 7 | build: 8 | - composer install 9 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | {description} 294 | Copyright (C) {year} {fullname} 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | {signature of Ty Coon}, 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Archived 2 | 3 | Maintained examples can be found at https://github.com/lagoon-examples. 4 | 5 | # Composer template for Drupal projects hosted on amazee.io 6 | 7 | This project template should provide a kickstart for managing your site 8 | dependencies with [Composer](https://getcomposer.org/). It is based on the [original Drupal Composer Template](https://github.com/drupal-composer/drupal-project), but includes everything necessary to run on amazee.io (either the local development environment or on amazee.io servers.) 9 | 10 | ## Requirements 11 | 12 | * [docker](https://docs.docker.com/install/) 13 | * [pygmy](https://pygmy.readthedocs.io/) `gem install pygmy` (you might need `sudo` for this depending on your Ruby configuration) 14 | 15 | **OR** 16 | 17 | * [Lando](https://docs.lando.dev/basics/installation.html#system-requirements) 18 | 19 | ## Local environment setup - pygmy 20 | 21 | 1. Checkout this project repo and confirm the path is in Docker's file sharing config - https://docs.docker.com/docker-for-mac/#file-sharing 22 | 23 | ```bash 24 | git clone https://github.com/amazeeio/drupal-example-simple.git drupal9-lagoon && cd $_ 25 | ``` 26 | 27 | 2. Make sure you don't have anything running on port 80 on the host machine (like a web server) then run `pygmy up` 28 | 29 | 3. Build and start the build images: 30 | 31 | ```bash 32 | docker-compose up -d 33 | docker-compose exec cli composer install 34 | ``` 35 | 36 | 4. Visit the new site @ `http://drupal9-example-simple.docker.amazee.io` 37 | 38 | * If any steps fail, you're safe to rerun from any point. 39 | Starting again from the beginning will just reconfirm the changes. 40 | 41 | ## Local environment setup - Lando 42 | 43 | This repository is set up with a `.lando.yml` file, which allows you to use Lando instead of pygmy for your local development environment. 44 | 45 | 1. [Install Lando](https://docs.lando.dev/basics/installation.html#system-requirements). 46 | 47 | 2. Checkout the project repo and confirm the path is in Docker's file sharing config - https://docs.docker.com/docker-for-mac/#file-sharing 48 | 49 | ```bash 50 | git clone https://github.com/amazeeio/drupal-example-simple.git drupal9-lagoon && cd $_ 51 | ``` 52 | 53 | 3. Make sure you have pygmy stopped. Run `pygmy stop` to be sure. 54 | 55 | 4. We already have a Lando file in this repository, so we just need to run the following command to get Lando up: 56 | 57 | ```bash 58 | lando start 59 | ``` 60 | 61 | 5. Install your Drupal site with Drush: 62 | 63 | ```bash 64 | lando drush si -y 65 | ``` 66 | 67 | 6. And now we have a fully working local Drupal site on Lando! For more information on how to deploy your site, check out our documentation or our deployment demo. 68 | 69 | ## What does the template do? 70 | 71 | When installing the given `composer.json` some tasks are taken care of: 72 | 73 | * Drupal will be installed in the `web`-directory. 74 | * Autoloader is implemented to use the generated composer autoloader in `vendor/autoload.php`, 75 | instead of the one provided by Drupal (`web/vendor/autoload.php`). 76 | * Modules (packages of type `drupal-module`) will be placed in `web/modules/contrib/` 77 | * Themes (packages of type `drupal-theme`) will be placed in `web/themes/contrib/` 78 | * Profiles (packages of type `drupal-profile`) will be placed in `web/profiles/contrib/` 79 | * Creates the `web/sites/default/files`-directory. 80 | * Latest version of drush is installed locally for use at `vendor/bin/drush`. 81 | * Latest version of [Drupal Console](http://www.drupalconsole.com) is installed locally for use at `vendor/bin/drupal`. 82 | * The correct scaffolding for your Drupal core version is installed, along with Lagoon-specific scaffolding from our [amazeeio/drupal-integrations](https://github.com/amazeeio/drupal-integrations) project and the `assets/` directory in this repo. For more information see [drupal/core-composer-scaffold](https://github.com/drupal/core-composer-scaffold) 83 | 84 | ## Updating Drupal Core 85 | 86 | Follow the steps below to update your core files. Scaffolding is managed by Drupal core. See the `assets/` directory for more information. 87 | 88 | 1. Run `composer update drupal/core-recommended drupal/core-dev-pinned --with-dependencies` 89 | 90 | ## FAQ 91 | 92 | ### Should I commit the contrib modules I download? 93 | 94 | Composer recommends **no**. They provide [argumentation against but also 95 | workarounds if a project decides to do it anyway](https://getcomposer.org/doc/faqs/should-i-commit-the-dependencies-in-my-vendor-directory.md). 96 | 97 | ### How can I apply patches to downloaded modules? 98 | 99 | If you need to apply patches (depending on the project being modified, a pull 100 | request is often a better solution), you can do so with the 101 | [composer-patches](https://github.com/cweagans/composer-patches) plugin. 102 | 103 | To add a patch to drupal module foobar insert the patches section in the extra 104 | section of composer.json: 105 | 106 | ```json 107 | "extra": { 108 | "patches": { 109 | "drupal/foobar": { 110 | "Patch description": "URL to patch" 111 | } 112 | } 113 | } 114 | ``` 115 | -------------------------------------------------------------------------------- /TESTING_dockercompose.md: -------------------------------------------------------------------------------- 1 | Docker Compose Drupal 9 simple - php7.4, nginx, mariadb 2 | ======================================================= 3 | 4 | This is a docker-compose version of the Lando example tests: 5 | 6 | Start up tests 7 | -------------- 8 | 9 | Run the following commands to get up and running with this example. 10 | 11 | ```bash 12 | # Should remove any previous runs and poweroff 13 | sed -i -e "/###/d" docker-compose.yml 14 | docker network inspect amazeeio-network >/dev/null || docker network create amazeeio-network 15 | docker-compose down 16 | 17 | # Should start up our Lagoon Drupal 9 site successfully 18 | docker-compose build && docker-compose up -d 19 | 20 | # Ensure mariadb pod is ready to connect 21 | docker run --rm --net drupal9-example-simple_default jwilder/dockerize dockerize -wait tcp://mariadb:3306 -timeout 1m 22 | ``` 23 | 24 | Verification commands 25 | --------------------- 26 | 27 | Run the following commands to validate things are rolling as they should. 28 | 29 | ```bash 30 | # Should be able to site install via Drush 31 | docker-compose exec -T cli bash -c "drush si -y" 32 | docker-compose exec -T cli bash -c "drush cr -y" 33 | docker-compose exec -T cli bash -c "drush status" | grep "Drupal bootstrap" | grep "Successful" 34 | 35 | # Should have all the services we expect 36 | docker ps --filter label=com.docker.compose.project=drupal9-example-simple | grep Up | grep drupal9-example-simple_nginx_1 37 | docker ps --filter label=com.docker.compose.project=drupal9-example-simple | grep Up | grep drupal9-example-simple_mariadb_1 38 | docker ps --filter label=com.docker.compose.project=drupal9-example-simple | grep Up | grep drupal9-example-simple_php_1 39 | docker ps --filter label=com.docker.compose.project=drupal9-example-simple | grep Up | grep drupal9-example-simple_cli_1 40 | 41 | # Should ssh against the cli container by default 42 | docker-compose exec -T cli bash -c "env | grep LAGOON=" | grep cli-drupal 43 | 44 | # Should have the correct environment set 45 | docker-compose exec -T cli bash -c "env" | grep LAGOON_ROUTE | grep drupal9-example-simple.docker.amazee.io 46 | docker-compose exec -T cli bash -c "env" | grep LAGOON_ENVIRONMENT_TYPE | grep development 47 | 48 | # Should be running PHP 7.4 49 | docker-compose exec -T cli bash -c "php -v" | grep "PHP 7.4" 50 | 51 | # Should have composer 52 | docker-compose exec -T cli bash -c "composer --version" 53 | 54 | # Should have php cli 55 | docker-compose exec -T cli bash -c "php --version" 56 | 57 | # Should have drush 58 | docker-compose exec -T cli bash -c "drush --version" 59 | 60 | # Should have npm 61 | docker-compose exec -T cli bash -c "npm --version" 62 | 63 | # Should have node 64 | docker-compose exec -T cli bash -c "node --version" 65 | 66 | # Should have yarn 67 | docker-compose exec -T cli bash -c "yarn --version" 68 | 69 | # Should have a running Drupal 9 site served by nginx on port 8080 70 | docker-compose exec -T cli bash -c "curl -kL http://nginx:8080" | grep "Drush Site-Install" 71 | 72 | # Should be able to db-export and db-import the database 73 | docker-compose exec -T cli bash -c "drush sql-dump --result-file /app/test.sql" 74 | docker-compose exec -T cli bash -c "drush sql-drop -y" 75 | docker-compose exec -T cli bash -c "drush sql-cli < /app/test.sql" 76 | docker-compose exec -T cli bash -c "rm test.sql*" 77 | 78 | # Should be able to show the drupal tables 79 | docker-compose exec -T cli bash -c "drush sqlq \'show tables;\'" | grep users 80 | 81 | # Should be able to rebuild and persist the database 82 | docker-compose build && docker-compose up -d 83 | docker-compose exec -T cli bash -c "drush sqlq \'show tables;\'" | grep users 84 | ``` 85 | 86 | Destroy tests 87 | ------------- 88 | 89 | Run the following commands to trash this app like nothing ever happened. 90 | 91 | ```bash 92 | # Should be able to destroy our Drupal 9 site with success 93 | docker-compose down --volumes --remove-orphans 94 | ``` 95 | -------------------------------------------------------------------------------- /TESTING_lando.md: -------------------------------------------------------------------------------- 1 | Lando Drupal 9 Simple - php7.4, nginx, mariadb 2 | ============================================== 3 | 4 | This example exists primarily to test the following documentation: 5 | 6 | * [Lagoon Recipe - Drupal 9](https://docs.lando.dev/config/lagoon.html) 7 | 8 | Start up tests 9 | -------------- 10 | 11 | Run the following commands to get up and running with this example. 12 | 13 | ```bash 14 | # Should remove any previous runs and poweroff 15 | lando --clear 16 | lando destroy -y 17 | lando poweroff 18 | 19 | # Should start up our Lagoon Drupal 9 site successfully 20 | lando start 21 | ``` 22 | 23 | Verification commands 24 | --------------------- 25 | 26 | Run the following commands to validate things are rolling as they should. 27 | 28 | ```bash 29 | # Should be able to site install via Drush 30 | lando drush si -y 31 | lando drush cr -y 32 | lando drush status | grep "Drupal bootstrap" | grep "Successful" 33 | 34 | # Should have all the services we expect 35 | docker ps --filter label=com.docker.compose.project=drupal9examplesimple | grep Up | grep drupal9examplesimple_nginx_1 36 | docker ps --filter label=com.docker.compose.project=drupal9examplesimple | grep Up | grep drupal9examplesimple_mariadb_1 37 | docker ps --filter label=com.docker.compose.project=drupal9examplesimple | grep Up | grep drupal9examplesimple_mailhog_1 38 | docker ps --filter label=com.docker.compose.project=drupal9examplesimple | grep Up | grep drupal9examplesimple_php_1 39 | docker ps --filter label=com.docker.compose.project=drupal9examplesimple | grep Up | grep drupal9examplesimple_cli_1 40 | docker ps --filter label=com.docker.compose.project=drupal9examplesimple | grep Up | grep drupal9examplesimple_lagooncli_1 41 | 42 | # Should ssh against the cli container by default 43 | lando ssh -c "env | grep LAGOON=" | grep cli-drupal 44 | 45 | # Should have the correct environment set 46 | lando ssh -c "env" | grep LAGOON_ROUTE | grep drupal9-example-simple.lndo.site 47 | lando ssh -c "env" | grep LAGOON_ENVIRONMENT_TYPE | grep development 48 | 49 | # Should be running PHP 7.4 50 | lando ssh -c "php -v" | grep "PHP 7.4" 51 | 52 | # Should have composer 53 | lando composer --version 54 | 55 | # Should have php cli 56 | lando php --version 57 | 58 | # Should have drush 59 | lando drush --version 60 | 61 | # Should have npm 62 | lando npm --version 63 | 64 | # Should have node 65 | lando node --version 66 | 67 | # Should have yarn 68 | lando yarn --version 69 | 70 | # Should have lagoon cli 71 | lando lagoon --version | grep lagoon 72 | 73 | # Should have a running Drupal 9 site served by nginx on port 8080 74 | lando ssh -s cli -c "curl -kL http://nginx:8080" | grep "Welcome to Drush Site-Install" 75 | 76 | # Should be able to db-export and db-import the database 77 | lando db-export test.sql 78 | lando db-import test.sql.gz 79 | rm test.sql* 80 | 81 | # Should be able to show the drupal tables 82 | lando mysql drupal -e "show tables;" | grep users 83 | 84 | # Should be able to rebuild and persist the database 85 | lando rebuild -y 86 | lando mysql drupal -e "show tables;" | grep users 87 | ``` 88 | 89 | Destroy tests 90 | ------------- 91 | 92 | Run the following commands to trash this app like nothing ever happened. 93 | 94 | ```bash 95 | # Should be able to destroy our Drupal 9 site with success 96 | lando destroy -y 97 | lando poweroff 98 | ``` 99 | -------------------------------------------------------------------------------- /assets/README.md: -------------------------------------------------------------------------------- 1 | Place files in here that you want to add to your Drupal site. You will also need to add them to the extra/file-mapping section in composer.json. 2 | 3 | As per https://www.drupal.org/docs/develop/using-composer/using-drupals-composer-scaffold 4 | e.g. 5 | ``` 6 | "file-mapping": { 7 | "[web-root]/sites/default/all.settings.php": "assets/all.settings.php" 8 | }, 9 | ``` 10 | 11 | 12 | 13 | Settings files are loaded in this order: 14 | * _Loaded by amazeeio/drupal-integrations_ 15 | - settings.php 16 | - settings.lagoon.php 17 | * _For settings and services that should be applied to all environments (dev, prod, staging, docker, etc)._ 18 | - all.settings.php 19 | - all.services.yml 20 | * _For settings and services that should be applied only for the production environment._ 21 | - production.settings.php 22 | - production.services.yml 23 | * _For settings and services that should be applied only for the development (Lagoon and local) environments._ 24 | - development.settings.php 25 | - development.services.yml 26 | * _For settings and services only for the local environment, these files will not be committed in Git!_ 27 | - settings.local.php 28 | - services.local.yml 29 | -------------------------------------------------------------------------------- /assets/all.settings.php: -------------------------------------------------------------------------------- 1 |