Hot answers tagged

18

It supports AccuRev, CVS, Subversion, Git, Mercurial, Perforce, Clearcase and RTC. For all of them exists a plugin and as you probably already know, Jenkins is not limited to only that list, anyone can create a SCM plugin for other options if they want to. Here is the link to the plugins: AccuRev: https://wiki.jenkins-ci.org/display/JENKINS/AccuRev+Plugin ...


16

Shallow clone You can indeed get a shallow clone out of Git using: git clone --depth=1 <url> This will still clone the repo and create a .git folder with the objects, only smaller in size (difference depending on your total file size vs. history size). Git archive You can also use git-archive to extract an archive of the repo: Creates an ...


14

The idea is to put all our sensitive data [...] The meaning of "all" in this sentence should be analyzed very carefully before implementing the solution that you plan. Ansible vault is a very useful tool, but it should be used only to store secrets that are: Specifically needed for the ansible deployments Easily made useless to owners that should become ...


13

GitOps is a technique of using Git to manage infrastructure provisioning and software deployments. This technique uses many of the features of Git such as Pull Requests to manage and trigger deployments, and allows "diffing" (looking at the difference between commits) to view the differences between deployments. DevOps is more of a culture or philosophy. ...


11

The Atlassian website includes a comparison of different workflow strategies available when concerned with Git. More strategies exist, like the one used by Linux Kernel team, but are not relevant to most organisations. The workflow types most commonly used are - Centralized - every change is added using a single branch. Feature Branch - every change is ...


11

Don't deploy your git repo. Develop a real deployment methodology. Even if it's as simple as tarring up an archive (= building an artifact with just the necessary files in it to be deployed) of deployed scripts. Even if you shallow-clone the tip of your source repository, you likely don't need unit tests, documentation, linting profiles, and other ...


11

Let's say you take out the master branch (you can rename develop to master to confuse your team if you like later) and simply use tags for releases either on develop or hotfix branches. You took out a branch, but the difference is just a change in syntax. Change for change sake. Now let's say you actually take out develop with keeping the locked master ...


10

Try this solution: Pull Request Merge Conflict Extension. It helps to resolve conflicts inside the pull request page.


9

In addition to the list in the previous answer, there is also the plugin that integrates Serena Dimensions CM with Jenkins. Some more details about this plugin (from the linked page): The plugin allows a Jenkins job to be associated with a Serena Dimensions CM stream or project, automatically updating the Jenkins workspace with file content from the ...


9

In my automatic jenkins job, launched daily, if there are no changes the git commit command returns 1. That will mark the build as failed. To solve this problem I use these two commands in my shell build step: git add -A git diff-index --quiet HEAD || git commit -m "Jenkins automatic update commit" the first will eventually add all unstaged files in the ...


9

There really is no way to take on your problem with git, which is to deny a developer with access to the code (required to work with it) the possibility to steal the code. This is because as soon as your developer has the code in a readable format (to program on it), he can do with it whatever he wants, anyways. git-crypt has a totally different use, and is ...


8

The problem here is caused by the random salt in ansible-vault encryption. You can hack VaultEditor class to pass the salt to it from an argument in ansible-vault. The random salt is generated in lib/ansible/parsing/vault/__init__.py on this line. It is called from lib/ansible/cli/vault.py where you can easily add the argument for fixed salt. If you do ...


8

The "normal" way of working with GIT is by checking out branches. HEAD is a "pointer" to the latest commit in that branch, and GIT will allow you to commit new changes after that pointer. However, as you figured out, it is possible to check out a specific commit hash, if you want to. In this situation, if you make changes and try to ...


8

The .gitmodules file just records the path and remote URL to the submodule repository. The commit itself is stored in the tree object. You can query it like this: git ls-tree <ref> <path> where <ref> is a reference to some commit (e.g. HEAD, master, a commit SHA sum) and <path> is a path to a submodule. The output looks something ...


7

1) How can I run several different branches on the staging server? Docker 2) How would I set up the DB evolution system to make sure it always has appropriate DB for each branch? This depends on how much you expect your DB to scale. You can get pretty crazy with methods to clone database data but typically you will want a master copy that you do not ...


