feat: add new local_archive
update code strategy
#3906
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello!
Description
This adds a new
local_archive
update code strategy which creates a tar from the local repository that is then streamed to the remote server and unpacked. This removes the need for the remote server to fetch the changes from the remote repository.Motivation
We have a privately hosted Gitlab instance, and we deploy to cloud servers via our ci/cd pipelines. This has been working just fine in the past. However, we've recently encountered an issue where the external server is not able to connect via ssh to the internal Gitlab server---which means the
git remote update
fails and our deployments are failing. The root issue is non-trivial and our IT personnel has been working with Cisco techs for a couple of weeks now, but they still have not been able to fix the issue.I temporarily fixed our deployments by overriding the
deploy:update_code
task to simply use the local repository in the pipeline which works perfectly:I figured it would be a good idea to contribute this upstream in case anyone else would like to use this strategy :)
Thanks!