masaki / jenkins-travis-yml-plugin Goto Github PK
View Code? Open in Web Editor NEWgo to https://github.com/jenkinsci/travis-yml-plugin
License: MIT License
go to https://github.com/jenkinsci/travis-yml-plugin
License: MIT License
env:
- FOO: bar
- BAZ: quux
をスクリプトの export で追加する
This .travis.yml
:
---
script: |
if true; then
true
fi
...
produces the following error:
/var/lib/jenkins/workspace/JAVIS/hudson.20141201122107.920.sh: line 39: syntax error near unexpected token `then'
/var/lib/jenkins/workspace/JAVIS/hudson.20141201122107.920.sh: line 39: `echo $ if true; then'
ERROR: (Java::Hudson::AbortException)
sun.reflect.GeneratedConstructorAccessor127.newInstance(Unknown Source)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
java.lang.reflect.Constructor.newInstance(Constructor.java:526)
org.jruby.javasupport.JavaConstructor.newInstanceDirect(JavaConstructor.java:275)
org.jruby.java.invokers.ConstructorInvoker.call(ConstructorInvoker.java:91)
org.jruby.java.invokers.ConstructorInvoker.call(ConstructorInvoker.java:178)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:336)
org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:179)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:183)
org.jruby.java.proxies.ConcreteJavaProxy$2.call(ConcreteJavaProxy.java:52)
org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:177)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:183)
org.jruby.RubyClass.newInstance(RubyClass.java:855)
org.jruby.RubyClass$INVOKER$i$newInstance.call(RubyClass$INVOKER$i$newInstance.gen)
org.jruby.internal.runtime.methods.JavaMethod$JavaMethodZeroOrOneOrNBlock.call(JavaMethod.java:278)
org.jruby.java.proxies.ConcreteJavaProxy$3.call(ConcreteJavaProxy.java:148)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:168)
org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
org.jruby.ast.FCallOneArgNode.interpret(FCallOneArgNode.java:36)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:75)
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:139)
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:172)
rubyjit.TravisYmlBuilder$$perform_4A06EDC1D08D2E7DE9267BC005E417035E798D8A1695017752.__file__(/var/lib/jenkins/plugins/travis-yml/WEB-INF/classes/models/travis_yml_builder.rb:34)
java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:599)
org.jruby.runtime.invokedynamic.InvocationLinker.invocationFallback(InvocationLinker.java:183)
rubyjit.Jenkins::Tasks::BuildStepProxy$$perform_5A3B002C7CA27A9DAFD502D73F0A034D55A627421695017752.block_0$RUBY$__file__(/var/lib/jenkins/plugins/travis-yml/WEB-INF/classes/vendor/gems/gems/jenkins-plugin-runtime-0.2.3/lib/jenkins/tasks/build_step_proxy.rb:14)
rubyjit$Jenkins::Tasks::BuildStepProxy$$perform_5A3B002C7CA27A9DAFD502D73F0A034D55A627421695017752$block_0$RUBY$__file__.call(rubyjit$Jenkins::Tasks::BuildStepProxy$$perform_5A3B002C7CA27A9DAFD502D73F0A034D55A627421695017752$block_0$RUBY$__file__)
org.jruby.runtime.CompiledBlock19.yieldSpecificInternal(CompiledBlock19.java:121)
org.jruby.runtime.CompiledBlock19.yieldSpecific(CompiledBlock19.java:96)
org.jruby.runtime.Block.yieldSpecific(Block.java:99)
org.jruby.runtime.invokedynamic.InvocationLinker.yieldSpecificFallback(InvocationLinker.java:404)
rubyjit.Jenkins::Tasks::BuildStepProxy$$boolean_result_D074B6AB5339B2940C00AF05958432465EDE52701695017752.chained_0_rescue_1$RUBY$SYNTHETIC__file__(/var/lib/jenkins/plugins/travis-yml/WEB-INF/classes/vendor/gems/gems/jenkins-plugin-runtime-0.2.3/lib/jenkins/tasks/build_step_proxy.rb:22)
rubyjit.Jenkins::Tasks::BuildStepProxy$$boolean_result_D074B6AB5339B2940C00AF05958432465EDE52701695017752.__file__(/var/lib/jenkins/plugins/travis-yml/WEB-INF/classes/vendor/gems/gems/jenkins-plugin-runtime-0.2.3/lib/jenkins/tasks/build_step_proxy.rb:21)
rubyjit.Jenkins::Tasks::BuildStepProxy$$perform_5A3B002C7CA27A9DAFD502D73F0A034D55A627421695017752.__file__(/var/lib/jenkins/plugins/travis-yml/WEB-INF/classes/vendor/gems/gems/jenkins-plugin-runtime-0.2.3/lib/jenkins/tasks/build_step_proxy.rb:13)
rubyjit.Jenkins::Tasks::BuildStepProxy$$perform_5A3B002C7CA27A9DAFD502D73F0A034D55A627421695017752.__file__(/var/lib/jenkins/plugins/travis-yml/WEB-INF/classes/vendor/gems/gems/jenkins-plugin-runtime-0.2.3/lib/jenkins/tasks/build_step_proxy.rb)
rubyjit.Jenkins::Tasks::BuildStepProxy$$perform_5A3B002C7CA27A9DAFD502D73F0A034D55A627421695017752.__file__(/var/lib/jenkins/plugins/travis-yml/WEB-INF/classes/vendor/gems/gems/jenkins-plugin-runtime-0.2.3/lib/jenkins/tasks/build_step_proxy.rb)
org.jruby.internal.runtime.methods.JittedMethod.call(JittedMethod.java:121)
org.jruby.javasupport.proxy.JavaProxyConstructor$2.invoke(JavaProxyConstructor.java:224)
org.jruby.proxy.hudson.tasks.Builder$Proxy1.perform(Unknown Source)
hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:770)
hudson.model.Build$BuildExecution.build(Build.java:199)
hudson.model.Build$BuildExecution.doRun(Build.java:160)
hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:533)
hudson.model.Run.execute(Run.java:1759)
hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
hudson.model.ResourceController.execute(ResourceController.java:89)
hudson.model.Executor.run(Executor.java:240)
Here is the generated build script:
#!/usr/bin/env bash
capture_result() {
local result=$1
export TRAVIS_JENKINS_RESULT=$(( ${TRAVIS_JENKINS_RESULT:-0} | $(($result != 0)) ))
}
export CI=1
export CONTINUOUS_INTEGRATION=1
export TRAVIS_JENKINS_RESULT=0
if [ $TRAVIS_JENKINS_RESULT -eq 0 ]; then
echo $ if true; then
true
fi
if test true; then
true
fi
fi
exit $TRAVIS_JENKINS_RESULT
There we can clearly see that the bug is caused by not quoting
and escaping script
from .travis.yml
when it is used as an
argument to echo
. Without that the generated lines are
treated as a shell commands. Which is bad in itself, but in
this case the commands even have an invalid syntax. Which
ultimately leads to failed builds.
The documentation for the Travis Build-Livecycle mentions that after_script
is executed after after_success
and after_failure
.
However this plugin executes after_script
immediately after script
, even before after_success
and after_failure
.
I think this plugin should execute them in the same way as Travis does.
ロジック分離したので、テストも書こう。
Hi,
I don't really know how to use this plugin?
It's installed on my Jenkins server but nothing is happening. How do I get it to run on my jobs?
Thanks a lot
Hi, trying to figure out how to use your plugin.
I'm getting the following message in my jenkins log when I save a build using the .travis.yml builder:
getConfigPage -> /travis_yml_builder/config
This is all it logs, and when I go to reconfigure the build the build step is now gone, so it is removed on saves. Any ideas?
lib と models の使い分けはしたほうが良さそう。
Issue:
.travis.yml parser doesn't inherit job path.
env path is /bin:/usr/bin:/sbin:/usr/sbin
on builds (got this from a build of mine). This path doesn't work with OSX because everything outside of core install is in /usr/local/sbin
so node etc will not be useable unless you specify the full path.
export した環境変数の引き継ぎとか考えるとまとめたほうが楽。
travis のスクリプトにインスパイアな方向で。
I want to use the SSH Agent Plugin in order to allow a composer install
build step to fetch my custom bundles from my private repositories.
The environment variable SSH_AUTH_SOCK
then is present during usual Jenkins build steps. This will make Git use the defined credentials. However during the individual actions like install
and script
defined in .travis.yml
the environment variable is missing.
This prevents me from fully describing the build process in .travis.yml
. Therefore i think the environment variable SSH_AUTH_SOCK
should be whitelisted and be pass the individual Travis actions.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.