Travis CI构建应用程序,但不会部署到Surge.sh

时间:2017-11-02 11:39:18

标签: yaml travis-ci

每次我将代码推送到github时,我都在尝试构建/部署一个角度应用程序。 travis CI构建通过但由于某种原因它不会部署到Surge。我将SURGE_LOGIN和SURGE_TOKEN环境变量添加到存储库设置中,但它仍然无法正常工作。是不是没有提到构建日志中的部署失败?知道这里出了什么问题/如何解决这个问题?即使在配置文件中设置了我的电子邮件地址并添加到SURGE_LOGIN环境变量

,我也不会在构建通过/失败时收到电子邮件。
the end of my travis build log:

42.29s$ ng build -prod

1439
Date: 2017-11-02T11:04:25.130Z

1440
Hash: 5dadab3e49327d48aac1

1441
Time: 38060ms

1442
chunk {0} polyfills.d8d3d78a4deb2ab66856.bundle.js (polyfills) 66.1 kB {4} [initial] [rendered]

1443
chunk {1} styles.4d93494871bdc47b353f.bundle.css (styles) 115 kB {4} [initial] [rendered]

1444
chunk {2} main.725afabe80d80f10fd14.bundle.js (main) 8.08 kB {3} [initial] [rendered]

1445
chunk {3} vendor.4400ceca3ce00f041a26.bundle.js (vendor) 434 kB [initial] [rendered]

1446
chunk {4} inline.fe3295955bbd9314430c.bundle.js (inline) 1.45 kB [entry] [rendered]

1447

1448

1449
The command "ng build -prod" exited with 0.

1450

1451
Done. Your build exited with 0.


my .travis.yml code:

#travis CI build configuration

#build language

language: node_js

#node_js versions

node_js:
- "6.11.2"

#before running the build

before-script:
- npm install #install all dependencies

- npm install -g surge #global surge install

#actual build step
script: 
- ng build -prod

#build only on push not on pull requests.

deploy:
provider: surge
skip_cleanup: true
project: ./dist/  #build output path

domain: gaping-feeling.surge.sh  #surge domain

#notifications

notifications:
email:
on_success: change #default: change

on_failure: change #default: change

1 个答案:

答案 0 :(得分:1)

你的问题是yaml缩进。 Yaml是缩进特定的。所以

a:
b:

a:
  b:

它们都有不同的含义。在第一个ab中是顶级属性,在以后的情况下,ba的子属性。你的yaml应该是

#travis CI build configuration

#build language

language: node_js

#node_js versions

node_js:
- "6.11.2"

#before running the build

before-script:
- npm install #install all dependencies

- npm install -g surge #global surge install

#actual build step
script: 
- ng build -prod

#build only on push not on pull requests.

deploy:
  provider: surge
  skip_cleanup: true
  project: ./dist/  #build output path
  domain: gaping-feeling.surge.sh  #surge domain

notifications:
  email:
    on_success: change 
    on_failure: change

如果您仍然遇到问题,请告诉我。但这应解决问题