【发布时间】:2014-07-30 04:27:05
【问题描述】:
我在如何使用 Travis-CI 构建标签并将其部署到 GitHub 上苦苦挣扎了一段时间。 我在this question 上找到了一些相关信息,但不是很清楚,而且对我也不起作用。
我在 gitHub 上创建了一个新的 Release 版本 0.0.0,我正在使用带有 Play Framework 的 Scala,我的 .travis.yml 文件如下:
language: scala
scala:
- 2.10.4
jdk:
- openjdk7
services:
- postgresql
env:
- PLAY_VERSION=2.0.2 DATABASE_USER=postgres DATABASE_PWD='' DATABASE_URL=jdbc:postgresql:testdb BUILD_KEY=xxxxxxxxxxxxxxxxxxxxxxx
before_script:
- psql -c 'create database testdb;' -U postgres
- wget http://download.playframework.org/releases/play-${PLAY_VERSION}.zip
- unzip -q play-${PLAY_VERSION}.zip
- sudo apt-get install jq
script:
- sbt test
after_success:
- play-${PLAY_VERSION}/play dist
- 'ASSETID=$(curl -s -H "Authorization: token ${BUILD_KEY}" "https://api.github.com/repos/Company/spinsurstaging/releases/456729/assets" | jq ".[0].id")'
- 'curl -XDELETE -s -H "Authorization: token ${BUILD_KEY}" "https://api.github.com/repos/Company/spinsurstaging/releases/assets/$ASSETID"'
- 'curl -XPOST -s -H "Authorization: token ${BUILD_KEY}" -H "Content-Type: application/zip" --data-binary @./spinsurstaging-0.0-SNAPSHOT.zip "https://uploads.github.com/repos/Company/spinsurstaging/releases/456729/assets?name= spinsurstaging.zip"'
notifications:
email: false
deploy:
provider: heroku
api_key: "${HEROKU_KEY}"
app: spinsurstaging
主要问题是:如何让它发挥作用?有什么问题吗?
还有:我不明白如何将文件spinsurstaging-0.0-SNAPSHOT.zip 发布到github。这个文件来自哪里?有这方面的标准吗?
有没有更好的方法来做到这一点?
提前感谢您帮助我解决这个问题。
【问题讨论】:
标签: github continuous-integration travis-ci