Commit Graph
89 Commits
Author SHA1 Message Date
Jose Diaz-Gonzalez d5ea97f7b0 chore: consolidate on single method to redirect stdout/stderr to /dev/null 2025-11-18 14:07:09 -05:00
Jose Diaz-Gonzalez 4ec6fa3eb0 fix: always set the git rev env var when building an app via git:sync
Closes #6827
2024-09-28 23:47:48 -04:00
Jose Diaz-Gonzalez c4c3edc167 feat: use a long git sha in the git:report output
The previous method sometimes truncated the sha, depending on how the app was deployed. Using the long sha will ensure that the value is stable, regardless of the deployment method.

Closes #6770
2024-03-28 20:22:39 -04:00
Andrew Kvalheim f64cf3bdfa fix: dereference annotated tags
refs/heads/master cannot be updated to an annotated tag per se; the rev
given must first be resolved to a commit. ^{commit} recursively
dereferences the rev until a commit is found.

Resolves #6737 and test failure:

    # bats --filter annotated-tag tests/unit/git_3.bats
    git_3.bats
     ✗ (git) git:sync existing [--no-build annotated-tag]
       fatal: update_ref failed for ref 'refs/heads/master': cannot update ref 'refs/heads/master': trying to write non-commit object 6399bed673f513332f3d5d99e777e0262f42404c to branch 'refs/heads/master'
2024-03-18 17:30:19 -07:00
Jose Diaz-Gonzalez efc35ab104 fix: correctly check if a repository has code or not in git plugin 2024-03-14 10:09:14 -04:00
Jose Diaz-Gonzalez 58772984cd tests: check that the ref has been updated to the correct value 2024-03-14 05:28:37 -04:00
Jose Diaz-Gonzalez 4de97a1094 feat: add ability to only build synced repo if there are changes
Closes #6242
2024-03-14 04:42:28 -04:00
Jose Diaz-Gonzalez a1790d674c fix: use correct variable 2024-03-13 07:48:01 -04:00
Jose Diaz-Gonzalez 50958fc448 refactor: remove git:unlock command
This is no longer necessary with improvements elsewhere in Dokku.
2024-03-13 06:24:30 -04:00
Jose Diaz-Gonzalez 10468ce47d fix: ensure we cleanup the data directory on app deletion
Also use a variable for the clone root dir.
2024-03-13 05:37:06 -04:00
Jose Diaz-Gonzalez ec65d97139 feat: allow generating an ssh deploy key via the git plugin
While this might not seem super intuitive, the key is mostly related to git management, not the ssh-keys we currently use to add/remove access to push to dokku.
2024-01-19 06:30:30 -05:00
Jose Diaz-Gonzalez ef25a9b0d8 refactor: standardize on shorthand for redirecting all output to /dev/null
The shorthand is more prevalent in this codebase, and is something that bash supports, so we should just use the same thing everywhere.

Note that we do not use shorthand redirect in Makefile as shell parsing is a bit different in Make and the shorthand redirect doesn't seem to be properly supported, causing CI errors.
2023-08-05 10:58:57 -04:00
Jose Diaz-Gonzalez 8faa338bd4 fix: ensure users can push from an image-deploy repository and respect deploy-branch
Previously, we created this weird bare repo that didn't do set all the normal git config. This change switches to cloning the local temp directory, fixing the `receive.denyCurrentBranch` property that blocked pushing to this weird bare repo after calling git:from-image or git:from-archive.

Additionally, since we now use a git clone, we set the default branch correctly, ensuring git pushes later on that branch work as expected (and not on master if it was customized prior to app creation).

Closes #5601
Closes #5662
2023-05-28 03:10:45 -04:00
josegonzalez ca04c2dc48 fix: return after showing the contents of the public key file 2023-04-27 22:54:14 -04:00
josegonzalez b11d9bc3a0 fix: correct shfmt issue and fallback to default case 2023-04-11 22:43:37 -04:00
Michael OBrien 2cac8718dd Improve ed25519 + rsa ssh key search and presentation 2023-04-05 18:52:36 -07:00
Michael OBrien 343a98560b Check for both default rsa and ed25519 ssh public key files 2023-04-05 15:34:57 -07:00
Jose Diaz-Gonzalez 98970a597c chore: drop code supporting git versions without worktree support
This was necessary on Ubuntu 14.04 (and maybe 16.04) due to using a version of Dokku older than #2699, so we can safely drop the support here as we haven't supported either in a few years.
2023-03-20 00:51:50 -04:00
Jose Diaz-Gonzalez d333c16347 feat: add ability to deploy images generated via docker save with git:load-image
Closes #4559
2023-01-21 14:05:31 -05:00
josegonzalez b9a9094b46 fix: properly parse arguments for git:status command 2022-12-27 01:42:08 -05:00
Jose Diaz-Gonzalez c3c6e2174a fix: keep track of the source image when building an app via git:from-image
This change fixes issues with ps:rebuild not working as expected - essentially ignoring files in the repo - as well as adds tests.

