Skip to content

Latest commit

 

History

History
133 lines (93 loc) · 3.93 KB

getting-started.md

File metadata and controls

133 lines (93 loc) · 3.93 KB

Getting Started

Since this is a Drupal site, it can be launched with any Drupal development tool.

For regular development, the DSVA team uses Lando for local container management.

For testing and simple development, you can use the special Composer commands and Drupal Console to launch on any system with PHP-CLI and SQLite.

Quickstart with Codespaces

See the codespaces README to get a fully functional cloud-based development environment.

Step 1: Get Source Code / Git Setup

  • Add upstream repo (Recommended):

    $ git remote add upstream [email protected]:department-of-veterans-affairs/va.gov-cms.git
  • Optionally rename your fork so its name is more meaningful and ensures your upstream and origin are not misnamed.

    $ git remote rename origin myfork
  • Verify your remotes, it should list upstream and myfork/origin as remotes.

    $ git remote -v
    
    myfork  [email protected]:YOUR_GIT_USERNAME/va.gov-cms.git (fetch)
    myfork  [email protected]:YOUR_GIT_USERNAME/va.gov-cms.git (push)
    upstream        [email protected]:department-of-veterans-affairs/va.gov-cms.git (fetch)
    upstream        [email protected]:department-of-veterans-affairs/va.gov-cms.git (push)
  • Make sure your local repo is aware of what's on the remotes.

    $ git fetch --all
  • Make sure git is not tracking perms

    $ git config core.fileMode false
    $ git config --global core.fileMode false
  • Make sure rebase is your default

    $ git config --global branch.autosetuprebase always
    $ git config --global branch.main.rebase true
  • Make branch main always pulls from the remote: upstream.

    $ git checkout main
    $ git branch --set-upstream-to upstream/main
  • Make changes to simplesaml storage not be tracked locally.

 git update-index --skip-worktree samlsessiondb.sq3

You should periodically update your branch from upstream main branch:

 $ git pull upstream main

Step 2: Launch development environment

It is possible to run this site with Lando or any other Drupal development tool, including PHP's built-in web server.

If you don't want to worry about your development machine's PHP version or libraries, use Lando.

Option 1: Lando

  1. Get Lando version >=3.0.26

  2. Change into the project directory and run lando start:

    $ cd va.gov-cms
    $ lando start
    

The lando start command will include the composer install command.

See Environments: Local for more information on Lando.

Option 2: Local PHP

If you are used to using tools like composer and drush locally, you can install the project using your native Terminal:

  1. Change into the project directory and run composer install:

    $ cd va.gov-cms
    $ composer install
    
  2. Run composer va:start to launch a running Drupal instance using PHP web-server and SQLite.

Step 3: Sync your local site with Production Data

You need a copy of the production database to get the full VA.gov CMS running.

Use the provided scripts to download a database and files backup into the correct locations in your local development environment.

  • ./scripts/sync-db.sh
  • ./scripts/sync-files.sh

NOTE: These scripts download the SQL and files first, then attempts to use lando commands to import them.

If you are not using lando, the scripts will fail, but the files will still be available. The sync-db.sh script downloads the SQL file to ./.dumps/cms-prod-db-sanitized-latest.sql

See Environments: Local for more information on Lando.

Table of Contents