Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TravisCI buildsystem #742

Closed
devlead opened this issue Mar 8, 2016 · 8 comments
Closed

Add TravisCI buildsystem #742

devlead opened this issue Mar 8, 2016 · 8 comments
Labels
Milestone

Comments

@devlead
Copy link
Member

devlead commented Mar 8, 2016

It would be nice to have basic wrappers for the TravisCI build servers

Build Variables

Variable Name Comment
TRAVIS_BRANCH For builds not triggered by a pull request this is the name of the branch currently being built; whereas for builds triggered by a pull request this is the name of the branch targeted by the pull request (in many cases this will be master).
TRAVIS_BUILD_DIR The absolute path to the directory where the repository being built has been copied on the worker.
TRAVIS_BUILD_ID The id of the current build that Travis CI uses internally.
TRAVIS_BUILD_NUMBER The number of the current build (for example, 4).
TRAVIS_COMMIT The commit that the current build is testing.
TRAVIS_COMMIT_RANGE The range of commits that were included in the push or pull request.
TRAVIS_JOB_ID The id of the current job that Travis CI uses internally.
TRAVIS_JOB_NUMBER The number of the current job (for example, 4.1).
TRAVIS_OS_NAME On multi-OS builds, this value indicates the platform the job is running on. Values are linux and osx currently, to be extended in the future.
TRAVIS_PULL_REQUEST The pull request number if the current job is a pull request, “false” if it’s not a pull request.
TRAVIS_REPO_SLUG The slug (in form: owner_name/repo_name) of the repository currently being built. (for example, travis-ci/travis-build).
TRAVIS_SECURE_ENV_VARS Whether or not encrypted environment vars are being used. This value is either true or false.
TRAVIS_TEST_RESULT is set to 0 if the build is successful and 1 if the build is broken.
TRAVIS_TAG If the current build for a tag, this includes the tag’s name.

These are all interesting for build scripts

Default environment variables

Variable Name Value Comment
CI true
TRAVIS true
CONTINUOUS_INTEGRATION true
DEBIAN_FRONTEND noninteractive
HAS_JOSH_K_SEAL_OF_APPROVAL true
USER travis (do not depend on this value)
HOME /home/travis (do not depend on this value)
LANG en_US.UTF-8
LC_ALL en_US.UTF-8
RAILS_ENV test
RACK_ENV test
MERB_ENV test
JRUBY_OPTS "--server -Dcext.enabled=false -Xcompile.invokedynamic=false"
JAVA_HOME is set to the appropriate value.

Here i think it's mainly CI / TRAVIS / HOME that's potentially intresting.

Would also be nice to enable log folding, perhaps a "disposable" method

using(TravisFold("Restore-NuGet-Packages"))
{
//do stuff
}

That would output raw to console something like this initally

travis_fold:start:Restore-NuGet-Packages\r

and on dispose

travis_fold:end:Restore-NuGet-Packages\r
@patriksvensson
Copy link
Member

I think the folding should be implemented as two separate methods with an IDisposable convenience method (preferable just an extension method to the provider).

@devlead
Copy link
Member Author

devlead commented Mar 8, 2016

@patriksvensson was only en example, yes it should be two underlying methods that do the raw output.
Also for te tasks it could just be

Does(
    ()=>TravisFold(
        "Restore-NuGet-Packages",
        ()=>//Do stuff
    )
)

@RLittlesII
Copy link
Contributor

@patriksvensson @devlead So is the Fold method just a wrapper around a delegate that logs the output to console? I am unfamiliar with Travis CI. Is it a Travis specific output, or just a regular console?

@RichiCoder1
Copy link
Contributor

You could probably use TeamCity as inspiration here, specifically the teamcity extensions that allow for Build and Compilation block printing.

@RLittlesII
Copy link
Contributor

@RichiCoder1 That's what I was hoping that it would be similar to the TeamCity support so it's standard across build systems. Thanks. I'll probably start on this over the weekend and put a WIP out there for feedback.

@devlead
Copy link
Member Author

devlead commented May 25, 2016

This is fixed by #786

@devlead devlead closed this as completed May 25, 2016
@gep13
Copy link
Member

gep13 commented May 25, 2016

@devlead when was this merged? Looks like this issue wasn't assigned to a milestone :-(

@devlead
Copy link
Member Author

devlead commented May 25, 2016

@gep13 6a7b0ae April 15th, so should've been v0.11.0

@gep13 gep13 added this to the v0.11.0 milestone May 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants