-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from docksal/develop
Release 1.6.0
- Loading branch information
Showing
7 changed files
with
125 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,3 +39,51 @@ teardown() { | |
### Cleanup ### | ||
make clean | ||
} | ||
|
||
@test "Git settings" { | ||
[[ $SKIP == 1 ]] && skip | ||
|
||
### Setup ### | ||
make start -e ENV='-e [email protected] -e GIT_USER_NAME="Docksal CLI" -e GIT_REPO_URL="test-repo-url" -e GIT_BRANCH_NAME="test-branch-name" -e GIT_COMMIT_HASH="test-commit-hash"' | ||
|
||
### Tests ### | ||
# Check git settings were applied | ||
run make exec COMMAND="build-env" | ||
run make exec COMMAND="git config --get --global user.email" | ||
[[ "$status" == 0 ]] | ||
echo "$output" | grep "[email protected]" | ||
unset output | ||
|
||
run make exec COMMAND="build-env" | ||
run make exec COMMAND="git config --get --global user.name" | ||
[[ "$status" == 0 ]] | ||
echo "$output" | grep "Docksal CLI" | ||
unset output | ||
|
||
### Cleanup ### | ||
make clean | ||
} | ||
|
||
@test "Check SSH agent and keys" { | ||
[[ $SKIP == 1 ]] && skip | ||
|
||
### Setup ### | ||
CI_SSH_KEY="LS0tLS1CRUdJTiBFQyBQUklWQVRFIEtFWS0tLS0tCk1IY0NBUUVFSUkxOElNMTZEMFVsS0U0VHVYeU1iQ3NEb3VHWU9TZC85SkJmSTcrenFCQ1JvQW9HQ0NxR1NNNDkKQXdFSG9VUURRZ0FFK1BSR2RQOUpSTmljbVQ1RjR1WFNEakV2TXFUczAxaVVOTXprTXAzUVdSM3hScWp5VFlYdAp0R1hRNE5BVWlxWEtlMnNaN0NZMmxqeGNrTUJCamU2OEhBPT0KLS0tLS1FTkQgRUMgUFJJVkFURSBLRVktLS0tLQo=" | ||
make start -e ENV="-e GIT_USER_EMAIL='[email protected]' -e GIT_USER_NAME='Docksal CLI' -e GIT_REPO_URL='test-repo-url' -e GIT_BRANCH_NAME='test-branch-name' -e GIT_COMMIT_HASH='test-commit-hash' -e CI_SSH_KEY='${CI_SSH_KEY}'" | ||
make exec COMMAND="build-env" | ||
|
||
### Tests ### | ||
|
||
# Check private SSH key | ||
run make exec COMMAND='bash -lc "echo \$$CI_SSH_KEY | base64 -d | diff \$$HOME/.ssh/id_rsa -"' | ||
[[ "$status" == 0 ]] | ||
unset output | ||
|
||
# Check ssh-agent | ||
run make exec COMMAND='bash -lc "source build-env; ssh-add -l"' | ||
[[ "$status" == 0 ]] | ||
unset output | ||
|
||
### Cleanup ### | ||
make clean | ||
} |