Commit Graph

61 Commits

Author SHA1 Message Date
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
Adel Qalieh
86f917db79 Add configuration option to disable automatic app creation
Fixes #2808
2018-03-05 23:01:13 -05:00
Jose Diaz-Gonzalez
770a8f8812 Merge pull request #3091 from dokku/3047-detect-deploy-method
Properly trigger tar-based deploys on git-deployed repositories
2018-03-03 21:36:11 -05:00
Jose Diaz-Gonzalez
2b0d34d0db fix: do not trigger git builds when calling tar:from
Closes #3047
2018-03-03 18:30:17 -05:00
kjwon15
af19e5e453 Prune git worktree immediately 2018-03-04 03:59:30 +09:00
kjwon15
1025c7679f Fix trap
Last trap will exec.
2018-03-04 03:57:08 +09:00
kjwon15
12efcd02b1 Prune worktree after build 2018-03-04 03:57:08 +09:00
Jose Diaz-Gonzalez
7d8c80f0cc feat: Add the ability to disable ANSI prefixes via DOKKU_DISABLE_ANSI_PREFIX_REMOVAL
To disable the removal, set the value of this variable to `true`.

Closes #2644
2018-02-19 21:33:10 -05:00
Jose Diaz-Gonzalez
28c409509c fix: declare DOKKU_DEPLOY_BRANCH 2018-01-12 13:42:41 -05:00
Jose Diaz-Gonzalez
19806636ad fix: ensure we respect DOKKU_DEPLOY_BRANCH when rebuilding applications
Closes #3021
2018-01-12 13:38:36 -05:00
Jose Diaz-Gonzalez
64a1c91b76 feat: allow usage of git 2.13.0+ by unsetting GIT_QUARANTINE_PATH during git worktree usage
Closes #2796
2017-11-05 12:34:47 -05:00
Jose Diaz-Gonzalez
c25ef5dc4c fix: Declare and assign separately to avoid masking return values 2017-10-02 11:57:50 -04:00
Vincent Tavernier
c9af7e4cfa Fix #2915
Add forward slash cleanup of the app name for the git-upload-pack
command. Prevents is_valid_app_name from removing the application folder
on `git fetch`.
2017-10-02 09:29:30 +02:00
Jose Diaz-Gonzalez
9f64fdb9b6 fix: Change to app directory when calling git worktree add
Closes #2864
2017-09-02 14:10:47 -04:00
Jose Diaz-Gonzalez
ab11453fc8 feat: validate app name when running git functions 2017-08-19 19:16:40 -04:00
Jose Diaz-Gonzalez
8dadc4cf50 fix: de-dent post-extract output 2017-04-10 17:12:46 -06:00