Skip to content

necyberteam/cyberteam_drupal

Repository files navigation

cyberteam_drupal

BLT

This uses a fairly standard BLT install. See below for the custom commands.

Command Description
amp:landosetup Runs the commands needed for an initial setup of the site.
amp:start Start lando.
amp:behat Runs behat test on all domains. Optionally list the domains at the end separated by a space (amp:behat amp cci).
amp: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.
amp:ds Switch default domain.
amp:mds Create file (blt/md/md-xxx) that will set the default domain on multidev site.
amp: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.
amp:snap:create Create snapshot.
amp:snap:restore Restore snapshot.
amp: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.

Github Actions

Workflow Ran Description
(A) Config Sync — Run backups
(A) Config Sync — Run backups
Weekly on Wed. Afternoon Pulls in prod database and adds it to an artifact. Then builds the site from the production db. Next, it diffs the config files from the last git tag and creates a file to checkout all of those files so they don't change. Then it runs drush cex -y and runs the diff file to checkout anything that has changed since the last tag, any git files that are left over are committed to a new branch and the pull request is created.
(A) Database to artifact
(A) Database to artifact
Daily in the early morning This builds the site from the lastest db and then runs everything needed for the dev version of the site. Enables modules, and sanitizes the db. Once this all is complete, the db is exported and added to an artifact. This is the db that will be pulled for the Composer Updates workflow and local version of the site.
(A) Deploy to dev
(A) Deploy to dev
Any push to main or md- branch This builds the site using the blt command and then pushes the built version to the hosts dev site on pantheon. You can skip this workflow by adding #nobuild to your commit message. You can also run the behat workflow by adding #behat to your commit message. On initial push of md- branch this will create the md site on pantheon. This will also setup the default domain if set using blt amp:mds
(A) Files to artifact
(A) Database to artifact
Daily in the early morning This pulls the files from dev, cleans out the private directory, and adds them to an artifact. These can then be used on the local version of the site.
(AM) Behat Tests
(M) Behat Tests
PR, Deploy to dev, Manual This pulls builds the current PR or branch and runs behat tests against the site.
(M) Composer Updates
(A) Database to artifact
Manual You specify the module or library name for the input box and click run. This will build the site, update the module and run the proper drush commands, and lastly run the behat tests. If all runs well, the updated composer.lock file will be committed to a branch named after the update and then a pull request will be created.
(M) Create Release
(A) Database to artifact
Manual If the defaults are kept for the inputs this will iterate the last tag and then add release notes that include all commit messages since the last tag. After the release/tag are created, the terminus command will be ran to deploy to test.
(M) Deploy to Prod
(M) Deploy to Prod
Manual If the defaults are kept for the inputs this will iterate the last tag and then add release notes that include all commit messages since the last tag. After the release/tag are created, the terminus command will be ran to deploy to test.

Codespaces

This repository is setup to run in codespaces. 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 lando 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 Panthon. 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.

When starting lando run the blt amp:start command as that will also set your composer github key with the latest GITHUB_TOKEN variable set by codespaces.

Github CLI

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