├── .gitlab-ci.yml ├── LICENSE └── README.md /.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | include: 2 | - remote: 'https://gitlab.com/richardhj/deployment/raw/v1/.gitlab-ci.include.yml' 3 | 4 | variables: 5 | SSH_USER: user 6 | SSH_HOST: test.uberspace.de 7 | SSH_DOCUMENT_ROOT: /var/www/virtual/user/contao-example.org/current 8 | URL: https://www.example.org 9 | 10 | 11 | ########### 12 | 13 | 14 | save_database_dump: 15 | only: 16 | - schedules 17 | stage: deploy 18 | extends: .download_db_dump 19 | 20 | composer_update: 21 | only: 22 | - schedules 23 | extends: .deployer 24 | script: 25 | - composer update --prefer-dist --no-progress --no-suggest 26 | - php deployer.phar deploy $DEPLOY_STAGE 27 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Richard Henkenjohann 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Contao Workflow Boileplate 2 | ========================== 3 | 4 | This repository holds a concept of a Contao development and deployment 5 | workflow. This workflow is something I figured out for me personally but is 6 | open for feedback for sure. 7 | 8 | 9 | Frontend theme development 10 | -------------------------- 11 | 12 | As many others, I tried a lot of frontend theme development mehtods. Starting 13 | from the internal CSS genenrator, I then tried external CSS files and SASS with 14 | Compass. 15 | 16 | For now I use a very satisfying frontend workflow. Since then, working with old 17 | projects, not using this workflow, feels awful. 18 | 19 | The workflow comes with the [euf_nutshell][10]. The nutshell itself has a SCSS 20 | boilerplate and is built in a modular manner. Meaning: Each component has its 21 | own SCSS file, like `_events.scss`, `_navs.scss` or `_layout.scss`. 22 | 23 | The documentation can befound at http://nutshell.erdmann-freunde.de/. However, 24 | I switched the gulp part to encore. 25 | 26 | I ususally start with an empty Contao project by running the following: 27 | 28 | ``` 29 | git clone git@github.com:terminal42/contao-standard.git && cd contao-standard && composer require --dev erdmannfreunde/euf_nutshell 30 | ``` 31 | 32 | I use the terminal42 edition, as it comes with the required files for the 33 | encore workflow. 34 | 35 | Then, I copy the [SCSS files][9] of the nutshell kit into the `/layout` folder. 36 | The resulting directory structure looks like this: 37 | 38 | ``` 39 | |-- CONTAO 40 | |-- files 41 | |-- package.json 42 | |-- layout 43 | |-- images 44 | |-- js 45 | |-- styles 46 | |-- base 47 | |-- components 48 | |-- mixinx 49 | |-- trumps 50 | |-- _variables.scss 51 | |-- app.scss 52 | |-- README.md 53 | ``` 54 | 55 | After setting up your Contao (site structure, theme etc.), you can start building your 56 | theme with `npm run dev` keep running. 57 | 58 | Add the style sheet to your layout with the following lines: 59 | 60 | ``` 61 | 62 | 63 | ``` 64 | 65 | 66 | Project deployment 67 | ------------------ 68 | 69 | I deploy using Deployer. Please make sure to follow the latest instructions from 70 | https://github.com/terminal42/deployer-recipes. 71 | 72 | ### trakked.io 73 | 74 | I use https://trakked.io to track my projects for uptime and overview of used versions. 75 | With an automatated GitLab CI task I will make sure, that the project is always using the 76 | latest Contao version. 77 | 78 | 79 | ### GitLab CI 80 | 81 | The `.gitlab.ci.yml` hold two tasks: 82 | 83 | The `save_database_dump` task will download a database dump. This task is scheduled 84 | (via the GitLab interface) to run once every week. 85 | 86 | The `composer_update` task will update the Contao project via `composer update` and 87 | will re-deploy project once every week within the GitLab Runner. 88 | 89 | Now, the versions are up-to-date and the interface of trakked.io will show you so :) 90 | 91 | ----------------- 92 | 93 | 94 | [1]: https://contao.org 95 | [2]: https://docs.contao.org/books/manual/current/en/01-installation/installing-contao.html 96 | [3]: https://docs.contao.org/books/manual/current/ 97 | [4]: https://docs.contao.org/books/extending-contao4/ 98 | [5]: https://docs.contao.org/books/cookbook/ 99 | [6]: https://docs.contao.org/books/api/ 100 | [7]: https://contao.org/en/support.html 101 | [8]: http://nutshell.erdmann-freunde.de/ 102 | [9]: https://github.com/ErdmannFreunde/euf_nutshell_kit/tree/develop/files/starterkit/src 103 | [10]: https://github.com/ErdmannFreunde/euf_nutshell 104 | 105 | --------------------------------------------------------------------------------