我创建了jenkins作业,创建了新的分支,然后将其推送到远程仓库。脚本看起来像这样:
Object object = loadObject("myKey")
static public Object loadObject(String key){
try {
FileInputStream fis = MainActivity.getAppContext().openFileInput(key);
ObjectInputStream is = new ObjectInputStream(fis);
Object object = is.readObject();
is.close();
fis.close();
return object;
}catch(IOException ioe){
Log.e("TAG","Stack trace is "+Log.getStackTraceString(ioe));
} catch (ClassNotFoundException e) {
Log.e("TAG", "Stack trace is "+Log.getStackTraceString(e));
}
return null;
}
Jenkins失败并且有一个控制台输出:
loadObject
这里有什么不对?我还提到我试过
//Error receiving broadcast Intent....
//Attempt to invoke virtual method 'java.io.FileInputStream android.content.Context.openFileInput(java.lang.String)' on a null object reference
FileInputStream fis = MainActivity.getAppContext().openFileInput(key);
和
VERSION=0.1
if [ "$BRANCH_SELECTOR" == "master" ]; then
git checkout -b release-$VERSION
git push -u origin release-$VERSION
fi
仍然无法工作。