There is a need to upload the script from local to server and then run over there. can someone please let me know how to can achieve this.
Just copy it from local machine to the "server" using SCP for Linux or SMB for Windows, once done you can log into the server over SSH or RDP and execute your JMeter test in command-line non-GUI mode
If you want fully unattended/automated execution consider the following:
Setting up a version control system, i.e. use Github to store your script(s)
Configure the Webhook to trigger an action when you commit the file
Install Jenkins on the server
Configure Jenkins to listen to the Github Webhook and when it happens kick off a build running a JMeter test
This way whenever you add new or update existing script it will automatically trigger the job which will execute the test, check out How to Integrate Your GitHub Repository to Your Jenkins Project article for detailed steps if needed.
Related
A Bash script is CRON-ed to run on server A every day and connects to a remote MySQL database to run a query, dump the results to a file, and send an email.
In my freestyle project, I have set up my build to pull that Bash script from my Github repo and execute it. Jenkins starts it but the script fails. Based on my discovery,
Jenkins runs my script in a clone of my repo on its own server, not on server A where it is CRON-ed
The above explains why my shell script fails to find the mysql client executable
Based on my understanding, this means that my freestyle project needs to connect to server A where my script is CRON-ed to run like so
ssh serverA_username#serverA #using ServerA user key
SCRIPT="$WORKSPACE/shell/bash_script_name.sh"
sh -x $SCRIPT
Am I correct? Any pointers welcome. Thank you!
I'm creating a Rundeck job which will be used to rollback an application. My .jar files are stored in a Nexus repository and I would like to add an option to Rundeck where I can choose a .jar version from Nexus and then run the rollback job on this.
I have tried using this plugin: https://github.com/nongfenqi/nexus3-rundeck-plugin, but it doesn't seem to be working. When I am logged in to Nexus I can access the JSON file listing the artifacts from my browser, but when I am logged off the JSON file is empty, even if the Nexus server is running.
When adding the JSON URL as a remote URL option in Rundeck like the picture below, I get no option to choose from when running the job, even if I am logged in to Nexus, as shown by picture number 2. Is there a way to pass user credentials with options, or any other workaround for this?
I would recommend you to install Apache / HTTPD locally on your rundeck server and use a CGI script for this.
Write a CGI script that queries your Nexus3 service for versions available on the jar file, and echo the results in JSON format.
Place the script in /var/www/cgi-bin/ with executable bit enabled. You can test it like so:
curl 'http://localhost/cgi-bin/script-name.py'
In your job you can configure your remote URL accordingly.
I find using local CGI script to be much more reliable and flexible. You can also handle any authentication requirements there.
When i want to update my app running on server, i should ssh to server, cd to app folder, execute git pull, then i should run npm build, next i should restart the server. How to automate this with bash script or something? Is it the case for which jenkins stands for (or some other tools)?.
But how to do this with simple bash script or something?
I dont need the rebuilding of an app every time i push to git, only when i need to update and restart everything.
Also it there a way if build take a lot of time notify me by email that build success?
For now eery time i do update for remote app, i should wait with open terminal when it builded and only then i can close the sshed terminal. Some time builds take a lot of time.
You can simply script those commands, and put that script on your server.
That way, all you need to do is to ssh to that server and call that script, which will execute those commands on demand.
Is it the case for which jenkins stands for (or some other tools)?
Not in this case, since it is purely on demand: you can execute the script through a simple ssh call, no need for Jenkins.
I am trying to automate deployment on the remote server.After doing some investigation I came across two approaches:
1.Using expect
2.Using sshpass
I want to run a script file with deployment steps,without manually entering any password or any other input parameter required by my script from command line.
Please suggest me the right approach.
I went through Ref1 and downloaded expect5.45.tar. Can anyone please let me know what should I do next. I am not able to install as I don't have admin rights.
Would Jenkins not suite this questions. Jenkins will allow for script control as an environmental file as well as control over the remote host (via the publish over ssh plugin).
This would allow you to automated your process.
Here is my problem:
I have a python build script building a .air package and deploying it on a server. If I run this script from a cmd.exe window, there is no problem, the files are correctly created and deployed.
But I would like to use Bamboo to be able to build my app everytime I commit/push changes. I configured it but have a serious problem: the .air package is created but the deployment (with a fabric script) doesn't finish... I noticed that the process is launched by 'Administrator' in a cmd.exe and by SYSTEM trough Bamboo. I think that this is the problem (maybe SYSTEM cannot find the ssh host or whatever), so I wanted to know if someone knows how to change the user executing the script to 'Administrator'.
Yes, you can change the user that your bamboo server runs as. I recently posted an answer with details on how do just that in Windows Mercurial global keychain . All the documentation for the windows stuff in the wrapper file can found at http://wrapper.tanukisoftware.com/doc/english/props-nt.html .