Initial commit

This commit is contained in:
2024-07-02 13:09:46 +02:00
commit 11e0f786fe
15 changed files with 302 additions and 0 deletions

34
test/test.sh Executable file
View File

@ -0,0 +1,34 @@
#!/usr/bin/env bash
# Test the action
RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m' # No Color
script_dir="$(dirname "$(readlink -f "$0")")"
private_key=$(cat ${script_dir}/private-key)
output=$(docker run \
-it --rm \
--name test-action \
-e SSH_PRIVATE_KEY="$private_key" \
-e SSH_HOST="test-server" \
-e SSH_PORT="22140" \
-e SSH_USER="test" \
-e REGISTRY_HOST="test-registry:5000" \
-e REGISTRY_USER="test" \
-e REGISTRY_PASSWORD="test" \
--network test_network \
docker-private-registry-ssh-action:latest)
if echo $output | grep "Login Succeeded" > /dev/null; then
echo -e "${GREEN}Test passed.${NC}"
else
echo -e "${RED}Test failed.${NC}"
echo -e "Output: \n"
echo "${output}"
fi
echo -e "\n"