76 Commits

Author SHA1 Message Date
Jose Diaz-Gonzalez
04b2643b4f chore: remove ansi escape characters that dropped the remote: prefix in deploy output
Closes #7728
2025-07-04 02:36:42 -04:00
Jose Diaz-Gonzalez
d2cf2e7b91 fix: popd out of tmp directory after a git push-based deployment
Without this, we end up with PWD issues as the tmp directory is removed automatically after a build.

Closes #6771
2024-03-28 20:53:31 -04:00
Jose Diaz-Gonzalez
76a979e139 chore: remove ARM support
Building/testing for ARM does not happen often - the only runtime environment is Raspberry PI, which supports ARM64 - and complicates support for a ton of features. Aside from that, CI runs are much longer for ARM Dokku images, often reaching 15-20 minutes or just timing out completely.

Rather than support an architecture that doesn't have much usage by maintainers and has a lot of maintenance burden, we're removing the platform.
2023-10-15 20:25:09 -04:00
Jose Diaz-Gonzalez
df24091459 chore: remove debug logging from git plugin
This was accidentally included during a previous bugfix.
2023-09-07 01:30:50 -04:00
Jose Diaz-Gonzalez
d3441b7f7e fix: properly handle tag and branch pushes 2023-08-20 11:39:19 -04: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
577aafb683 chore: remove deprecated git functions 2023-02-12 13:09:20 -05:00
Jose Diaz-Gonzalez
7f2a66df88 chore: remove deprecated app functions
These were deprecated in 0.20.0 and are unused in Dokku's official codebases.
2023-02-12 13:02:23 -05:00
Jose Diaz-Gonzalez
1238c8d7e0 feat: allow users to enable herokuish usage on arm/arm64 platforms
While the majority of buildpacks do not work on non-amd64 platforms, this will at least allow developers the option to choose when to override this setting.
2022-11-24 14:43:47 -05:00
Jose Diaz-Gonzalez
abe06b3d84 docs: fix the error message to be slightly more readable 2022-06-25 01:16:53 -04:00
Jose Diaz-Gonzalez
3db3bfb150 feat: use pack as default builder for arm64 servers
Herokuish is not and will never be supported on arm servers, so attempting to use it will only fail builds.

Also fail when trying to default to herokuish on armhf instances. We can't default to pack as it's just not built for armhf/arm (only arm64).

Closes #5113
2022-05-29 16:41:42 -04:00
Jose Diaz-Gonzalez
ba7c685e11 fix: pass failed exit codes around as necessary 2022-04-16 02:25:48 -04:00
Jose Diaz-Gonzalez
68c0d7e964 feat: warn and exit non-zero when attempting to rebuild from a non-existent branch
Closes #4898
2022-04-16 01:40:22 -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
e197aa62d1 fix: use correct env var for app name when setting initial DOKKU_DEPLOY_BRANCH propery 2022-04-03 13:11:52 -04: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
6d40d52d7d feat: add ability to specify a custom build directory for an app 2021-07-10 14:57:55 -04:00
Jose Diaz-Gonzalez
1ec71cd509 refactor: switch detected builder so first one wins
Also rename internal cnb references to pack (where possible).
2021-02-28 16:19:41 -05:00
Jose Diaz-Gonzalez
353438dbd3 feat: allow builders to be detected based on repository contents
Rather than hardcode two builders, allow builders to specify a `builder-detect` trigger. This trigger can be used to specify if the builder should or should not be used for an application. Each builder takes stdin and can decide if it wants to emit it or emit it's own image source type.

If the final value is empty, then Dokku will default to herokuish (and cnb once that is stable). In addition, a future change may allow users to manually specify a builder in the case they wish to override the choice selected by Dokku.

This change enables users to build custom builder plugins and have those plugins used for building an image asset. By way of example, an enterprising user could create a `builder-lambda` based on lambci, and then pair this with a scheduler plugin that updates a lambda function on AWS. Alternatively, a user might decide they wish to place their Dockerfile in a specific directory for their applications - such as an `_infrastructure` directory - and create a plugin to override how that is detected within Dokku.
2021-02-28 16:19:41 -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
9d55e37687 Merge pull request #4297 from dokku/git-sync
Add support for cloning/syncing from a remote repository
2021-01-20 13:36:15 -05:00
Jose Diaz-Gonzalez
be95a619bc fix: allow git pushes to apps that already exist but have old names
Users should still renamed their applications as this workaround will be removed at some point.

Closes #4308
2021-01-17 22:06:30 -05:00
Jose Diaz-Gonzalez
31332a5061 fix: move fn-git-create-hook to internal-functions
Its unused elsewhere.
2021-01-17 17:00:33 -05:00
Jose Diaz-Gonzalez
08fdfd1e38 feat: drop internal calls to verify_app_name 2020-12-27 15:14:11 -05:00
Jose Diaz-Gonzalez
36215828f1 feat: always initialize git repository
This fixes issues where alternative tools that don't trigger the init via sshcommand - such as git-http-backend - are not able to setup applications correctly.

Note that those apps could always manually trigger git:initialize if desired, but if the app already exists, then this should already _just work_ without that extra initialization.
2020-12-15 01:42:10 -05:00
Kazuhiro NISHIYAMA
98c81513aa Accept first pushed branch as deploy-branch
And set to DOKKU_DEPLOY_BRANCH.

