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
Closed

Fixes to the CI document #1556

wants to merge 14 commits into from

Conversation

blackdwarf
Copy link

@blackdwarf blackdwarf commented Feb 14, 2017

Various fixes to the CI document.

Fixes #1454

Copy link
Contributor

@mairaw mairaw left a comment

Choose a reason for hiding this comment

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

Thanks @blackdwarf. Some quick edit notes for you. I'll review this more thoroughly later on.

After this, you will be given an option to configure the repository that you wish to build as well as what queue to use for this build. After you select the needed options, you will be directed to the actual build definition. Here, you will be able to add a build step, as shown in the screenshot below:

![Adding a build step](media/vsts-screens/screen_4.png)
Copy link
Contributor

Choose a reason for hiding this comment

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

rename the folder vsts-screens to the name of the topic

This document outlines the usage of .NET Core SDK and its tools on the build server. In general, on a CI build server,
you want to automate the installation in some way. The automation, ideally, should not require administrative
privileges if at all possible.
This document outlines the usage of .NET Core SDK and its tools on the build server. When we started building the .NET Core SDK and its command-line tools, we have envisioned the toolset being able to be used both interactivelly, by a human being sitting at a command line, as well as automatically, that is by a CI server. The commands, options, inputs and outputs would be the same and the only thing you would add on top is a way to acquire the tooling as well as choosng how to do your build.
Copy link
Contributor

Choose a reason for hiding this comment

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

typos:

  • interactivelly
  • choosng

