I need run some Ant tasks on remotely host over remotely host with VPN. Can I use sshexec or not.
For example:
On Teamcity server I run sshexec task to gateway host with VPN and I need run tasks on another host in this VPN.
Thanks for answers.
Ant has sshexec tasks. Note that this needs third party libraries (jsch.jar) as listed here
Related
I have the following setup:
Microsoft TFS with jobs and pipelines
A VM under Virtual Machine Manager (VMM) which has Windows10
The job from TFS can connect to VM to run commands remotely
My goal is to automate test case when there is no network connection inside the VM (mainly no internet connection) to verify that some features of my software under test behave as expected and do not use network to achieve my test calls.
Currently I use powershell on target machine to run scripts remotely in the VM https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/deploy/powershell-on-target-machines?view=azure-devops .
I made research online already but I didn't find something specific to TFS and VMM.
Perhaps it is worth it to mention that I found this script online:
#!/bin/sh
ip link set ens32 down
sleep 20
ip link set ens32 up
But the script was written in a Linux and SSH connection context, which isn't the same as my environment.
Is there anyway to achieve automation of networking disconnection remotely and then turning on again the network connection state ? (simulation tools are also ok for me if they do achieve my goal and can be integrated in TFS pipeline or VM tools installation).
Is it possible to run a TeamCity server instance in a Linux container, and then run a Build Agent in a Windows container and have it connect?
The TeamCity Server just the central server, where Agents push the results.
The TC Server is responsible for to add to queue, send a task to Agent, wait, collect the result.
The Agent is responsible for executing Task, send the result to the server.
doesn't matter, where was run TC or Agent, important point is that if your configuration needs the Windows server then it can be run only Agent on the Windows.
conclusion.
The TC Server can be run as on Linux, as on Windows OS's
The TC Agent also can be run on Linux and OS, but:
If your configuration using the Windows component's, then the Configuration will add restrict OS type in the Agent Requirements
If you have few configurations with few OS type's just run few Agents on the some OS's
We are currently running several Projects on several Servers. For our workflow we installed Telnet to communicate with theses servers. More than this, we run the Build/Make mechanism (own development php) on theses servers.
Now we like to introduce a CI mechanism to this. Therefore we installed a central Jenkins application, from which we like to trigger all these builds. Our standard way is to open a telnet connection an trigger the build command on shell. Now we like to adopt this mechanism and bring it to Jenkins.
Is there a possibility to open a Telnet connection via Jenkins?
Installing a slave Jenkins on the remote Servers is a not as much preferred option, because we don't like to install more Software on the server as necessary.
Yes, It is posible, you can use pipeline to include groovy program that use telnet commands, it could be one posibility another you can use ssh commands in a free style job.
I want to build my maven project in Jenkins and copy all the the jar files to a remote Unix machine.
Also I want to connect to a LDAP data Store and start the services and test if the services are up and running
Basically I want to do the following tasks after my project is successfully build in Jenkins:-
1)Copy current version of my project to designated machine and location
2)Copy configure to connect to a designated integration test DS
3)Start the services in my project
4)Test that it is running.
Can I achieve this by Publish over SSH plugin provided in jenkins??
Or Shall I create some scripts which can automate the above tasks.The reason I am asking this is because I am not very familiar with Jenkins and Unix scripting.
Is there any good approach to do this task.
Thanks in advance.
Ansia
The Publish over SSH plugin will allow you copy files to remote server and execute arbitrary commands on the remote server.
Question is - do you know how you would achieve the following on the remote server?
2)Copy configure to connect to a designated integration test DS
3)Start the services in my project
4)Test that it is running
If yes, just enter those commands into Publish over SSH configuration. Or provide a script to be executed.
If you don't know how to achieve that, then that's a separate question.
Yes, you can use the publish over ssh plugin to copy the jars, and execute a script which launches your services. Take a look here to see how to launch a script "in the background" so it does not get killed when the session ends or to avoid blocking the Jenkins build by making it wait for the script to finish executing
Can't say much about LDAP as I haven't used it but depending on your needs I guess you could create a basic helper-jar with spring-ldap or any other similar library.
my dev server is installed in jboss aplication server(linux). is it possible to stop manually dev server from jenkins. whenever developer wants depolyment at that time only i have to stop server and deploy artifacts in to dev server.All these operations is possible from jenkins.i already have scripts to stop and start the server. But i dont know how to configure in jenkins.
If your jenkins is also on linux, use "Execute shell" build step and in there connect to your server and execute command:
For example:
ssh user#server "remote_script_command"