Jenkins does not getting the latest commit - github

I have been trying to configure jenkins with github. Basically when there are no files in workspace (the first build) everything is going fine and jenkins fetches the latest changes. But when I trigger another build (after push into github) the latest change aren`t fetched.
Can you please give me some advice on this?
Thx in advance.

Check the clock on the machine that runs jenkins. I experienced a similar issue where my build server was 2 minutes time difference off the source repository server, latest changes were not picked up immediately but with delay.

Related

unable to delete build completely

I have manually deleted a CI build that uses the MS Hosted ubuntu Agent as there was no Cancel option that was showing up. The elapsed time I think shows the build was deleted, but I see that the Hosted Agent continues to show that the build is in progress.
This is the first time I am running in to this situation. What is the best way to abort this build. I tried using the APIs here and here but that does not seem to help
Thanks
After investigation, there is a recently event of availability degradation of Azure DevOps, which affected these services and it has been resolved now.
If you want to know more information, please click here: https://status.dev.azure.com/_history.
Please check that your Cancel option is back to normal.

Script Versioning

I am working on a very large script and I stumbled across one issue already, how can I version the scripts? (ex) superscript.ps1 is on version 2 but if a user is using version 1 of the script it will notify them during the initialization of the script.
basically I can't restrict where they are pulling it from, so I thought about keeping a "CurrentVersion" File on one of our servers and keep the version number in it but how could I get the running script to check that file and error out?
CurrentVersion.txt
superscript1, 2.0
superscript2, 2.5
script1, 10.2
I just can't find what would be a plausible way of actually implementing something like this, any help or pointing in the right direction would be appreciated.
Honestly I think the way to go here is to stop doing development in the central folder where the production version of your script lives.
Start using git, do development on local machines or dev boxes or something, in a new branch. Merge to master when you're done and either copy master to the central location or pull it from a centralized repo (GitHub, Bitbucket, GitLab).

Reduce Time for Checking Out Code in Visual Studio Online

I'm trying out VSO and it's taking over 2 minutes to sync with a GitHub repository. It appears that it's checking out the whole thing on every build. I made sure that the "clean" box is unchecked but it had no effect.
Any ideas on how to get it to cache the source or is this even possible in VSO?
Each build in VSO uses a new VM that is spun up just for your build. Short
of hosting your own Build Server connected your VSO, I don't think it can be avoided.
Unless there are ways to speed up a the process of downloading the code from a git repo, I think you're stuck.

sonar+github integration

I want to enable sonar with git but is it neccesary that first pull the project from git repository using hudson or something else and then sonar will analyse the code periodically on hudson .am I right means my steps :
1.Pull project from git using hudson.
2.Sonar on hudson will analyse the code and send the updates.?
or directly we can use git+sonar how it works ,can anybody guide me to get it work.
Yes, you need first to pull your project from GitHub, and then launch a Sonar analysis on your local copy (Sonar needs the file to exist on the file system to be able to analyse them).
So you can pull your project manually or obvioulsy using a CI server like Jenkins/Hudson.
The good news, yesterday (2015-07-08) SonarQube has launched a Github Pluging, every time a pull request is submitted, the CI system launches a SonarQube preview analysis.
Reference:
http://www.sonarqube.org/github-pull-request-analysis-helps-fix-the-leak/

How does capistrano "run_locally" work with branches?

I have a capistrano task that uses "run_locally" to compass compile/compress my css files and then upload them to the server.
Is it going to be smart and run that on the git branch that's getting deployed, or will it just run on the branch that I currently have in my working copy?
I'd want it to run on the branch that's getting deployed regardless of what I have checked locally. If it's not smart about this would I instead need to run_locally a git checkout on the branch that's getting deployed before running the compile command?
It runs on you current local code. So it matters what code is checked out there. As you mentioned you can try to ensure that you run the version you are going to deploy.
Better would be to do the compilation work on the server.