7

We are planning to use ansible vault in our project to prevent leaking passwords or keys in git. Since you haven't yet implemented anything, you might reconsider this. Using a system like Ansible vault has a number of security downsides: there is no audit trail of who has accessed it when an employee leaves, it is easy for them to take the secret store ...


7

Sit and watch the pipeline run? No, that is not how you work efficiently. Developers push their commits to the source control repository and then the CI/CD pipeline is triggered. Developers may post a well-written pull request anytime they want. There is usually a visual mark representing an "on-going build"/"failed build"/"successful build". Typically a ...


6

In order to get a success, you need to avoid non-zero exit codes. A simple solution would be to change the last line of your script to git commit -a -m 'Changes pushed by Jenkins' || true, but better solutions would parse the output of git-add and only run git-commit when there is something to commit.


6

To answer the question of how to enforce something locally, you can't without doing some very heavy lifting around managing and enforcing the state of every developers workstation, and I'm usually of the opinion that developers should probably be local admins on their development machine because if they aren't then they will just spend their time figuring ...


6

You don't make any mention of the scripting language you want to use, so I will talk specifically about the HTTP requests to the BitBucket API: Assumptions If you have a BitBucket Repository that has three commits in in it the first and the last are failing the build, the middle is passing: 4768815 ❌ 49d7110 ✅ 42d357f ❌ Get the list of commits You can ...


6

Question is there a way to get a single revision from Git without it's history ? To get a repository, no there's no way, mainly because there's no 'revision'. Git store commits, which are changes from previous state. If you want your repository at a specific point in time you have to pull the commit at this time and all it's ancestors or you'll get only the ...


6

Instead of using Travis' deployment features, build the deployment logic in to your normal "test" script(s). For a PaaS this might be as simple as pushing to another git remote if all tests pass, but the sky is the limit.


6

IMHO the problems you're facing are just a side effect of the poor branch strategy you started with: you're effectively plowing new development on develop (i.e. what converges towards the future production code) through the current production code on master. This leads to contradicting requirements and problems since typicaly the future code diverges from ...


6

I can answer bout docker, one of the best practice to use docker is to keep the docker file and the compose files in the same repository of the project, so wherever you clone the project you can build the docker image, and it is good to keep multiple versions of docker compose files for example (prod, staging, dev) so you can build the image and run the ...


6

Use a Git post-receive hook to issue a git pull in the directory you want to keep updated. You might want to mount the directory you want to keep updated locally to the Git server, or execute that command remotely with ssh into Git Bash on Windows, or Powershell. Alternatively have the hook call a webhook and have the webhook execute the git pull. The ...


6

First of all, git is certainly not to blame for merges taking a long time. Clean merging is the hallmark of git, unless it is used in some broken way. So I encourage you to look at what exactly seems to be the underlying problem. If your devs regularly make sweeping changes to the same files, then it's likely more a problem of cohesion/coupling than of the ...


6

Note: this answer shows how to find branches that have been *updated* a long time ago, not branches that have been *created* (i.e., spliced off of some parent) a long time ago. I believe this is what the OP actually wanted (as opposed to the title he chose for the question), as this would lead to good candidates for deletion. You have to recall that a ...


6

Simply keep pushing stuff between the repositories. Git pushes are designed for exactly that. So, if origin is the old repository, and newis the new one, and you want to move new stuff in the master branch from origin to new, then, locally: git checkout master && git reset --hard # to clean up any local changes, optional git pull origin git ...


6

Monorepos have been getting a lot of attention in recent years since google popularized them. If you aren't on a similar scale as google it might not work out as well for you. I've been in a startup that moved to monorepos and we quickly found that: most tools are built with one repo leading to one artifact that gets deployed. You will have to rework all ...


5

You are already building and testing code on each of the pull-request and hot-fix branches. This means that in aggregate, the sum of all branches pending on pull-request are your virtual develop branch. You can create a system when in a test environment, several pull-requests are cherry picked into a temporary branch that is not published to the main ...


Only top voted, non community-wiki answers of a minimum length are eligible