Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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 ...


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

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 ...


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

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 ...


8

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 ...


7

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 ...


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

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

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

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 ...


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

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 ...


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

So, I know I’ve praised GitLab in my other answer to your questions before, but it really is awesome. They have a an HA solution called GitLab Geo. It’s primarily meant to speed up GitLab usage for geographically distributed teams, but the other main benefit is that the read-only secondary server can be easily promoted to be the master: https://about.gitlab....


5

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.


5

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 ...


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 ...


5

Who is responsible for checking that people don't check in commits that have large files? The same people who are responsible for checking that the commits aren't bad in other ways: everyone. If git is new in your company, make sure that the git education includes this sort of thing. After that, it's up to code reviewers to notice mistakes and correct them. ...


5

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 ...


5

Each tool's code goes into its own repo. for e.g Jenkins Groovy template into a Jenkins repo Ansible YAML playbooks in its own repo (with the roles , tasks , inventory sub directories Cloudformation / Terrform templates in its own repo Docker files in its own 5.. And So on This would help you scale better in terms of process orchestration and maintaining ...


5

What you are specifically after (building from a bare repository on a local filesystem) isn't functionality offered by Docker, and by extension, docker-compose. Docker supports building from a few different URLs, but not bare repositories on local filesystems. You can try a few workarounds: Build straight from Github: docker build https://github.com/docker/...


5

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 commit them, you will be ...


5

Git works for monorepos, but it has a few problems: You have to check out the entire repo. You have to fetch the entire history (generally - shallow clones are an option, but usually not useful in actual development work). Natively, everyone has read+write access to every directory if they have it at all. Google, probably the most famous monorepo user, ...


5

I am not familiar with Python development nor DigitalOcean, so I'll just offer a few pointers: The goal is to automate. Everything. How you achieve that is really up to you, and creating your own tooling is not far-fetched, many do it that way. One concrete and pretty low(ish) hanging fruit is to get a git post-receive hook running which deploys and ...


5

This is not a "strategy". This is a sure way toward chaos. The idea behind "trunk branch", which means having one branch for integration, does not mean that everyone should be pushing their changes to this branch directly. It only means that his branch is the place where integration happens. Why do you even need two branches, Release and Master? What ...


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