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 example (Ubuntu 14.04 and Mac OS X 10.11) #460

Merged
merged 4 commits into from
Sep 9, 2016

Conversation

enricosada
Copy link
Contributor

ref https://github.com/dotnet/cli/issues/2113

it add an example travisci to build:

  • osx 10.11
  • ubuntu 14.04

It use .NET Core SDK binaries, so it's pretty much curl sdk | unzip to a subdirectory .dotnetsdk and add that to PATH

I used the .net core sdk binaries instead of pkg because are easier to test locally, no need for sudo etc.
The script from dotnet/cli repo is not used because it's easier to just download and unzip, and also it's easier to understand.

i am pretty sure for osx deps (because of docs about brew)

But i am not sure about ubuntu (see apt deps) because these were needed some months ago, maybe now are not.

It use generic as travis language, so it's possibile to copy before_install, install in any travis, not only csharp.

/cc @blackdwarf @akoeplinger

@blackdwarf
Copy link

@enricosada good one. Can I bother you with a few questions?

  • Why not use apt-get for Ubuntu? Would that be "bad" in some way? I thought Travis adds users to the sudo group on each build image.
  • What is hard about the script?

@enricosada
Copy link
Contributor Author

enricosada commented May 24, 2016

Why not use apt-get for Ubuntu? Would that be "bad" in some way? I thought Travis adds users to the sudo group on each build image.

I got mixed experiences with packages and installer during development of dotnet/cli, i know preview1 is more stable now.
I really like sdk binaries atm because i do a lot of side by side installation. Lot of people is new of .net sdk and has issues about installing a machine wide package. Like that can try locally if something doesnt work. just that.
Also sometimes is needed to run exactly the same version of ci server of a component. If the component installation doesnt mess with my machine installation, i can easier try it.

And it's the same install for osx and ubuntu atm, because brew install dotnet is missing atm.

What is hard about the script?

I used to execute the script before in travis/appveyor. i can do that like there also with a oneliner if you want.

But there is little value to use it for me. it's just curl + unzip. Maybe in windows is better the script because i cannot use the better oneliner of powershell 5, but it's easy to follow.

If i use the script:

  • i need to pin a version instead of repo branch because i got bite before when changed ( beta -> preview channel ), some issue bash, etc (i know are fixed, but still i fear that)
  • the script help to set the dotnet in PATH, but with ci it's useless, because PATH changes inside a script are lost (scope), i need to anyway set the manually the PATH
  • The really nice stuff about the script was when it created the url for Latest because directory inside package url was Latest but filename part was latest (lowercase). really annoying. It's nice to have a build matrix like there, and was annoying to compose the url for curl | unzip. But Latest is not used there.

Anyway, as you wish, np for me about one way or another, i can update both pr.

@enricosada
Copy link
Contributor Author

anyway @blackdwarf can you pls enable both travisci and appveyor build of this repo? so we can test these pr before merge.
both travis and appveyor has an option about 'dont build if config file is missing' so it's not an issue with other commit.

@richlander
Copy link
Member

Same questions as #461.

@enricosada
Copy link
Contributor Author

This is just the build script. How will people know how to use this? I'm thinking that an associated help doc explaining this would be very useful.

People need that as example how to install .net core sdk in appveyor, not how to do build.
Everyone has different build script (fake, rake, cake, shell), but all they need is the .net core sdk installed and in PATH, actual command for build (restore, pack, etc) are up to developer.
But if they already use travis, that's standard.

Does this file need to be in the root of the repo? If we had a samples directory, could it be in there?