For SaaS CI solutions, there are several options. This document will cover two very popular ones, [TravisCI](https://travis-ci.org/) and
[AppVeyor](https://www.appveyor.com/). There are, of course, many other services out there, but the installation and
usage mechanisms should be similar.
The document will focus on various scenarios of acqusition of the tools and show the tools that we built to help with that. We will then delve into some reccomendations on how to design and structure your build scripts themselves.
Copy link
Contributor

Choose a reason for hiding this comment

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

typos:

  • acqusition
  • reccomendations

install a system-wide version of the SDK, which may be desired; if it's not, you should look into the
[installer script usage](#using-the-installer-script) outlined below.
### Using the native installers
Native installers are available for MacOS, Windows and Ubuntu (in the form of DEB files and a dedicated apt-get feed). They have the following characteristics:
Copy link
Contributor

Choose a reason for hiding this comment

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

macOS

Ubuntu or `yum` for CentOS, or using the packages themselves (that is, DEB or RPM). The former would require setting up the
feed that contains the packages.
* They require admin (sudo) access to the build server.
* For Ubuntu, the apt-get feed allows native depencenies to be acquired at the same time the tools are acquired.
Copy link
Contributor

Choose a reason for hiding this comment

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

typo: depencenies


#### Using a manual script
Taking the script we have started above and using it in VSTS is very simple. You can create a new build definition and then specify
Copy link
Contributor

Choose a reason for hiding this comment

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

specify what?

Taking the script we have started above and using it in VSTS is very simple. You can create a new build definition and then specify

First, start by creating a new build definition. Once you get the screen that gives you an option to define what kind of a build you wish to create, click on the "Empty" option as the
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove all these extra words for First, After, etc...
Just list the steps in sequence
UI options are styled as bold

2. Use the .NET Core command-line commands

Which to use should be decided mostly based on how familar and comfortable you are with each of the mentioned ways. For example, MSBuild can give you access to expressing your build(s) as tasks and targets, but it comes with an added complexity of learning MSBuild project-file syntax. On the other hand, using just the .NET Core command-line tools could be simpler but it would require you to write orchestration logic (for example, change into directory with project 1 and run `dotnet build`, then change to directory with project 2 and again run `dotnet build` etc.) in some scripting language like `bash` or PowerShell.
Copy link
Contributor

Choose a reason for hiding this comment

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

Always use the plural form of a noun rather than adding (s).

typo: familar

Which to use should be decided mostly based on how familar and comfortable you are with each of the mentioned ways. For example, MSBuild can give you access to expressing your build(s) as tasks and targets, but it comes with an added complexity of learning MSBuild project-file syntax. On the other hand, using just the .NET Core command-line tools could be simpler but it would require you to write orchestration logic (for example, change into directory with project 1 and run `dotnet build`, then change to directory with project 2 and again run `dotnet build` etc.) in some scripting language like `bash` or PowerShell.

The choice here is dependent on familiarity; some people are more comfortable using more familiar languages like shell scripts while others are well-versed in MSBuild projects and have no problems using them.
Copy link
Contributor

Choose a reason for hiding this comment

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

This is kind of repeating the last paragraph

![Specifying the PowerShell script to run](media/vsts-screens/screen_6_ps.png)

Here, you can select the script you've created and committed to source control. After this is done, you can save the build definition and try it out by enquining it. From that moment on, you are good to go.
Copy link
Contributor

Choose a reason for hiding this comment

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

typo: enquining

@blackdwarf
Copy link
Author

@mairaw pls take a look. @enricosada will update the PR to add the new AppVeyor script that uses manual install of the newest bits.

Copy link
Contributor

@enricosada enricosada left a comment

Choose a reason for hiding this comment

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

I'll add updated travis/appveyor, downloading and invoking install script, because is best option atm

@@ -74,12 +127,14 @@ The [travis-ci](https://travis-ci.org/) can be configured to install the .NET Co
Just use:

```yaml
dotnet: 1.0.0-preview2-003121
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)
Copy link
Contributor

Choose a reason for hiding this comment

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

@mairaw @blackdwarf you can specify what osx you want to use (also do a build matrix on that) with normal travis conf, so let's use the default in these docs, and travis users can customize as usual ref travis docs

A really good idea is also update directly the f#, c#, vb official travis docs with .net core support (at least a link to this document)

@enricosada
Copy link
Contributor

also afaik (up to two days ago), travis doesnt yet support rc4, ref travis-ci/travis-ci#7301
i'll check with travis.yml embedded in this repo

@enricosada
Copy link
Contributor

@blackdwarf added #1599 with cleanup appveyor/travis for rc4

* use install script in build matrix

* add travis docs, and template

* travis, add custom install using install script
@blackdwarf
Copy link
Author

@enricosada I've added support for RC* in Travis with travis-ci/travis-build#968 that was merged yesterday or on Wed.

@blackdwarf
Copy link
Author

@mairaw are you ok for this going in?

@@ -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


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

## - 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?

@mairaw
Copy link
Contributor

mairaw commented Mar 7, 2017

I've made some improvements @blackdwarf but I still don't think this is ready. Here are the my questions now:

  • we have images that are not being used. Delete them?
  • The section on Using a manual script seems to skip a few steps but I don't know how to fix that since I've never used VSTS. For example, how do I get to the Create new build definition page/dialog?
  • The topic still talks about VS 2015

@blackdwarf
Copy link
Author

blackdwarf commented Mar 7, 2017

@mairaw comments:

  • Sure, delete all of them.
  • You click on the "Build & Release" in the top row. Will add that.
  • Hmmm, @enricosada I thought you added the YAML file for AppVeyor that uses the script and not the VS2015 image?

@@ -9,11 +9,21 @@ matrix:
- os: osx # OSX 10.11
osx_image: xcode7.2
dotnet: 1.0.0-preview2-003121
- 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 :)

@enricosada
Copy link
Contributor

Hmmm, @enricosada I thought you added the YAML file for AppVeyor that uses the script and not the VS2015 image?

@blackdwarf i have do it, the appveyor.yml is

 install:
    - ps: $env:DOTNET_INSTALL_DIR = "$pwd\.dotnetsdk"
    - ps: mkdir $env:DOTNET_INSTALL_DIR -Force | Out-Null
    - ps: Invoke-WebRequest -Uri "https://raw.codeproxy.net/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"

btw all that should be updated for 1.0 rtm i think.

@blackdwarf all that should be updated with .net core tools 1.0.1 , i'll send a PR asap, checking locally because the channel is changed (btw the descript of channel show dev/future/production, but production doesnt work and default is undocumented rel-1.0.0), i'll open an issue in dotnet/cli about that

@enricosada
Copy link
Contributor

@blackdwarf added some comment about dotnet-install script and docs in https://github.com/dotnet/cli/issues/5952

@guardrex
Copy link
Contributor

Replaced by #2161

@guardrex guardrex closed this May 16, 2017
@guardrex guardrex deleted the cifixes branch May 16, 2017 08:06
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.

Clean up the CI document
6 participants