2019-01-04 12:56:21 +00:00
# Agaric's Flagship Site
See also [SERVICES.md ](https://gitlab.com/agaric/sites/agaric-com/blob/master/SERVICES.md )
2018-08-01 01:51:16 +00:00
## Get submodules
2019-03-31 16:41:31 +00:00
This project includes the [Agaric styleguide ](https://gitlab.com/agaric/patternlibrary ) as a [git submodule ](https://git-scm.com/book/en/v2/Git-Tools-Submodules ).
2018-08-01 01:51:16 +00:00
### When cloning
```
git clone --recurse-submodules git@gitlab.com:agaric/sites/agaric-com.git
```
### If you cloned without `--recurse-submodules`
If in your initial clone you didn't do as above, you can get the styleguide with:
```
git submodule init
git submodule update
```
2018-08-28 14:17:09 +00:00
### Get started
To be able to import the configuration, you need to get the initializing database (where we will also be collaborating on content) [from the test site ](https://agaric-test.drutopia.org/ ) pending resolution of [drutopia#216 ](https://gitlab.com/drutopia/drutopia/issues/216 ).
2018-10-08 04:07:26 +00:00
```
vagrant ssh
composer install
2018-12-28 21:22:20 +00:00
drush -y sql-dump > /tmp/paranoia.sql && drush sql-drop && drush -y sql-sync @live @self && drush -y updb
drush -y rsync @live: %files @self: %files
2018-10-08 04:07:26 +00:00
```
2018-08-28 14:17:09 +00:00
2018-08-01 01:51:16 +00:00
### Get updates
```
2018-12-07 18:57:10 +00:00
git pull
2018-08-01 01:51:16 +00:00
git submodule update --recursive --remote
2018-12-07 18:58:02 +00:00
vagrant ssh
2018-12-07 18:57:10 +00:00
composer install
2019-01-29 13:49:05 +00:00
drush -y sql-dump > /tmp/paranoia.sql && drush -y sql-drop && drush -y sql-sync @live @self && drush -y updb
drush -y rsync @live: %files @self: %files
2018-12-07 18:57:10 +00:00
drush cim -y
2018-08-01 01:51:16 +00:00
```
2018-08-21 22:53:35 +00:00
## Theming
See `web/themes/custom/agarica/README.md` and `web/themes/custom/agarica/patternlibrary/README.md`
2018-11-05 23:07:49 +00:00
## Deployment
Agaric is currently using a Platform as a Service version of Drutopia with additional modules.
Set up [drutopia_host ](https://gitlab.com/drutopia-platform/drutopia_host ) and [hosting_private ](https://gitlab.com/drutopia-platform/hosting_private ), as documented in hosting private.
2018-11-05 23:11:20 +00:00
Then use [ahoy ](https://github.com/ahoy-cli/ahoy/ ), from within the hosting_private directory.
2018-11-05 23:07:49 +00:00
2019-01-24 19:00:03 +00:00
Ensure all three related repositories are up-to-date with:
```
ahoy git-pull-all
```
2018-12-07 18:57:10 +00:00
If Agaric's Drutopia PaaS base has changed (the composer.lock in this directory), produce and push a new build:
2018-11-05 23:07:49 +00:00
```
ahoy deploy-build agaric
```
To deploy everything else (config, templates, styles):
```
2020-04-15 18:04:32 +00:00
ahoy deploy-site agaric_test
2018-11-05 23:07:49 +00:00
```
2018-11-13 04:52:52 +00:00
2020-04-15 18:04:32 +00:00
(And likewise for `agaric_live` .)
2019-01-24 19:00:03 +00:00
Then record the deployment. This applies to both deploy-site and deploy-build record keeping:
2020-04-15 22:28:02 +00:00
Navigate to `/drutopia_host/build_artifacts`
2019-01-03 19:48:14 +00:00
Add all new files generated with `git add . `
2020-04-15 22:28:02 +00:00
Commit the files with a message on what you deployed with `git commit -m "Add artifacts"`
2019-01-03 19:48:14 +00:00
Push the changes to the repo with `git push`
2018-11-13 04:52:52 +00:00
If you need to overwrite live configuration (only after confirming you've committed any parts you want to keep) you can use ahoy for that too with `deploy-site-force` .
2019-01-28 19:38:24 +00:00
## Code Hightlight.
The [prism.js ](https://prismjs.com/ ) library was added in the site and can be used like this:
```
< pre >
< code class = "language-css" >
p { color: red }
< / code >
< / pre >
```
The suffix of the class needs to be changed depending of the language that is going to be highlighted eg: `language-php` , `language-js` etc.