Coder Social home page Coder Social logo

ndubbaka / example-drupal7-travis-composer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pantheon-deprecated/example-drupal7-travis-composer

0.0 1.0 0.0 37 KB

Example project for installing a Drupal 7 site with Composer.

Shell 100.00%

example-drupal7-travis-composer's Introduction

About

This project utilizes the pantheon-systems/travis-scripts project in order to achieve the following things:

  • Specify the Drupal modules, themes and libraries you use in a composer.json file, and build them with Composer.
  • Automatically build components via Travis every commit.
  • Use Behat to run tests on your site from Travis.
  • Automatically deploy your site to your Pantheon dev environment, or some other branch, every time the tests pass.

Create a New Project

Before you begin, you should first install composer.

There are two ways to quickly create a new project for your Drupal site, using this project as a template.

Via GitHub

The init-new-project script will set up the local files you will need, and commit them to your local git repository.

Via Composer

$ composer create-project pantheon-systems/example-drupal7-travis-composer my-new-project-name

The composer create-project will download the base files you need for your new project, then run the init-new-poroject script to set things up. The results are committed to a local git repository. You might wish to push your repository up to GitHub.

Configuration

Once you have created a new project, you will still need to do some customization steps to suit your particular needs. See the travis-scripts README for instructions on how to do this.

The folder 'scripts' contain some starting scripts that you may use to customize the environment you need for your tests.

Testing Locally

$ ./bin/local-test

The local-test script will set up a local Drupal site, run it with the PHP built-in webserver, and then run the Behat test suite. This is analagous to what happens on Travis on every commit.

Repository Management

You may place your custom modules and themes in drupal/sites/all/modules/custom and drupal/sites/all/themes/custom, respectively, and commit them to the same repository that contains your composer.json file.

If you prefer, you may instead create a Composer project for your custom components, and add them to your composer.json file. It is not necessary to make your code publicly accessible in order to do this; it is possible to create a local composer package definition that points to a private GitHub repository. See Creating your very own Composer Package for details on different ways to create composer packages.

Additional modules may be added using Composer:

$ cd my-new-project-name
$ composer require drupal/devel '7.*'

This will put the specified module in sites/all/modules/contrib, and will also update your composer.json file with the information on the module that was just added.

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.