Giter Club home page Giter Club logo

ukgovernmentbeis.beis-primary-authority-register's Introduction

Department of Business Energy and Industrial Strategy - Regulatory Authority

Primary Authority Register

Build Status

Web Application

Please see the web application readme file in the web directory for more information about Drupal and how to configure the web application.

Dashboard

Please see the dashboard readme file in the dashboard directory for more information.

Vagrant development environment

The Vagrant development environment tries to maximise all the work done for Drupal-VM as much as possible. Please follow the Drupal-VM readme below and install Drupal-VM in a convenient location.

NOTE: The old Vagrant development environment wraps docker in a VM, these files vagrant files are still in the repository but please do not use them.

Prerequisites

Configuration

Before starting the Drupal-VM make sure that you have cloned a copy of the website and run all the necessary setup on this. You will need to configure Drupal-VM so that the vagrant_synced_folders for this project points to the correct local_path of your application.

As part of the site setup run composer install from the project root folder. Ensure the vendor directory is created with all the required application components before moving on to the database section.

Database

In order to run the site you will need to import a copy of the latest par database, download this and place in the backups directory of the par project (create the folder if it doesn't' exist).

Import the database using drush (note the database should be truncated before re-importing)

cd /var/www/par/web
tar -zxvf ../backups/drush-dump-production-sanitized-latest.sql.tar.gz ../backups/drush-dump-production-sanitized-latest.sql
../vendor/bin/drush sql:cli < ../backups/drush-dump-production-sanitized-latest.sql

Deployment

Tagging the master branch will cause the build to be packaged and stored in S3

git tag v0.0.31
git push --tags

Once a build has been packaged, it can be deployed to another environment as follows:

cd cf
./push.sh ENV_NAME VERSION

e.g.

./push.sh staging v0.0.31

Full instructions on setting AWS keys and environment variables for the target environment can be found in the push.sh script itself.

Prerequisites

Backup database

The build relies on a seed database which is a sanitised version of the production database. At regular periods this seed database needs to be updated:

Backup the production database

cf ssh beis-par-production -c "python app/devops/tools/postgres_dump.py"

Sanitize the production database

Go to the S3 artifacts bucket and download a copy of the drush-dump-production-unsanitized.sql file that was just created (and uploaded).

NOTE: You must always sanitize the database against the latest release code only with dev and test settings files turned off:

$config['config_split.config_split.dev_config']['status'] = FALSE;
$config['config_split.config_split.test_config']['status'] = FALSE;

Import the newly downloaded production db:

cd ./web
tar -zxvf ./location/of/downloaded/sql/drush-dump-production-unsanitized-latest.sql.tar.gz
../vendor/bin/drush @par.paas sql:drop -y
../vendor/bin/drush @par.paas sql:cli < ./location/of/downloaded/sql/drush-dump-production-unsanitized-latest.sql
cd ..
./drupal-update.sh

Check that the data looks right and then sanitise:

cd ./web
../vendor/bin/drush @par.paas sql:sanitize -y

Then dump the db, zip it and upload it back to the S3 artifacts bucket with the correct name:

tar -zcvf drush-dump-production-sanitized-latest.sql.tar.gz -C ./ drush-dump-production-sanitized-latest.sql
../vendor/bin/drush fsp s3backups drush-dump-production-sanitized-latest.sql.tar.gz drush-dump-production-sanitized-latest.sql.tar.gz```

ukgovernmentbeis.beis-primary-authority-register's People

Contributors

kalpaitch avatar jon-edery avatar stemount avatar jaffamonkey avatar chris-moreton avatar stephenb01 avatar nao360 avatar webdevfreak avatar samlionheart avatar nasirkhanbeis avatar nasirkhan1982 avatar baberabbasi avatar craigmoore avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.