Idea from https://github.com/dokku/dokku/pull/4167#issuecomment-717607136
2020-12-08 23:15:11 +09:00
Jose Diaz-Gonzalez
a8a6d0595b refactor: deprecate git_deploy_branch in favor of plugn trigger 2020-04-18 18:21:46 -04:00
Jose Diaz-Gonzalez
051a329873 feat: avoid deprecated functions 2020-03-10 18:19:31 -04:00
Jose Diaz-Gonzalez
e67b96780d refactor: unify command declaration across codebase 2020-02-10 01:40:30 -05:00
Jose Diaz-Gonzalez
1cb586b2e7 refactor: standardize command naming
This standardization makes it somewhat easier to read stacktraces as the command names are all uniform, so it will be slightly easier to scan trace output.
2020-02-09 22:41:39 -05:00
Jose Diaz-Gonzalez
cb281e17e6 fix: correct shfmt issues 2019-09-17 02:22:41 -04:00
Jose Diaz-Gonzalez
14838de344 feat: allow keeping the git directory during builds
It may be desirable to keep the contents of the git directory for the build process. Certain build tools can extract extra information from the .git directory, and some workflows may require that the shipped artifact has the entire source code available locally for later usage.
2019-09-15 19:15:35 -04:00
Jose Diaz-Gonzalez
3ca6245b00 fix: use 6 X to support running under busybox
mktemp from busybox requires that all templates end with XXXXXX.
2019-08-12 18:16:16 -04:00
Jose Diaz-Gonzalez
925c6c4c28 feat: inject the dokku PID into temporary files/directories
This will allow background processes to cleanup these files if they were unable to be cleaned up during a run of the dokku binary, as is the case for files copied by the docker binary when running in docker.
2019-08-12 17:56:17 -04:00
Jose Diaz-Gonzalez
5000c32efe fix: add test for warning on pushing to wrong branch
Closes #3592
2019-08-01 20:54:38 -04:00
Jose Diaz-Gonzalez
1b92f4a97e chore: standardize how temporary files are named 2019-05-20 18:01:17 -07:00
Jose Diaz-Gonzalez
da4361583b fix: reverse quotes for variable expansion
Without reversing quotes, the variables are sometimes improperly expanded, resulting in files not being removed.
2019-05-20 17:56:50 -07:00
Jose Diaz-Gonzalez
ef5a45c7cb feat: add DOKKU_QUIET_OUTPUT=1 to all config_set/config_unset calls
This makes build output a bit more digestable.
2019-03-13 02:05:18 -04:00
Jose Diaz-Gonzalez
67ae374e60 lint: remove whitespaces before redirect 2019-02-02 13:49:24 -05:00
Jose Diaz-Gonzalez
86795ddacc tests: run mvdan/shfmt on test runs
While I do not agree with _every_ style change, this will force Dokku to have consistent formatting across all shell scripts, which is arguably a Good Thing™.

The command used to reprocess everything is:

```shell
shfmt -l -bn -ci -i 2 -w .
```
2019-01-07 01:25:55 -05:00
Jose Diaz-Gonzalez
16e4bc8f60 fix: suppress output in git plugin during builds 2018-08-25 01:52:20 -04:00
Tahzib Mashrik
6fb4adf87f unset GIT_QUARANTINE_PATH when updating repo submodule 2018-07-26 03:06:01 +06:00
Jose Diaz-Gonzalez
87e9bea6da fix: ignore issues with popd when OS versions with stricter security
Refs #2978
Closes #3178
2018-05-01 00:02:08 -04:00
Jose Diaz-Gonzalez
72f53f9f1b refactor: use apps_exists helper where appropriate
This centralizes the logic around checking if an application exists.
2018-04-07 15:04:51 -04:00
Jose Diaz-Gonzalez
83f320ac8e feat: add ability to initialize a git repository out of band
This is useful in contexts where the repository directory may be created and interacted with via git-http-backend or other methods of updating a repository.
2018-04-02 00:11:32 -04:00
Jose Diaz-Gonzalez
23c25a44ec fix: ensure we can disable setting the rev-env-var 2018-03-31 04:30:15 -04:00
Jose Diaz-Gonzalez
d67e883e13 feat: flesh out git plugin further
- add `report` and `set` subcommands to the git plugin
- move configuring the DOKKU_DEPLOY_BRANCH to the git plugin
- implement configurable GIT_REV support
- migrate DOKKU_DEPLOY_BRANCH settings
- add a golang-compatible, shell based method of setting plugin configuration variables

Deprecates the community dokku-git-rev plugin.

Closes #2621
Refs dokku-community/dokku-git-rev#9
2018-03-31 03:25:03 -04:00
Jose Diaz-Gonzalez
40b0bdd6e8 fix: ensure we call apps_create at all proper locations 2018-03-05 23:47:10 -05:00
Jose Diaz-Gonzalez
cc0687ec0f fix: compare the env var to string true, not boolean true 2018-03-05 23:01:13 -05:00
Jose Diaz-Gonzalez
db7cc94939 fix: ensure config_get capture exits 0 2018-03-05 23:01:13 -05:00