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
This commit is contained in:
89
tests/unit/10_git.bats
Normal file
89
tests/unit/10_git.bats
Normal file
@@ -0,0 +1,89 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
load test_helper
|
||||
|
||||
setup() {
|
||||
global_setup
|
||||
create_app
|
||||
}
|
||||
|
||||
teardown() {
|
||||
destroy_app
|
||||
global_teardown
|
||||
}
|
||||
|
||||
@test "(git) deploy specific branch" {
|
||||
run bash -c "dokku git:set --global deploy-branch global-branch"
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_success
|
||||
|
||||
GIT_REMOTE_BRANCH=global-branch deploy_app
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_success
|
||||
|
||||
run bash -c "dokku ps:rebuild $TEST_APP"
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_success
|
||||
|
||||
run bash -c "dokku git:set $TEST_APP deploy-branch app-branch"
|
||||
GIT_REMOTE_BRANCH=app-branch deploy_app
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_success
|
||||
|
||||
run bash -c "dokku ps:rebuild $TEST_APP"
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_success
|
||||
|
||||
run bash -c "dokku git:set --global deploy-branch"
|
||||
}
|
||||
|
||||
@test "(git) ensure GIT_REV env var is set" {
|
||||
deploy_app
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_success
|
||||
|
||||
run bash -c "dokku config:get $TEST_APP GIT_REV"
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_output_exists
|
||||
}
|
||||
|
||||
@test "(git) disable GIT_REV" {
|
||||
run bash -c "dokku git:set $TEST_APP rev-env-var"
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_success
|
||||
|
||||
deploy_app
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_success
|
||||
|
||||
run bash -c "dokku config:get $TEST_APP GIT_REV"
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_output_empty
|
||||
}
|
||||
|
||||
@test "(git) customize the GIT_REV environment variable" {
|
||||
run bash -c "dokku git:set $TEST_APP rev-env-var GIT_REV_ALT"
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_success
|
||||
|
||||
deploy_app
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_success
|
||||
|
||||
run bash -c "dokku config:get $TEST_APP GIT_REV_ALT"
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_output_exists
|
||||
}
|
||||
Reference in New Issue
Block a user