我正在尝试让我的Travis CI将测试覆盖率数据发送到Code Climate服务,但Code Climate和Travis CI的文档没有详细描述如何使用Python执行此操作.根据Code Climate和Travis文档,它仍然是其支持的功能.我试图在没有运气的情况下找到任何有关这方面的工作示例,并且无法使其自行运行.
代码气候文档: 设置测试覆盖率, 自述文件:codeclimate-test-reporter
Travis CI文档: 将Code Climate与Travis CI结合使用
我在Travis CI中设置了CODECLIMATE_REPO_TOKEN,如下所示:https://stackoverflow.com/a/31281481/1754089
我的.travis.yml文件:
language: python
python:
- 2.7
install:
- pip install -r requirements.txt
- pip install coverage
- pip install codeclimate-test-reporter
#commands to run tests:
script:
- python mytests.py
- coverage run mytests.py
after_success:
- codeclimate-test-reporter
Run Code Online (Sandbox Code Playgroud)
因为在Travis中,after_success行已经完成了,它在日志视图中给出了这个:
/home/travis/build.sh: line 45: codeclimate-test_reporter: command not found
Run Code Online (Sandbox Code Playgroud) python continuous-integration python-2.7 travis-ci code-climate
我只想按需跟踪用户当前位置。我只需要初始位置,不需要持续更新。我认为最好的方法是向用户发送静默通知,以便一次获取用户的当前位置。接收静默通知效果很好,但 LocationManager 无法对位置进行初始修复。我的位置管理器委托类正常实例化,但在调用位置管理器方法 startUpdatingLocation() 后的任何时候都不会触发 didUpdateLocations 函数。当应用程序从 AppDelegate:didFinishLaunchingWithOptions 正常启动时,LocationManager 会毫无问题地更新用户位置。
我正在 Xcode 6.3.2 到 iOS 8.3 上进行开发
我的 AppDelegate:DidReceiveRemoteNotification 看起来像这样:
func application(application: UIApplication, didReceiveRemoteNotification userInfo: [NSObject : AnyObject], fetchCompletionHandler handler: (UIBackgroundFetchResult) -> Void) {
var bgTask = bgManager()
bgTask.registerBackgroundTask()
LocManager.locationMngr.startUpdatingLocation() // LocManager is global variable
let delayInSeconds = 8.0
let popTime = dispatch_time(DISPATCH_TIME_NOW, Int64(delayInSeconds * Double(NSEC_PER_SEC)))
dispatch_after(popTime, dispatch_get_main_queue()) {
println(LocManager.updated)
bgTask.endBackgroundTask()
handler(UIBackgroundFetchResult.NewData)
}
}
Run Code Online (Sandbox Code Playgroud)
我首先尝试仅使用以下行:
LocManager.locationMngr.startUpdatingLocation()
Run Code Online (Sandbox Code Playgroud)
但当它不起作用时,我添加了后台任务和dispatch_after,以确保我的位置管理器有足够的时间在终止之前检索第一个位置更新。
这是 LocationManager 类:
class LocationManager: NSObject, CLLocationManagerDelegate {
let locationMngr:CLLocationManager
var coord:CLLocationCoordinate2D
var …Run Code Online (Sandbox Code Playgroud) core-location apple-push-notifications appdelegate swift ios8.3
我正在尝试使用Jenkins为Maven项目构建CI / CD管道。在另一个Jenkins声明式管道阶段中,我似乎找不到任何有关如何使用mvn软件包生成的.jar文件的示例。在将其上传到docker-registry之前,我需要用jar文件制作一个docker-image。这是jenkinsfile的相关部分:
pipeline {
agent none
stages{
stage('Build Jar'){
agent {
docker {
image 'maven:3-alpine'
args '-v /root/.m2:/root/.m2'
}
}
steps {
sh 'mvn package'
stash includes: 'target/*.jar', name: 'targetfiles'
}
}
stage('Deploy') {
agent {
node {
label 'DockerDefault'
}
}
steps {
script{
def image = docker.build("image-name:test", ' .')
}
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
Dockerfile:
#install OS
FROM centos
#install java
RUN yum install -y java
#make directory structure to store temporary files
RUN mkdir -p /store …Run Code Online (Sandbox Code Playgroud) appdelegate ×1
code-climate ×1
devops ×1
docker ×1
ios8.3 ×1
java ×1
jenkins ×1
maven ×1
python ×1
python-2.7 ×1
swift ×1
travis-ci ×1