Download the PHP package silverstripe/travis-support without Composer

On this page you can find all versions of the php package silverstripe/travis-support. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package travis-support

Travis Integration for SilverStripe Modules

Build Status Scrutinizer Code Quality Build Status codecov.io

codecov.io

Introduction

Travis is an open source platform for continuous integration, which mostly means running your unit tests every time you commit to a codebase. The platform is free for open source projects, and integrates nicely with Github. Since each SilverStripe module needs to be tested within a SilverStripe project, there's a bit of setup work required on top of the standard Composer dependency management.

The scripts allow you to test across multiple branches, and rewrite the composer.json to match dependencies. The scripts will test your module against multiple core releases, as well as multiple databases (if supported).

Why bother? Because it shows your users that you care about the quality of your codebase, and gives them a clear picture of the current status of it. And it helps you manage the complexity of coding against multiple databases, SilverStripe core releases and other dependencies.

Haven't written unit tests yet? Then it's high time you get started with the SilverStripe Testing Guide.

Composer Setup

Since this script works based on Composer, you need to add some metadata to your module. Copy the composer.json into the root directory of your module and adjust it to suit your needs. If you have mulitple branches in your module which support different core releases, then commit the file to each of those branches. Ensure you set the right dependency versions.

Don't have branches? You really should, so your users can trust in the stability of releases, and have clear guidance on dependencies. Read on semver.org for details on version numbering.

Abbreviated composer.json for a branch supporting SS 2.4 only:

Abbreviated composer.json for a branch supporting SS 3.0 and newer:

Now commit those files to the various module branches, and register them on Packagist so they're discoverable by Composer.

Travis Setup

The free Travis CI service is configured by placing a hidden .travis.yml file into the root of your module (read me about the Travis YML format).

Here's an example .travis.yml:

When getting set up, to avoid repeatedly pushing to trigger the service hook, you should save time by linting your configuration with Travis WebLint.

Now adjust the <yourmodule> path in .travis.yml, in the example above it would be my-awesome-module. Adjust the supported PHP versions, SS core versions and databases in .travis.yml (read more about the Travis PHP config). Consider blacklisting or whitelisting builds to keep the number of individual builds to a reasonable level.

The sample file above will run the following builds:

After you committed the files, as a final step you'll want to enable your module on travis-ci.org. The first builds should start within a few minutes.

As a bonus, you can include build status images in your README to promote the fact that your module values quality and does continuous integration.

Adding extra modules

If you need to add extra modules during setup, that aren't explicitly included in the module composer requirements, you can use the --require parameter.

E.g.

php ~/travis-support/travis_setup.php --source `pwd` --target ~/builds/ss --require silverstripe/behat-extension

You can also specify multiple modules by either comma separating the names, or by the addition of multiple --require flags. Each name can also be suffixed with :<version> to add a version dependency.

E.g.

php ~/travis-support/travis_setup.php --source `pwd` --target ~/builds/ss --require silverstripe/behat-extension:dev-master --require silverstripe-cms:4.0.x-dev

or equivalently

php ~/travis-support/travis_setup.php --source `pwd` --target ~/builds/ss --require silverstripe/behat-extension:dev-master,silverstripe-cms:4.0.x-dev

PDO DB Connectors

Many database connectors support connection via PDO. If you would like to include PDO support you can also add the PDO=1 environment variable.

Note that this feature is only supported in SilverStripe 3.2 or later and will be ignored in 3.1 or below

Working with Pull Requests

The logic relies on pulling in different core releases based on the CORE_RELEASE constant. This can lead to inconsistencies where pull requests rely on other branches, for example where a pull request for the cms module relies on an equivalent in the framework module. While there's no clean way to tell Travis which branches to use, temporary modifications to travis.yml can help prove a build is passing with the right dependencies.

Note that these .travis.yml changes in your fork are temporary, and need to be reverted before the pull request will be merged. Unfortunately Travis CI doesn't support per-build configuration settings outside of version control.

Github Rate Limitation

Composer heavily relies on github's APIs for retrieving repository info and downloading archives. Github has a low rate limitation for unauthenticated requests. This means depending on how often your builds run (and the amount of executed API requests per build), your build can fail because of these side effects.

This script supports a GITHUB_API_TOKEN value. If set, it'll write it to a global composer configuration (details). It can optionally be encrypted through Travis' secure environment variables.

In order to activate the configuration, add an entry to env.global in your .travis.yml:

Alternatively you can add the Token through the Travis CI web interface for your repo under the "settings" area.

Behat and Selenium

The scripts also allow behaviour testing through Behat. The easiest way to get this going is through a locally running Selenium server and PHP's built-in webserver. Here's a sample setup:

Artifacts Upload

Since Travis builds are stateless, you can't inspect anything apart from the actual build log after the build has finished. This is an issue for larger files like server logs, and of course for images.

You can use https://github.com/travis-ci/artifacts for this purpose, allowing upload to Amazon S3. Since Behat creates screenshots of any failed test step already, this is a useful addition to any Behat script. The behat.yml created through travis_setup_selenium.php is already set up to save its screenshots into artifacts/screenshots/.

Troubleshooting

Testing travis_setup.php locally

While its not 100% accurate, you can get pretty close to reproducing Travis' behaviour on your own environment. Just look at the CLI output from a previous travis build to get started. Here's an example on building a specific commit on the 1.0 branch of the translatable module:

Note: Each SilverStripe module only works as a subfolder in the context of a SilverStripe project, and requires at least the SilverStripe framework. So we need to ensure the plain module checkout which Travis performs by defaults get rewritten to this.


All versions of travis-support with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package silverstripe/travis-support contains the following files

Loading the files please wait ....