How to update a Windows machine with changes done in a git repository - windows

I am planning to do below
Copy from git repository to a Windows machine each time a commit/ update is made to that folder only. May be something like Jenkins can be used for same but unable to determine how can I do it?
Check commit made to repo ( this I have done)
As soon as commit is made to repo, trigger a jenkins job that will update this change to a windows server ( How to do this?)

If the repository is local, it would be easier to push directly to the Windows machine, assuming it has an SSH server (which Windows 10 2019.09 and more now have)
If the repository is distant, you can configure a webhook in order to call a Jenkins server for a specific job.
See for instance "Triggering a Jenkins build every time changes are pushed to a Git branch on GitHub" by David Luet
Or you can define a Jenkins pipeline that GitLab-CI can execute.
In both cases, your Jenkins job will have to copy the checked out repository.
I would use git bundle to compress the repository into one file (or a simple tar), copy it over the Windows server, and decompress there.

Related

The best way to automate deploy with bitbucket and a remote server (like digital ocean droplet) is with git hooks or pipelines?

I'm working on a project and now is the stage of deployment. I have a droplet in digital ocean and I could just clone my git repository from bitbucket inside this droplet and every time I do a git push to my remote repository I just do a git pull inside my droplet. I really don't want to do this every time, so I searched how could I automate this and I found two ways:
Git hooks
https://macarthur.me/posts/deploying-code-with-a-git-hook
In this link show how to do it (I don't like the fact the after clone my git repository from bitbucket I have also to remote link with my droplet)
Pipeline
Using BitBucket Pipelines to Deploy onto VPS via SSH Access I also find this way that I just do my git pull inside my pipeline
So here is my question: between these two ways, which one is better? The only thing that I don't like in the git hooks way is that every time I clone my bitbucket repository in a new machine, I have to add new remote repository to automate the deployment.

Use git or hg repository tag as version in Azure Pipelines

I want to build a project in Azure Pipelines, but I want to know what the idiomatic way is to obtain the latest tag, latest tag distance, and repo remote path/URL in order to pass those values into the actual build script that is inside the repository.
Previously our build script would invoke hg log -r . --template with a clever template, but we found when moving to Continua CI build server that the build agent doesn't have access to the actual repository during a build, and had to find another way.
I'm assuming the same issue would crop up with Azure Pipelines and haven't quite found the relevant docs yet on artifact versioning.
Many thanks in advance.
For git at least, Azure Pipelines does a full clone of the repo by default, unless you explicitly denote that you're doing a shallow clone (source: https://learn.microsoft.com/en-us/azure/devops/pipelines/repos/pipeline-options-for-git?view=azure-devops).
Deriving the version/tag can be done via normal git commands (i.e. git describe --tags or whatever you prefer), which can then be saved as VSO variables to be accessed in later steps in the same job (see https://learn.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch#set-variables-using-expressions for more info on how to do that).

svn checkout and debugging

I have access to a project on SVN server and need to debug and understand the project. I exported the project as to ensure no changes affect the production or most recent updated version. But I cannot successfully run the ANT build as it looks for the jar files on the SVN server.
Can the project not run locally like this with my machine able to ping the server? I am familiar with MAVEN but not ANT so not sure if the checkout plays an important part in this.
Since this is in version control, you can change things and see what happens.
For example, if you have the jar files in a different location, change the ant script and see if it works.
If you type
svn status
it tells you the status; svn st for short.
If you want to roll back
svn revert [filename]
will put the script back as it was.
You need to do a svn commit to send changes back to the server.
Don't be afraid to try things locally.

How can I use a gitian environment for building a local project?

I'm working on a project (a fork of bitcoin) that has initially been commited to github that uses the gitian build system. At this point I'd like to set up a local environment that allows me to change code and test changes without commiting them to a git repository.
Is there a way to configure gitian to work with local files that don't have a corresponding git repository, taking advantage of the deterministic build environment without the integrity checks?
If anyone else happens to be dealing with the same tools, the answer is very simple. You can specify a local git repository with filesystem path instead of a remote git URL in your .yml gitian descriptor file.
remotes:
- "url": "/home/user/project"
"dir": "project"
Then branch off your project and commit your changes with git.
When running gbuild, specify the branch/commit with --commit project=branchname.

buildr from svn repository

I would to run buildr on my svn repository - to build the files from \src\main\java in the subversion repository with username and password and save it to anther location on my disc.
How can I do it?
if i understand your question correctly, you are trying to setup a contiuous build system. checking out source code is the responsibility of your CI system. it would poll your svn, git or whatever cvs you use for changes and then build it on the configuration you provide.
a free build-server is jenkins (aka hudson). if you want a hosted solution you can go for travis-ci (it's free). or something expensive like atlassian bamboo.
You will have to write an Ruby build script - that when you execute will:
Checkout the source
do the 'buildr'
Commit the built file(s)
http://www.markdeepwell.com/2010/06/ruby-subversion-bindings/
http://blog.carlossanchez.eu/2009/08/18/using-subversion-ruby-bindings/
the easiest way is run external svn commands
task :checkout do
system 'svn checkout ..'
end

Resources