Closes #5518
2022-12-18 17:57:24 -05:00
Jose Diaz-Gonzalez aca8deb2f2 feat: add git:status subcommand
Closes #5248
2022-11-09 00:04:45 -05:00
Jose Diaz-Gonzalez deeb18b56c fix: set core.bare=true on correct repository path
Closes #5275
2022-08-10 16:51:17 -04:00
Jose Diaz-Gonzalez 49d08a8fb6 fix: pass along failed build status when building from image 2022-04-16 02:44:51 -04:00
Jose Diaz-Gonzalez 1b6861cdbb feat: add plugin trigger for checking if an app has code
This will allow us to short-circuit build processes that would otherwise be triggered due to various commands in Dokku.
2022-04-16 01:40:22 -04:00
Jose Diaz-Gonzalez 548bb6eae2 chore: always use DOKKU_ROOT env var instead of /home/dokku 2022-04-03 13:14:52 -04:00
Jose Diaz-Gonzalez 98e38bd70d chore: update log output for deploy-branch setting
The code was referencing an env var that is no longer used in favor of a git plugin setting.
2022-04-03 13:14:27 -04:00
Jose Diaz-Gonzalez 62a3eff5bb refactor: move apps listing from common plugin to apps plugin
This helps centralize app-related listing fetching.
2022-02-26 00:37:51 -05:00
Jose Diaz-Gonzalez c0b6942392 refactor: set deploy-source and metadata at deploy time
This ensures the value is correct, where previously it was computed based on a file - and therefore did not distinguish between git:from-archive and git:from-image.

Closes #4464
2021-10-09 23:37:53 -04:00
Jose Diaz-Gonzalez db239debf1 feat: expose git-from-archive and git-from-image plugin triggers
This will allow other plugins to create apps on the fly by specifying either an archive url or a docker image.

Closes #4778
2021-09-22 12:32:17 -04:00
Jose Diaz-Gonzalez bc410b4111 fix: recursively sync submodules
Closes #4624
2021-08-06 11:40:28 -04:00
Jose Diaz-Gonzalez 623aa737e0 fix: set correct variable for git repo root 2021-07-12 00:01:01 -04:00
Jose Diaz-Gonzalez 97b0aa3eb8 fix: ensure repository is bare when calling git:sync
Closes #4636
2021-07-11 21:26:14 -04:00
Jose Diaz-Gonzalez b16e5516bf fix: properly quote traps with variables 2021-06-09 01:17:48 -04:00
Milan Vit ca6ac610a2 Fix alternate-tags content & escaping 2021-04-22 13:23:33 +09:00
Jose Diaz-Gonzalez 8660d58eb0 fix: inject alternate label when building from an image
This label is otherwise missing, causing tooling that might want to know about it's pre-existing labels - specifically, docker-image-labeler - to fail to run as expected.
2021-04-16 12:28:56 -04:00
arturs 46c4a93468 chore(plugins): remove unnecessary command 2021-04-14 22:00:28 +03:00
arturs 84daf1ae52 fix(plugins): add touch netrc and remove netrc in git auth fn 2021-04-14 21:41:33 +03:00
Jose Diaz-Gonzalez 4cd064f76c chore: run shfmt against file 2021-03-12 02:53:28 -05:00
arturs f9be3dd974 clean up remove clone folder fn 2021-03-12 09:24:41 +02:00
arturs 888f45254a fix shfmt 2021-03-11 17:59:46 +02:00
arturs 8d11789566 add tests and prompt to unlock 2021-03-11 17:41:39 +02:00
arturs 5ae531ca25 remove unnecessary code 2021-03-10 22:58:40 +02:00
arturs 5debadfde1 remove redundant code 2021-03-10 22:10:44 +02:00
arturs 642dc83702 fix lint issue 2021-03-10 20:31:44 +02:00
arturs 99bc51f106 fix unlock command 2021-03-10 19:29:23 +02:00
arturs 741ea68cac fix formatting according to shfmt 2021-03-07 15:37:40 +02:00
arturs 58dca68fb4 fix has_tty if condition 2021-03-07 15:29:07 +02:00
arturs b1db1e3e6f add git:unlock functionality 2021-03-07 12:28:03 +02:00
Jose Diaz-Gonzalez 5c1a1baf08 feat: implement git:from-archive
The previous tar support lacked the ability to track changes between tarball deploys. Critically, it also failed to be handled correctly when there was _also_ a git deployment done on the app, resulting in odd deployment states depending on the angles of the moon and the sun in the sky.

Rather than try to "fix" this through some hokey mechanism, importing the tar file contents into the git repository is preferred, as then the user can refer to the repository for commit history.

Additionally, we add support for non-tar files (tar.gz and zip), enabling deployments from systems that do not create tar files, such as Github (their tarball url is a tar.gz file).

Finally, this deprecates the tar plugin, and sets it to be removed in the next minor release (in addition to the tags plugin).

Closes #3458
Closes #4207
2021-03-01 08:13:51 -05:00