Skip to content

Commit

Permalink
Adding tests and docs for travis:ci:init command. (#398)
Browse files Browse the repository at this point in the history
  • Loading branch information
grasmash authored Sep 15, 2016
1 parent 668bdb3 commit 12122ba
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ script:
- drupal yaml:update:value project.yml project.local.hostname '127.0.0.1:8888'
# Running `blt init` modified composer.json, so we must update.
- composer update
# Create a .travis.yml, just to make sure it works. It won't be executed.
- blt ci:travis:init
# Call targets in the new 'blt-project' project.
- blt ci:build:validate:test -Dcreate_alias=false -Dbehat.run-server=true -Dbehat.launch-phantom=true
# Initialize ACSF config.
Expand Down
3 changes: 1 addition & 2 deletions readme/ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,12 @@ To set up this workflow, you must configure Acquia Cloud, GitHub, and Travis CI
1. Login to the new Acquia Cloud account and add the public SSH key from the key pair that was generated in step 1 by visiting `https://accounts.acquia.com/account/[uid]/security`.
1. Add the same public SSH key to the "Deployment Keys" section on your project's GitHub settings page, located at `https://github.com/acquia-pso/[project-name]/settings/keys`. **Note: You may not have direct access to these settings if you do not have administrative control over your repository.**
1. Add the _private SSH key_ to your project's Travis CI settings located at `https://magnum.travis-ci.com/acquia-pso/[project-name]/settings`.
1. Uncomment the example deployment steps in your .travis.yml file and customize them to deploy your desired branch.
1. Add your cloud git repository to the remotes section of your project.yml file:

remotes:
- [email protected]:example.git`

1. Add your cloud git repository's server host name to `ssh_known_hosts` in your .travis.yml file.
1. Add your cloud git repository's server host name to `ssh_known_hosts` in your .travis.yml file. Take care to remove the user name and file name (example.git) and use only the hostname.

addons:
ssh_known_hosts:
Expand Down
11 changes: 5 additions & 6 deletions scripts/travis/.travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,9 @@ before_script:
script:
- blt -Dbehat.run-server=true -Dcreate_alias=false -Dbehat.launch-phantom=true ci:build:validate:test

# Uncomment to enable automatic deployments following merges.
deploy:
# provider: script
# script: blt deploy -Ddeploy.commitMsg="Automated commit by Travis CI for Build ${TRAVIS_BUILD_ID}" -Ddeploy.branch="${TRAVIS_BRANCH}-build"
# skip_cleanup: true
# on:
# branch: master
provider: script
script: blt deploy -Ddeploy.commitMsg="Automated commit by Travis CI for Build ${TRAVIS_BUILD_ID}" -Ddeploy.branch="${TRAVIS_BRANCH}-build"
skip_cleanup: true
on:
branch: master
21 changes: 21 additions & 0 deletions tests/phpunit/Blt/TravisCiTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace Acquia\Blt\Tests\Blt;

use Acquia\Blt\Tests\BltTestBase;

/**
* Class TravisCiTest.
*
* Verifies that Travis CI support has been initialized.
*/
class TravisCiTest extends BltTestBase {

/**
* Tests Phing ci:travis:init target.
*/
public function testTravisInit() {
$this->assertFileExists($this->new_project_dir . '/.travis.yml');
}

}

0 comments on commit 12122ba

Please sign in to comment.