Getting Cake build.cake and asp.net core to work on Travis-ci

What should I put in my .travis.ymlcake.build to run and compile the main .net project?

+4
source share
2 answers

First add build.sh to your github repository, then give it execute rights, on Windows, run the following command git update-index --add --chmod=+x build.shwhile you are in the same directory as build.sh.

To just start cake.build, add the following content:

language: csharp
script:
  - ./build.sh

cache:
  directories:
    - src/packages
    - tools

To install dotnet cli, add the following content:

language: csharp
os:
  - linux

sudo: required
dist: trusty
env:
  - CLI_VERSION=latest

addons:
  apt:
    packages:
    - gettext
    - libcurl4-openssl-dev
    - libicu-dev
    - libssl-dev
    - libunwind8
    - zlib1g

install:
  - export DOTNET_INSTALL_DIR="$PWD/.dotnetcli"
  - 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:
  - ./build.sh

cache:
  directories:
    - src/packages
    - tools
+5
source

MSFT Linux ( ):

language: csharp

os:
  - linux
dist: trusty
sudo: required

before_install:
  - 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ trusty main" | sudo tee -a /etc/apt/sources.list'
  - sudo apt-key adv --keyserver apt-mo.trafficmanager.net --recv-keys 417A0893
  - sudo apt-get update -qq

install:
  - sudo apt-get install -y dotnet-dev-1.0.0-preview2-003121

script:
  - ./build.sh

cache:
  directories:
    - $HOME/.local/share/NuGet/Cache
    - tools

sudo, , , .

, APT addon, , key_url, - addons:

addons:
  apt:
    sources:
      - sourceline: 'deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ trusty main'
        key_url: ???
    packages:
      - dotnet-dev-1.0.0-preview2-003121

URL- GPG, .

+1

Source: https://habr.com/ru/post/1649497/


All Articles