Merge pull request #1834 from jvanbaarsen/ignore-osx-hidden-files

Make sure we ignore hidden files in the SSL cert check
This commit is contained in:
Michael Hobbs committed 2016-01-06 07:58:35 -08:00
commit c8c3381dd6
3 files changed
+9 -2

No files matched your search

+2 -2
View File
@@ -39,7 +39,7 @@ certs_set() {
cd $TEMP_DIR cd $TEMP_DIR
tar xvf - <&0 tar xvf - <&0
CRT_FILE_SEARCH=$(find . -type f -name "*.crt") CRT_FILE_SEARCH=$(find . -not -path '*/\.*' -type f -name "*.crt")
CRT_FILE_COUNT=$(printf "%s" "$CRT_FILE_SEARCH" | grep -c '^') CRT_FILE_COUNT=$(printf "%s" "$CRT_FILE_SEARCH" | grep -c '^')
if [[ $CRT_FILE_COUNT -lt 1 ]]; then if [[ $CRT_FILE_COUNT -lt 1 ]]; then
dokku_log_fail "Tar archive is missing .crt file" dokku_log_fail "Tar archive is missing .crt file"
@@ -49,7 +49,7 @@ certs_set() {
CRT_FILE=$CRT_FILE_SEARCH CRT_FILE=$CRT_FILE_SEARCH
fi fi
KEY_FILE_SEARCH=$(find . -type f -name "*.key") KEY_FILE_SEARCH=$(find . -not -path '*/\.*' -type f -name "*.key")
KEY_FILE_COUNT=$(printf "%s" "$KEY_FILE_SEARCH" | grep -c '^') KEY_FILE_COUNT=$(printf "%s" "$KEY_FILE_SEARCH" | grep -c '^')
if [[ $KEY_FILE_COUNT -lt 1 ]]; then if [[ $KEY_FILE_COUNT -lt 1 ]]; then
dokku_log_fail "Tar archive is missing .key file" dokku_log_fail "Tar archive is missing .key file"
+7
View File
@@ -38,6 +38,13 @@ teardown() {
assert_success assert_success
} }
@test "(certs) certs:add < tar should ignore OSX hidden files" {
run bash -c "dokku certs:add $TEST_APP < $BATS_TEST_DIRNAME/osx_ssl_tarred.tar"
echo "output: "$output
echo "status: "$status
assert_success
}
@test "(certs) certs:info" { @test "(certs) certs:info" {
run bash -c "dokku certs:add $TEST_APP < $BATS_TEST_DIRNAME/server_ssl.tar && dokku certs:info $TEST_APP" run bash -c "dokku certs:add $TEST_APP < $BATS_TEST_DIRNAME/server_ssl.tar && dokku certs:info $TEST_APP"
echo "output: "$output echo "output: "$output
Binary file not shown.