I want to execute the curl command in Shell Script with Jenkins.
Executing Shell Script alone from remote works very well.
However, running shell scripts through Jenkins will result in an infinite load as shown below.
Let me know how to fix it.
myShellScript
#!/bin/sh
echo "curl Start"
curl --request GET 'http://127.0.0.1:8080/server/someting/work'
echo "curl End"
================================================
my jenkins Execute shell script on remote host using ssh
==================================================
Jenkins Log Result
It's been like that for an hour, like the image below.
Connection logs do not exist in the URL.
And
ssh account#my-test-server "/home/account/folder/myShellScript.sh"
It worked well when I executed the command as above.
Please help me.
Related
We have all the scripts available in github and need to execute the shell/python scripts by login into a different server.
Sample script: hello.sh
echo "Hello World"
echo "Printing text with newline"
echo -n "Printing text without newline"
echo -e "\nRemoving \t backslash \t characters\n"
cp a b
As we can use ssh operator and can only execute commands but how to run the complete script reading from git hub and execute in different unix server.
We cannot copy the scripts into unix server and need to execute the scripts by reading from git hub. Is there any way to do it in Airflow.
You can use curl to get the script from github and then execute it (if you trust it)
bash <(curl -sL https://raw.githubusercontent.com/path/to/your/script) [script-args...]
I'm having the following issue. When I execute this command sfdx profile:field:add -n "Account.Test" -m re -p "Test" from a Bash script, it's all fine.
However, when I try to execute the following:
sfdx profile:field:add -n "Account.Test" -m re -p "Test Test"
I get this error: 'C:\Program' is not recognized as an internal or external command
When I run the same command in the terminal, it works fine. It's just when I put it inside a bash script that this error happens.
Currently running this on Windows 10.
I'm 100% sure it's the space in that last parameter, I am just not sure how to get around it. Can anyone help?
I am running an azure devops pipeline to install and configure ELK. So there is a shell script which executes all the commands to install ELK and configure using curl commands. But at the end of the file last 4-5 commands are not executed and I can see truncated scripts in the log.
2020-06-12T08:56:10.2856017Z > echo "Registering the azure reposi
2020-06-12T08:56:10.2856671Z > curl -X PUT -uadmin:"***" "https://10.XXX.X
2020-06-12T08:56:10.2856981Z > echo "Setting up snapshot backup poli
2020-06-12T08:56:10.2857523Z > curl -X PUT -uadmin:"***" https:
2020-06-12T08:56:10.2857807Z > echo "Finished configuring Kibana"
I have also swaped these scripts with other scripts above it which were executed successfully but again the scripts which were successfull now starts getting truncated. I am not sure what I am doing wrong. Kindly help. Thanks in advance.
I still don't have the answer but I was able to resovle this issue by moving all the curl commands in a bash script file and executed it.
I am trying to export ROS_MASTER_URI from a shell script and then launch roscore. In my .sh file I have:
roxterm --tab -e $SHELL -c "cd $CATKIN_WS; $srcdevel; export ROS_MASTER_URI='http://locahost:1234'; roscore -p 1234"
When I do this, however, I get the following error in the roscore tab:
WARNING: ROS_MASTER_URI [http://locahost:1234] host is not set to this machine.
When I echo the ROS_MASTER_URI in this tab, it says that it is localhost:1234, which is correct. When I manually execute these commands, it works correctly and roscore launches without any issues. I am not sure why it does not work when launched from a bash file.
It was just a typo- missed the l in localhost. All working now.
my problem is that i try to execute shell script to copy created files from msbuild to AWS s3 via Jenkins.
Then i add new build step "Execute Shell" and set to execute shell script by command: sh publishS3.sh nothing happens and files doesn't apper in s3 bucket.
my Jenkins use Local Windows Server.
Then i try to execute the shell script by typing sh publishS3.sh in Jenkins local directory all ok , files was copyed secessfully to s3 bucket , but if i try to do it from jenkins nothing was happen. My publishS3.sh script is:
#!/bin/bash
aws s3 cp Com.VistaDraft.Common.dll s3://download.vistadraft.com/MVP
i was tryed to to check witch output i receive after execute by adding at the end command > output.txt but Jenkins generate an empty file. If i try to do the same locally i was receive an message that i secessfully copyed files to s3. i Set the shell script path of jenkins C:\Program Files\Git\git-bash.exe and using git-bash.exe locally too. Maybe whom know where is a problem ? Please suggest.
You could try to add -ex in the first line of the script to allow you to see what it's doing and ease the debugging:
#!/bin/bash -ex
# rest of script
Make sure the aws tool is in the PATH of the environment where Jenkins runs your script. It might help if you specify full path to the command.
You could put which aws in your script to see what's going on.