脚本

Jenkins Copy Artifact parse copied build id

匿名 (未验证) 提交于 2019-12-03 01:12:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm using in Jenkins 2.73.1, in a multibranch pipeline Copy Artifact Plugin to get the last successful artifacts from two other pipelines, see my Jenkinsfile: def branchname = "${BRANCH_NAME}".replace("/", "%2F") pipeline { agent { label 'windows' } stages { stage('get artifacts') { steps { script { parallel('get-backend': { step([$class: 'CopyArtifact', projectName: "backend/${branchname}", target: 'input/backend']) }, 'get-frontend': { step([$class: 'CopyArtifact', projectName: "frontend/${branchname}", target: 'input/frontend']) }) } } }

How to keep a Python script output window open?

匿名 (未验证) 提交于 2019-12-03 01:12:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have just started with Python. When I execute a python script file on Windows, the output window appears but instantaneously goes away. I need it to stay there so I can analyze my output. How can I keep it open? 回答1: You have a few options: Run the program from an already-open terminal. Open a command prompt and type: python myscript.py For that to work you need the python executable in your path. Just check on how to edit environment variables on Windows, and add C:\PYTHON26 (or whatever directory you installed python to). When the

Jenkins Pipeline sh bad substitution

匿名 (未验证) 提交于 2019-12-03 01:12:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: A step in my pipeline uploads a .tar to an artifactory server. I am getting a Bad substitution error when passing in env.BUILD_NUMBER, but the same commands works when the number is hard coded. The script is written in groovy through jenkins and is running in the jenkins workspace. sh 'curl -v --user user:password --data-binary ${buildDir}package${env.BUILD_NUMBER}.tar -X PUT "http://artifactory.mydomain.com/artifactory/release-packages/package${env.BUILD_NUMBER}.tar"' returns the errors: [Pipeline] sh [Package_Deploy_Pipeline] Running shell

Chrome message passing error : Attempting to use a disconnected port object

匿名 (未验证) 提交于 2019-12-03 01:11:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: My chrome extension uses long-lived 'Port' object for message passing between 'content script' and 'popup' page. The 'popup' is able to send a message to the 'content script' event listener. But, the 'Port' object in the 'content script' is unable to send message to the 'popup' page. var port = chrome.extension.connect({"name":"swap"}); // listener for incoming connections chrome.extension.onConnect.addListener(function( incomingPort ){ // listener on incoming messages incomingPort.onMessage.addListener(function( msg ){ if( msg.command ===

Chrome message passing error : Attempting to use a disconnected port object

匿名 (未验证) 提交于 2019-12-03 01:10:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: My chrome extension uses long-lived 'Port' object for message passing between 'content script' and 'popup' page. The 'popup' is able to send a message to the 'content script' event listener. But, the 'Port' object in the 'content script' is unable to send message to the 'popup' page. var port = chrome.extension.connect({"name":"swap"}); // listener for incoming connections chrome.extension.onConnect.addListener(function( incomingPort ){ // listener on incoming messages incomingPort.onMessage.addListener(function( msg ){ if( msg.command ===

Easiest way to compile a lua script (*.exe)…?

匿名 (未验证) 提交于 2019-12-03 01:10:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I just made a small program and I'd like to share it with my friends and family. Which is the best, the fastest and the easiest way to compile a Lua script? I'm working on Windows, so I would need a *.exe. Thanks in advance. 回答1: If you want to turn our Lua script into a .exe, try srlua . 文章来源: Easiest way to compile a lua script (*.exe)…?

curl: (26) couldn't open file

匿名 (未验证) 提交于 2019-12-03 01:10:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am getting this error, when I am trying to call a box api through curl. curl: (26) couldn't open file Can't find why! I am calling this api with a correct file name- curl https://upload.view-api.box.com/1/documents \ -H "Authorization: Token YOUR_API_TOKEN" \ -H "Content-type: multipart/form-data" \ -F file=@A_correct_file_name I have seen all the three already asked questions but 2 of them are unanswered and one is specific to facebook. cURL error 26 couldn't open file Fatal error: Uncaught CurlException: 26: couldn't open file "" thrown

subprocess.Popen: mkvirtualenv not found

匿名 (未验证) 提交于 2019-12-03 01:10:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm using virtualenvwrapper in my deployment. To setup new environments, I'm running a python script, which contains all needed steps. The setupscript includes: cmd = 'mkvirtualenv %s --no-site-packages' %( 'testname' ) head = subprocess . Popen ( cmd , shell = True , stdout = subprocess . PIPE , stderr = subprocess . STDOUT ) for line in head . stdout . read (). splitlines (): print line The output is: /bin/ sh : mkvirtualenv : not found How can I correctly use virtualenvwrapper within my python script? EDIT: The following code

How to check if running as root in a bash script

匿名 (未验证) 提交于 2019-12-03 01:10:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm writing a script that requires root level permissions, and I want to make it so that if the script is not run as root, it simply echoes "Please run as root." and exits. Here's some pseudocode for what I'm looking for: if ( whoami != root ) then echo "Please run as root" else ( do stuff ) fi exit How could I best (cleanly and securely) accomplish this? Thanks! Ah, just to clarify: the (do stuff) part would involve running commands that in-and-of themselves require root. So running it as a normal user would just come up with an

How to turn an AppleScript path into a posix path and pass to shell script?

匿名 (未验证) 提交于 2019-12-03 01:10:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: set theFile to path to replay_folder & "ls.txt" I simply want this path to be the path of replay_folder and ls.txt In the shell script line I want the same thing. do shell script "cd " & replay_folder & " /usr/local/bin/ffmpeg -f concat -i ls.txt -c copy merged.mov" I get this path with the shell script Macintosh HD:Users:BjornFroberg:Documents:wirecast:Replay-2017-03-17-12_11-1489749062: But I want this /Users/BjornFroberg/Documents/wirecast/Replay-2017-03-17-12_11-1489749062/ The full code is: tell application "Finder" set sorted_list to