Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 29, 2018. It is now read-only.

Small utility to mirror TravisCI's build matrix on CircleCI.

License

NotificationsYou must be signed in to change notification settings

michaelcontento/circleci-matrix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

  • TravisCI:Linux Build (Linux & OSX)
  • CircleCI:OSX Build (OSX)

Small utility to mirrorTravisCI'sbuild matrix onCircleCI.

Features

  • Simple one file distribution
    • Really!src/circleci-matrix.sh contains everything you need.
  • No special requirements on OSX or Linux
  • Supportsparallelism out of the box
  • Using different config files is as simple as--config anotherConfig.yml
  • A rich set of tests ensures that everything will work as expected

Installation

Simply downloadsrc/circleci-matrix.sh and make it executable:

curl -fsSL https://git.io/v2Ifs \    -o /usr/local/bin/circleci-matrix \    && chmod +x /usr/local/bin/circleci-matrix

NOTE: Theubuntu user used byCircleCI machines has no permissions towrite to/use/local/bin! A good alternative is~/.local/bin!

As a alternative you could paste this into yourcircle.yml:

dependencies:    pre:    # Install circleci-matrix    - mkdir -p ~/.local/bin    - curl -fsSL https://git.io/v2Ifs -o ~/.local/bin/circleci-matrix    - chmod +x ~/.local/bin/circleci-matrix

Or, if you like to have a cleanercircle.yml, use the installer:

dependencies:    pre:    - curl -fsSL https://git.io/v2Ifn | bash

Usage

Then add your build matrix to a new file.circleci-matrix.yml, which isthe default name. If you wish to use another name you can set it via thecommand line option--config/-c ($ circleci-matrix --config my-config.yml).

env:    - VERSION=5.0    - VERSION=4.2    - VERSION=4.1    - VERSION=4.0command:    - echo 'hi!'    - echo "Version is $VERSION"

Now you're ready to execute it with:

$ circleci-matrix------------------------------------------------------------------- circleci-matrix version: 1.0.0-- circleci node total: 1-- circleci node index: 0------------------------------------------------------------------------------------------------------------------------------------ Env: VERSION=5.0-----------------------------------------------------------------$ echo 'hi!'hi!$ echo "Version is $VERSION"Version is 5.0------------------------------------------------------------------- Env: VERSION=4.2-----------------------------------------------------------------$ echo 'hi!'hi!$ echo "Version is $VERSION"Version is 4.2------------------------------------------------------------------- Env: VERSION=4.1-----------------------------------------------------------------$ echo 'hi!'hi!$ echo "Version is $VERSION"Version is 4.1------------------------------------------------------------------- Env: VERSION=4.0-----------------------------------------------------------------$ echo 'hi!'hi!$ echo "Version is $VERSION"Version is 4.0

All commands have been executed with the right value in$VERSION.

Parallelism

CircleCI'sparallelism is supported out of the box! Have a look at thefollowing example where I setCIRCLE_NODE_TOTAL andCIRCLE_NODE_INDEXmanually first to2 and0, then to2 and1 to simulate two containers:

Container 0:

$ CIRCLE_NODE_TOTAL=2 CIRCLE_NODE_INDEX=0 circle-matrix------------------------------------------------------------------- circleci-matrix version: 1.0.0-- circleci node total: 2-- circleci node index: 0------------------------------------------------------------------------------------------------------------------------------------ Env: VERSION=5.0-----------------------------------------------------------------$ echo 'hi!'hi!$ echo "Version is $VERSION"Version is 5.0------------------------------------------------------------------- Env: VERSION=4.1-----------------------------------------------------------------$ echo 'hi!'hi!$ echo "Version is $VERSION"Version is 4.1

Container 1:

$ CIRCLE_NODE_TOTAL=2 CIRCLE_NODE_INDEX=1 circle-matrix------------------------------------------------------------------- circleci-matrix version: 1.0.0-- circleci node total: 2-- circleci node index: 1------------------------------------------------------------------------------------------------------------------------------------ Env: VERSION=4.2-----------------------------------------------------------------$ echo 'hi!'hi!$ echo "Version is $VERSION"Version is 4.2------------------------------------------------------------------- Env: VERSION=4.0-----------------------------------------------------------------$ echo 'hi!'hi!$ echo "Version is $VERSION"Version is 4.0

And here is the output when circleci runs our circle.yml file with 3 containers

Container 0 we seeVERSION=5.0 andVersion=4.0:

------------------------------------------------------------------- circleci-matrix version: 1.0.0-- circleci node total: 3-- circleci node index: 0------------------------------------------------------------------------------------------------------------------------------------ Env: VERSION=5.0-----------------------------------------------------------------$ echo 'hi!'hi!$ echo "Version is $VERSION"Version is 5.0------------------------------------------------------------------- Env: VERSION=4.0-----------------------------------------------------------------$ echo 'hi!'hi!$ echo "Version is $VERSION"Version is 4.0

Container 1 we seeVERSION=4.2:

------------------------------------------------------------------- circleci-matrix version: 1.0.0-- circleci node total: 3-- circleci node index: 1------------------------------------------------------------------------------------------------------------------------------------ Env: VERSION=4.2-----------------------------------------------------------------$ echo 'hi!'hi!$ echo "Version is $VERSION"Version is 4.2

Container 2 we seeVERSION=4.1:

------------------------------------------------------------------- circleci-matrix version: 1.0.0-- circleci node total: 3-- circleci node index: 2------------------------------------------------------------------------------------------------------------------------------------ Env: VERSION=4.1-----------------------------------------------------------------$ echo 'hi!'hi!$ echo "Version is $VERSION"Version is 4.1

License

The MIT License (MIT)Copyright (c) 2015 Michael ContentoPermission is hereby granted, free of charge, to any person obtaining a copy ofthis software and associated documentation files (the "Software"), to deal inthe Software without restriction, including without limitation the rights touse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies ofthe Software, and to permit persons to whom the Software is furnished to do so,subject to the following conditions:The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESSFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS ORCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHERIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR INCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

Small utility to mirror TravisCI's build matrix on CircleCI.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors4

  •  
  •  
  •  
  •  

Languages


[8]ページ先頭

©2009-2025 Movatter.jp