部署脚本不会运行脚本

时间:2018-06-29 10:28:02

标签: build travis-ci

我正在尝试找出仅在以下情况下部署nuget软件包的方法

  • 建立成功
  • 测试成功
  • 主分支

如果您检查脚本部分。它的构建和运行我的测试。如果我有以下一行,它将运行我的部署脚本。

./deploy/deploy.sh $TestPassingVar

但是我一直在阅读deployment

上的文档

我一直在尝试添加部署部分。但是它总是返回错误。

Installing deploy dependencies
Successfully installed dpl-script-1.9.7
1 gem installed
!!! Script support is experimental !!!
dpl.2
Preparing deploy
dpl.3
Deploying application
Deploy start.
/home/travis/build/LindaLawton/google-analytics-dotnet-sdk
helloTest
./deploy/deploy.sh: 8: ./deploy/deploy.sh: nuget: not found
Script failed with status 127
failed to deploy

.travis.yml

language: csharp
mono: none
dotnet: 2.1
dist: trusty

# Add build var for release.
env:
  BUILD_CONFIGURATION=Release
  NUPKG_DIR=$(pwd)/NuPkgs/Generated

# Install the .NET Core 2.0 runtime as that's what we build and test against
addons:
  apt:
    sources:
    - sourceline: 'deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-trusty-prod trusty main'
      key_url: 'https://packages.microsoft.com/keys/microsoft.asc'
    packages:
    - dotnet-sharedframework-microsoft.netcore.app-1.0.8
    - dotnet-sharedframework-microsoft.netcore.app-1.1.5

script:
  - dotnet build -c $BUILD_CONFIGURATION src/Google.Analytics.SDK.Core
  - dotnet build -c $BUILD_CONFIGURATION tests/Google.Analytics.SDK.Tests
  - dotnet test -c $BUILD_CONFIGURATION tests/Google.Analytics.SDK.Tests 
  - dotnet pack src/Google.Analytics.SDK.Core --configuration $BUILD_CONFIGURATION --no-restore --no-build --output $NUPKG_DIR
  - ls -la $NUPKG_DIR/*.nupkg
  - ls -la ./deploy
  - chmod +x ./deploy/deploy.sh
  - ./deploy/deploy.sh $TestPassingVar
deploy:
  skip_cleanup: true
  provider: script
  script: ./deploy/deploy.sh $TestPassingVar
  on:
    branch: master
  • 我如何只在master分支上部署,但如何在所有分支上构建和运行测试
  • 假设使用deploy是正确的方法。如何获取运行脚本的信息?

这也不起作用。

script: bash ./deploy/deploy.sh $TestPassingVar

0 个答案:

没有答案