Trigger Build in Jenkins By EMAIL - email

I am Currently using Jenkins in Windows 7 .
I have recently ran some build in jenkins . I am Able to run the build by SVN Post commit .
Now i have to triiger the build in Jenkins by email.
I am a windows user and as per my knowledge Sendmail and qmail agents have to be used to trigger build in jenkins by email.But these are for Unix .
Or is there any way i can install sendmail on my windows machine and then perform the trigger.
I am A windows user and so if any plugin is there to trigger builds in jenkins .Please let me know.
thank you

Use a simple free mail client (say, Mozilla Thunderbird) that would filter trigger e-mails in the appropriate folder. Monitor the file system location of that folder with FSTrigger Plugin.
You do not need to read the e-mails in the folder. What you do is this: for each build create an e-mail folder, create a filter that sorts e-mails by subject (subjects would be something like "Trigger [job-name]" ). And monitor modifications to those folders via the plugin. My Thunderbird folders, for example, are stored locally in C:/Users/[user_name]/AppData/Roaming/Thunderbird/Profiles/9nby4v95.default/Mail/Local Folders/ But you can configure Thunderbird to put them wherever you want.

I wrote the following Jenkins plugin about 3 months ago, to do just this:
https://wiki.jenkins-ci.org/display/JENKINS/poll-mailbox-trigger-plugin
https://wiki.jenkins-ci.org/display/JENKINS/Poll+Mailbox+Trigger+Plugin.
Check it out, read the documentation, let me know if this solves your problem.
All documentation is on gitHub now:
https://github.com/jenkinsci/poll-mailbox-trigger-plugin

Related

Jenkins 2.273.1 "Editable Email Notification" sending emails with "$PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!" content

I was using Jenkins 2.222.x version and Editable Email Notification plugin to send emails about status of the job. It was working fine.
Later I updated my Jenkins version to 2.273.1, and I am still able to receive emails but like this:
Environmental variables are not replaced with actual data.
What did I miss?
I found the answer here: https://issues.jenkins.io/browse/JENKINS-64659?jql=text%20~%20%22Check%20console%20output%20at%20%24BUILD_URL%20to%20view%20the%20results.%22
Solution is to update "token-macro" plugin to latest version in Jenkins and restart Jenkins.

Browse file system in Azure Devops

Is it possible to browse the file system in Azure Devops. Like when using SSH to connect to a server? Or if it's possible to browse using Explorer.
It would really simplify things if I could see what files were created and where they end up after builds.
Now I don't feel I have any way to know which files ended up where after the builds are done.
Thanks!
I don`t think so. You may add build steps (Build and release tasks - Utility) and create cmd or bath file to browse the file system of the build servers.
As alternative way, you may use your own build server (Self-hosted agents) on Azure VMs and you will have the full control.

Fail/pass Jenkins job by email notification

We have an in-company system for creating production builds, and I need to create a Jenkins job to automate those builds.
There is a way to automate the launch of production build. But you can only know the results of the build by an email notification. Furthermore, you can only subscribe to notification using your personal domain credentials, i.e. the same login/pass that you use to log into your computer (and the password changes every month).
So now, Jenkins job is considered "pass" as soon as the build launches, and not when it actually finishes.
I wonder how to make Jenkins pass/fail the job with the given restrictions.
Additionally, I want to avoid:
hardcoding my personal credentials anywhere,
depending on my or anyone else's personal computer being turned on.
Ideas?
I'm not aware of any Jenkins plugin that is capable of receiving e-mails.
If you can manage to store the notifications' content in a file you could use the
Text-finder Plugin in the Post-build Actions of an additional monitor job that runs on a regular basis.
Have a look at Monitoring external jobs, too, whether this is useful for you.
UPDATE:
There is actually a plugin that receives e-mails: the poll-mailbox-trigger-plugin. Install it and do the following:
Create a new Freestyle project named e.g. Build Status Mail Monitor
Build Triggers → [✔] [Poll Mailbox Trigger] - Poll an email inbox
configure as desired
Build → Add build step → Execute Groovy script
◉ Groovy command: add code to change build launcher job's status

Need help to configure jenkins to send report links on mail

I am using Jenkins to trigger my build., Jenkins is hosted on AmazonEC2. The complete build process is mentioned below:
1. Jenkins checkouts the latest build from GiTHub.
2. Jenkins run the complete build & I am getting Build Success Message.
3. After the process is completed jenkins creates some HTML reports in the jenkins user on Amazon EC2.
Now I need to send that particular report link in mail, how would I do that? Is there any plugins available by which I can manage all the reports generated for a single day and can keep the reports of last 15 builds or something.
What I can think of is, whenever a build completes, there should be a process or shell script should run which will copy the reports from jenkins user to some apache available sites and then that report can be sent on email.
please let me know, If I am thinking in the right direction or there is any other way to do the same?
Any help would be appreciated.
You can use Jenkins plugin "Email-ext plugin" to send emails.
If you can get the report into your workspace. then, you can
write a mime message something like this in the plugin.
msg.setSubject("Mail Subject");
def reportPath = build.getWorkspace().child("report.html")
msg.setContent(reportPath.readToString(), "text/html; charset=utf-8");

How to deploy artifacts of TeamCity to Amazon EC2 Server

We decided to use AMAZON AWS cloud services to host our main application and other tools.
Basically, we have a architecture like that
TESTSERVER: The EC2 instance which our main application is
deployed to. Testers have access to
the application.
SVNSERVER: The EC2 instance hosting our Subversion and
repository.
CISERVER: The EC2 instance that JetBrains TeamCity is installed and
configured.
Right now, I need CISERVER to checkout codes from SVNSERVER, build, if build is successful, unit test it, and after all tests pass, the artifacts of successful build should be deployed to TESTSERVER.
I have completed configuring CISERVER to pull the code, build, test and produce artifacts. But I couldn't manage how to deploy artifacts to TESTSERVER.
Do you have any suggestion or procedure to accomplish this?
Thanks for help.
P.S: I have read this Question and am not satisfied.
Update: There is a deployer plugin for TeamCity which allows to publish artifacts in a number of ways.
Old answer:
Here is a workaround for the issue that TeamCity doesn't have built-in artifacts publishing via FTP:
http://youtrack.jetbrains.net/issue/TW-1558#comment=27-1967
You can
create a configuration which produces build artifacts
create a configuration, which publishes artifacts via FTP
set an artifact dependency in TeamCity from configuration 2 to configuration 1
Use either manual or automatic triggering to run configuration 2 with artifacts produced by configuration 1. This way, your artifacts will be downloaded from build 1 to configuration 2 and published to you FTP host.
Another way is to create an additional build step in TeamCity for configuration 1, which publishes your files via FTP.
Hope this helps,
KIR
What we do for deployment is that the QA people log on to the system and run a script that deploys by pulling from the team city repository whenever they want. They can see in team city (and get an e-mail) if a new build happened, but regardless they just deploy when they want. In terms of how to construct such a script, the team city component involves retrieving the artifact. That is why my answer references getting the artifacts by URL - that is something any reasonable script can do using wget (which has a Windows port as well) or similar tools.
If you want an automated deployment, you can schedule a cron job (or Windows scheduler) to run the script at regular intervals. If nothing changed, it doesn't matter much. I question the wisdom of this given that it may mess up someone testing by restarting the system involved.
The solution of having team city push the changes as they happen is not something that team city does out of the box (as far as I know), but you could roll your own, for example by having something triggered via one of team city's notification methods, such as e-mail. I just question the utility of that. Do you want your system changing at random intervals just because someone happened to check something in? I would think it preferable to actually request the new version.