Yes by design of travis that's the default where it's expected (and where developer search it).
Also, if you enable travis for this repo (it's free for open source), we can test this script every commit for free, and also (if you want), can build all the examples in this repo.

Will you update this when it needs updating?

sure, i use .net core sdk for open source project, that's really easy to update it
Also when @akoeplinger update the travis csharp image, i'll update this script too, but it's nice to know it's possibile to install .net core sdk in a different image (for example i have another language image but i want to install .net core)

before install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install openssl ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew link --force openssl ; fi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@blackdwarf
Copy link

@enricosada the same request as for the #461 . Can you add this to the "Using CLI with CI" doc?

@enricosada
Copy link
Contributor Author

i'll do that now @blackdwarf

@enricosada
Copy link
Contributor Author

done @blackdwarf @cartermp .

Pls @mairaw can you review this too? I really appreciated the review of the other pr

@@ -64,7 +64,44 @@ in the [CLI repo](https://github.com/dotnet/core/blob/master/Documentation/prere
The below sections show examples of configurations using the mentioned CI SaaS offerings.

### TravisCI
**TODO**

The [travis-ci](https://travis-ci.org/) doesn't have the .NET Core SDK preview1 installed by default, but can be added to any

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to become "Preview 2".

@blackdwarf
Copy link

blackdwarf commented Jun 27, 2016

@enricosada thanks much for doing this! 😄 I've left some comments, mostly around the links and the versions. As Preview 2 of the SDK is going live today, we should change to point to these.

@enricosada
Copy link
Contributor Author

yes, i'll update it when the preview2 is released, useless merge the preview1

@enricosada
Copy link
Contributor Author

@blackdwarf if you want we can fix the links after the preview2 released, less diff in docs.

@cartermp
Copy link
Contributor

cartermp commented Jul 4, 2016

@enricosada Once you get the links updated for Preview 2 we can merge this 😄.

@mairaw mairaw added the WIP label Jul 14, 2016
travisci now support .net core sdk with `dotnet` key on language `csharp`
@enricosada
Copy link
Contributor Author

enricosada commented Sep 6, 2016

@richlander @cartermp @blackdwarf sry for long delay, the previous install script was ok ( i just had some intermmittent issues with ssl/crypto after install from script. dunno why) and i was trying to cleanup more.

now travis support the dotnet key in the language csharp, so is really really better.

rebased to master, updated docs, and added example .travis.yml

@qinezh
Copy link
Contributor

qinezh commented Sep 6, 2016

Open Publishing Build Service: The pull request content has been published and here are some sample preview links:

@@ -64,7 +64,17 @@ in the [CLI repo](https://github.com/dotnet/core/blob/master/Documentation/prere
The below sections show examples of configurations using the mentioned CI SaaS offerings.

### TravisCI
**TODO**

The [travis-ci](https://travis-ci.org/) can be configured to install the .NET Core SDK using the language `csharp` and `dotnet` key
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: missing period on the end of the sentence

also wondering if this would read better like this:
...using the csharp language and the dotnet key.

@mairaw mairaw removed the WIP label Sep 6, 2016
@mairaw
Copy link
Contributor

mairaw commented Sep 6, 2016

Thanks @enricosada. I've removed the WIP label and left a few comments. I'll let the guys give the thumbs up on this one.

@enricosada
Copy link
Contributor Author

@mairaw thx for review, changed it as you suggested.

@qinezh
Copy link
Contributor

qinezh commented Sep 7, 2016

Open Publishing Build Service: The pull request content has been published and here are some sample preview links:

@mairaw
Copy link
Contributor

mairaw commented Sep 7, 2016

@blackdwarf can you finish reviewing this? Thanks!


matrix:
include:
- os: linux # Ubuntu 14.04

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@enricosada does Travis have Xenial yet?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope, i dont see that in documentation, just Trusty (14) and Precise (12), and no news in latest changelog https://docs.travis-ci.com/user/build-environment-updates/2016-08-24/

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, ok then. 😃

@qinezh
Copy link
Contributor

qinezh commented Sep 8, 2016

Open Publishing Build Service: The pull request content has been published and here are some sample preview links:

@qinezh
Copy link
Contributor

qinezh commented Sep 8, 2016

Open Publishing Build Service: The pull request content has been published and here are some sample preview links:

@mairaw
Copy link
Contributor

mairaw commented Sep 8, 2016

LGTM. Are we good to merge @blackdwarf?

@blackdwarf
Copy link

:shipit:

@mairaw mairaw merged commit 966ef0a into dotnet:master Sep 9, 2016
@mairaw
Copy link
Contributor

mairaw commented Sep 9, 2016

Thanks @enricosada!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants