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

Fixes to the CI document #1556

Closed
wants to merge 14 commits into from
Prev Previous commit
Next Next commit
rc4 appveyor/travis cleanup (#1599)
* use install script in build matrix

* add travis docs, and template

* travis, add custom install using install script
  • Loading branch information
enricosada authored and Zlatko Knezevic committed Feb 24, 2017
commit d60d44d9ff4406ff6543c203e6ee3923d702d425
12 changes: 11 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,21 @@ matrix:
- os: osx # OSX 10.11
osx_image: xcode7.2
dotnet: 1.0.0-preview2-003121
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need to change these versions @enricosada?

Copy link
Author

Choose a reason for hiding this comment

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

Yes. That should say 1.0.1

- os: osx # OSX 10.12
osx_image: xcode7.3
dotnet: 1.0.0-rc4-0044771
Copy link
Member

Choose a reason for hiding this comment

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

Please CMIIW, but I think it's 0044771 -> 004771.

It will work after travis-ci/travis-build#973 :)


## If `dotnet` configuration doesnt work, use install script instead
# install:
# - export DOTNET_INSTALL_DIR="$PWD/.dotnetsdk"
# - curl -sSL https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0/scripts/obtain/dotnet-install.sh | bash /dev/stdin --version "$CLI_VERSION" --install-dir "$DOTNET_INSTALL_DIR"
# - export PATH="$DOTNET_INSTALL_DIR:$PATH"

script:
- dotnet --info
# Run a new console app
- mkdir -p "test/test-dotnet-new" && pushd "test/test-dotnet-new"
- dotnet new
Copy link
Contributor

Choose a reason for hiding this comment

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

should probably be changed to dotnet new console

- dotnet restore
- dotnet --verbose run a b
- dotnet run a b
- popd
36 changes: 15 additions & 21 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,27 @@
os: Visual Studio 2015

## .NET Core SDK preview1 is already installed in the build worker image Visual Studio 2015
##
## To install a specific version:
##
## install:
## # .NET Core SDK binaries
## ## 1) from direct url
## - ps: $url = "https://go.microsoft.com/fwlink/?LinkID=798402" # v1.0.0-preview1 x64
## ## 2) from url based on version, for example using an env var CLI_VERSION that can be a
## ## a specific version `1.0.0-preview2-003121` or `Latest` (for latest dev version)
## - ps: $url = "https://dotnetcli.blob.core.windows.net/dotnet/preview/Binaries/$($env:CLI_VERSION)/dotnet-dev-win-x64.$($env:CLI_VERSION.ToLower()).zip"
## # Download .NET Core SDK and add to PATH
## - ps: $env:DOTNET_INSTALL_DIR = "$pwd\.dotnetsdk"
## - ps: mkdir $env:DOTNET_INSTALL_DIR -Force | Out-Null
## - ps: $tempFile = [System.IO.Path]::GetTempFileName()
## - ps: (New-Object System.Net.WebClient).DownloadFile($url, $tempFile)
## - ps: Add-Type -AssemblyName System.IO.Compression.FileSystem; [System.IO.Compression.ZipFile]::ExtractToDirectory($tempFile, $env:DOTNET_INSTALL_DIR)
## - ps: $env:Path = "$env:DOTNET_INSTALL_DIR;$env:Path"
# NOTE .NET Core SDK preview2 is already installed in the build worker image Visual Studio 2015
Copy link
Contributor

Choose a reason for hiding this comment

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

we would need to update these for vs 2017 correct?

# so the `install` section is not required

environment:
CLI_VERSION: 1.0.0-rc4-004771

install:
- ps: $env:DOTNET_INSTALL_DIR = "$pwd\.dotnetsdk"
- ps: mkdir $env:DOTNET_INSTALL_DIR -Force | Out-Null
- ps: Invoke-WebRequest -Uri "https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0/scripts/obtain/dotnet-install.ps1" -OutFile "$($env:DOTNET_INSTALL_DIR)/dotnet-install.ps1"
- ps: '& "$($env:DOTNET_INSTALL_DIR)/dotnet-install.ps1" -Version $env:CLI_VERSION -InstallDir $env:DOTNET_INSTALL_DIR'
- ps: $env:Path = "$env:DOTNET_INSTALL_DIR;$env:Path"

build_script:
# dotnet info
- ps: dotnet --info
# Run dotnet new
- ps: mkdir "test\test-dotnet-new" -Force | Push-Location
- ps: dotnet new --lang fsharp
- ps: dotnet new console -lang f#
- ps: dotnet restore
- ps: dotnet --verbose build
- ps: dotnet --verbose run a b
- ps: dotnet build
- ps: dotnet run a b
- ps: Pop-Location


Expand Down
12 changes: 7 additions & 5 deletions docs/core/preview3/tools/using-ci-with-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,17 @@ $LOCALDOTNET="./$INSTALLDIR/dotnet"
### TravisCI

The [Travis-CI](https://travis-ci.org/) can be configured to install the .NET Core SDK using the `csharp` language and the `dotnet` key.
See official travis docs about [Building a C#, F#, or Visual Basic Project](https://docs.travis-ci.com/user/languages/csharp/) for more info.

As a note, the `language: csharp` (community maintained) works for all .NET languages (for F# projects too) and support mono.

Just use:

```yaml
dotnet: 1.0.0-rc4-0044771
```

Travis can run both `osx` (OS X 10.11) and `linux` ( Ubuntu 14.04 ) job in a build matrix, see [example .travis.yml](https://github.com/dotnet/docs/blob/master/.travis.yml)
Travis can run both `osx` (OS X 10.11, OS X 10.12) and `linux` ( Ubuntu 14.04 ) job in a build matrix, see [example .travis.yml](https://github.com/dotnet/docs/blob/master/.travis.yml)
for more information.

The MSBuild-based tools bring both the LTS and Current runtimes (1.0.x and 1.1.x respectively) in the package, so by installing the SDK you will get everything you need to build.
Expand All @@ -148,7 +151,7 @@ os: Visual Studio 2015
It's possible to install a specific version of .NET Core SDK, see [example appveyor.yml](https://github.com/dotnet/docs/blob/master/appveyor.yml)
for more info.

In the example, the .NET Core SDK binaries are downloaded, unzipped in a subdirectory and added to `PATH` environment variable.
In the example, the .NET Core SDK binaries are downloaded and unzipped in a subdirectory, using the install script, and added to `PATH` environment variable.

A build matrix can be added to run integration tests with multiple version of
the .NET Core SDK.
Expand All @@ -157,12 +160,11 @@ the .NET Core SDK.
environment:
matrix:
- CLI_VERSION: 1.0.0-preview2-003121
- CLI_VERSION: 1.0.0-rc4-004771
- CLI_VERSION: Latest

install:
# .NET Core SDK binaries
- ps: $url = "https://dotnetcli.blob.core.windows.net/dotnet/preview/Binaries/$($env:CLI_VERSION)/dotnet-dev-win-x64.$($env:CLI_VERSION.ToLower()).zip"
# follow normal installation from binaries
# see example appveyor.yml for install script
```

### Visual Studio Team Services
Expand Down