Skip to content
This repository has been archived by the owner on Nov 7, 2023. It is now read-only.

Commit

Permalink
replace travis with circleci
Browse files Browse the repository at this point in the history
  • Loading branch information
Dustin Blackman committed Sep 25, 2015
1 parent d0fe278 commit f3eb131
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 95 deletions.
29 changes: 0 additions & 29 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ _Champion-If-Ayyy_

[![Join the chat at https://gitter.im/dustinblackman/Championify](https://img.shields.io/badge/%E2%8A%AA%20GITTER%20-JOIN%20CHAT%20%E2%86%92-brightgreen.svg?style=flat)](https://gitter.im/dustinblackman/Championify?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![ProjectTalk](http://www.projecttalk.io/images/gh_badge-3e578a9f437f841de7446bab9a49d103.svg?vsn=d)](http://www.projecttalk.io/boards/dustinblackman%2FChampionify?utm_campaign=gh-badge&utm_medium=badge&utm_source=github)
[![Travis](https://img.shields.io/travis/dustinblackman/Championify/master.svg)](https://travis-ci.org/dustinblackman/Championify/builds)
[![Circle](https://img.shields.io/circleci/project/dustinblackman/Championify/master.svg)](https://circleci.com/gh/dustinblackman/Championify/tree/master)
[![AppVeyor](https://ci.appveyor.com/api/projects/status/dt20uyoxt2skgneu/branch/master?svg=true)](https://ci.appveyor.com/project/dustinblackman/championify/branch/master)
[![Coverage Status](https://img.shields.io/coveralls/dustinblackman/Championify/master.svg)](https://coveralls.io/github/dustinblackman/Championify?branch=master)
[![Dependency Status](https://david-dm.org/dustinblackman/Championify.svg)](https://david-dm.org/dustinblackman/Championify)
Expand Down
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ environment:
COVERALLS_SERVICE_NAME: appveyor
COVERALLS_REPO_TOKEN:
secure: QkxS7B6UiQysk6aWhKHQd+36lKw/6pvjC9+wF4v/2RiD5wvoWi0kZJFrHFKpvPOK
GITHUB_TOKEN:
secure: X/JCTitKeibH9uTyAKi7ED04LT0qACHJonHNCuHVnBHA/GQtsFeNQea21K6QrLYy
CIRCLE_TOKEN:
secure: yxp+vf3EpWp6uUVkPvIXKWefo20419mRZZonoyboPM/SADH/aENpok/gtqpn1dKF
test_script:
- npm run appveyor
- npm run build-artifact
Expand Down
22 changes: 22 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
machine:
environment:
LANG: en_US.UTF-8
node:
# must match package.json
version: 2.3.1

dependencies:
pre:
- sw_vers -productVersion
- brew update
- brew install p7zip
# must match package.json
- npm install -g npm@2.8.2
- npm install || echo First NPM install failed # Fix electron-prebuilt failing on first install
test:
override:
- npm test
post:
- 'export COVERALLS_SERVICE_JOB_ID=$CIRCLE_SHA1 && cat ./coverage/lcov.info | ./node_modules/.bin/coveralls'
- npm run build-artifact
- cp -rf ./release/ $CIRCLE_ARTIFACTS/release/
4 changes: 3 additions & 1 deletion tasks/artifacts.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@ gulp.task 'build-artifact', (cb) ->
return runSequence('build-artifact:osx', cb)

gulp.task 'upload-artifcat', (cb) ->
commit = process.env.APPVEYOR_REPO_COMMIT or process.env.TRAVIS_COMMIT or 'NO_COMMIT'
commit = process.env.APPVEYOR_REPO_COMMIT or process.env.CIRCLE_SHA1 or 'NO_COMMIT'
file = glob.sync('./releases/*.zip')[0]
file_name = "Championify-#{process.platform}-#{commit}.zip"

upload_file = path.join('./releases', file_name)
fs.move file, upload_file, ->
return cb if process.platform == 'darwin'

options = {
method: 'POST'
url: 'http://www92.zippyshare.com/upload'
Expand Down
72 changes: 10 additions & 62 deletions tasks/tests.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -128,69 +128,17 @@ gulp.task 'istanbul', (cb) ->
console.log(stderr) if stderr
cb()

_request = (params, done) ->
default_params = {
headers: {
Accept: 'application/vnd.travis-ci.2+json'
'User-Agent': 'Championify/1.0.0'
'Content-Type': 'application/json'
}
}

params = _.merge(_.clone(default_params, true), params)
request params, (err, res, body) ->
return done(err) if err
try
body = JSON.parse(body)
catch e
return done(e)

done(null, body)


return _istanbul() if !_.contains(process.argv, '--appveyor')
async.waterfall [
(step) -> # Get travis token
params = {
url: 'https://api.travis-ci.org/auth/github'
form: {github_token: process.env.GITHUB_TOKEN}
method: 'POST'
}

_request params, (err, body) ->
return step(err) if err
step(null, body.access_token)

(access_token, step) -> # Get current job id from travis.
params = {
url: 'https://api.travis-ci.org/repos/dustinblackman/Championify/builds'
headers: {Authorization: "token \"#{access_token}\""}
method: 'GET'
}

_request params, (err, body) ->
return step(err) if err

build_number = process.env.APPVEYOR_BUILD_NUMBER.toString()
build = _.find(body.builds, {number: build_number})

return step(new Error("Could not find travis build number: #{build_number}")) if !build
step(null, build.job_ids[0])

(job_id, step) -> # Set enviroment variables.
cmds = [
"SET COVERALLS_RUN_AT=#{moment().format('YYYY-MM-DDTHH:mm:ssZ')}"
"SET COVERALLS_SERVICE_JOB_ID=#{job_id}"
"SET COVERALLS_GIT_BRANCH=#{process.env.APPVEYOR_REPO_BRANCH}"
"SET COVERALLS_GIT_COMMIT=#{process.env.APPVEYOR_REPO_COMMIT}"
'type .\\coverage\\lcov.info | .\\node_modules\\.bin\\coveralls'
]
fs.writeFileSync './coveralls.bat', cmds.join('\n'), {encoding: 'utf8'}
step()

], (err) ->
return cb(err) if err
_istanbul()

cmds = [
"SET COVERALLS_RUN_AT=#{moment().format('YYYY-MM-DDTHH:mm:ssZ')}"
"SET COVERALLS_SERVICE_JOB_ID=#{process.env.APPVEYOR_REPO_COMMIT}"
"SET COVERALLS_GIT_BRANCH=#{process.env.APPVEYOR_REPO_BRANCH}"
"SET COVERALLS_GIT_COMMIT=#{process.env.APPVEYOR_REPO_COMMIT}"
'type .\\coverage\\lcov.info | .\\node_modules\\.bin\\coveralls'
]
fs.writeFileSync './coveralls.bat', cmds.join('\n'), {encoding: 'utf8'}
_istanbul()


gulp.task 'coverage', (cb) ->
Expand Down

0 comments on commit f3eb131

Please sign in to comment.