Commit Graph

78 Commits

Author SHA1 Message Date
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
Jose Diaz-Gonzalez
0a31f6fe3a feat: add git:from-image support
The new command superscedes the previous tags plugin, and integrates docker image deployment with the general build process.

While `docker image load` is not supported, this otherwise completely handles all previous workflows supported by the `tags:deploy` command, while doing so in a much easier to use interface.

Closes #4296
2021-03-01 02:26:58 -05:00
Jose Diaz-Gonzalez
5804cd11bc chore: standardize popd calls 2021-03-01 00:33:06 -05:00
Jose Diaz-Gonzalez
7a710005a1 feat: implement git:auth command
Refs #4364
2021-02-28 04:47:37 -05:00
Jose Diaz-Gonzalez
64b1a54cad fix: switch to using GIT_DIR environment variable to fix Centos 7 support
Closes #4429
2021-02-25 06:04:37 -05:00
Jose Diaz-Gonzalez
6b90dc70b1 fix: properly handle directory change when cleaning .git directory
Closes #4434
2021-02-25 02:29:36 -05:00
Jose Diaz-Gonzalez
3ae9feba8f fix: keep the git directory for worktree-enabled installations
Git worktrees do not include the full .git directory - only a pointer to the actual directory - when keep-git-dir is set to true, which is incorrect for built containers. This change special-cases that combination, allowing folks on newer git installs to actually keep the .git directory during the build process.

Closes #4415
2021-02-20 17:33:24 -05:00
Jose Diaz-Gonzalez
882889a962 tests: fix shfmt 2021-02-13 02:14:50 -05:00
Jose Diaz-Gonzalez
02a8409114 tests: fix shfmt issues 2021-02-13 02:05:44 -05:00
Jose Diaz-Gonzalez
cca507da6a refactor: avoid pushd/popd to enable commands to pass from root-enabled directories 2021-01-17 19:40:33 -05:00
Jose Diaz-Gonzalez
d58fe853d6 fix: allow updating head 2021-01-17 19:34:07 -05:00
Jose Diaz-Gonzalez
03dc90b4fd chore: re-add output redirection 2021-01-17 19:33:36 -05:00