This project uses DDEV for local development. DDEV provides a consistent, containerized development environment that works across different operating systems.
We switched to the robo command so we could remove BLT as it's no longer supported. Some of the commands have been revised as well.
Command | Description |
---|---|
ddevsetup | Runs the commands needed for an initial setup of the site with DDEV. |
cypress | Runs cypress tests on accessmatch1. Add a space and the test you want to run for other tests (ie: robo cypress crct). |
did | Runs composer install then reloads from 'backups/site.sql.gz', by running gh:pulldb you can replaces this with the latest backup. You can add the corresponding number to do a domain switch that you get from the ds command as an argument. |
ds | Switch default domain. |
mds | Create file (blt/md/md-xxx) that will set the default domain on multidev site. |
cex | Export config files and then restore the deleted files. This is helpful if you aren't deleted any config files and want to get past the deleted views. |
snap:create | Create snapshot. |
snap:restore | Restore snapshot. |
checkout | Arguments: branch domain_number . Use this command to checkout a branch and run the commands needed to get setup and ready to go. |
gh:keepalive | This will echo bing every 2 minutes in order to keep a codespace running. Use with caution as if you forget this is running and don't close your codespace, you may run up your minutes. You can use ctrl+c to stop this command from running. |
gh:pulldb | Daily github action pulls in and processes the production database and places it into an artifact. This pulls the latest artifact. |
gh:pullfiles | Daily github action pulls in last pantheon backup and cleans up the private files directory to decrease the size and places it into an artifact. This pulls the latest artifact. |
gh:pr | This command will create a github pull request. It will ask you for the description and then fill in the rest of the template for you. |
This project includes Cypress for end-to-end testing. The Cypress configuration is located in tests/cypress/
.
The base URL for testing is configured in tests/cypress/cypress.config.js
. By default, it's set to the local DDEV environment.
Available URLs for testing:
- Local DDEV:
https://cyberteam-drupal.ddev.site
(default) - Access Match:
https://accessmatch.ddev.site
- CCMNet:
https://ccmnet.ddev.site
- ConnectCI:
https://connectci.ddev.site
- CRCT:
https://crct.ddev.site
- Campus Champions:
https://campuschampions.ddev.site
- COCO:
https://coco.ddev.site
- Great Plains:
https://greatplains.ddev.site
- KYCT:
https://kyct.ddev.site
- NECT:
https://nect.ddev.site
- OnDemand:
https://ondemand.ddev.site
-
Navigate to the Cypress directory:
cd tests/cypress
-
Run with a specific URL using environment variable:
# Test accessmatch domain CYPRESS_BASE_URL=https://accessmatch.ddev.site npm run cypress:run # Test crct domain CYPRESS_BASE_URL=https://crct.ddev.site npm run cypress:open # Test production (if available) CYPRESS_BASE_URL=https://your-production-site.com npm run cypress:run
You can also run Cypress tests using the robo command:
vendor/bin/robo cypress [test_name]
For example:
vendor/bin/robo cypress
- Runs tests on accessmatch1vendor/bin/robo cypress crct
- Runs tests on crct domain
-
Clone the repository:
git clone https://github.com/necyberteam/cyberteam_drupal.git cd cyberteam_drupal
-
Start DDEV and setup the site:
vendor/bin/robo ddevsetup [GITHUB_TOKEN] [AMP_UID]
Or setup manually:
ddev start ddev exec vendor/bin/robo gh:pulldb ddev exec vendor/bin/robo gh:pullfiles ddev exec vendor/bin/robo did
-
Access the site:
- Main site: https://cyberteam-drupal.ddev.site
- All configured domains:
This repository is setup to run in GitHub Codespaces with DDEV. If you are starting from scratch it'll take a little over 15 minutes to run through the setup script. The script will fully start DDEV and install the site. You will need to set two codespaces secrets in your personal github settings under codespaces located at: https://github.com/settings/codespaces
- AMP_GH_TOKEN_REPO
- AMP_UID
The AMP_GH_TOKEN_REPO
secret will have a github token that has access to the cyberteam repositories with full repo control and AMP_UID
is the user id of your user on the website. You can default to uid 1 if you don't have or know your user id.
Optionally, you can setup two other secrets to automatically login to terminus to connect to Pantheon. You can always run the command to login after install as well. These are the secrets to have the login setup for you:
- AMP_TERMINUS_EMAIL
- AMP_TERMINUS_TOKEN
The email secret is the email you use with pantheon and the token can be setup under your settings within your pantheon account.
You can create, open, and ssh into your codespaces using Github CLI, see install instructions to install on your local system. Once installed check out the documentation for commands you can use. You can authorize Github CLI by running the following command:
gh auth login