build(composer): 添加了生成签名的 bin 脚本

Signed-off-by: 李东云 <dongyun.li@luxcreo.ai>
This commit is contained in:
李东云
2022-06-15 18:20:56 +08:00
parent 87f8c38d74
commit 4f71fe32c8
3 changed files with 29 additions and 0 deletions

3
.gitignore vendored
View File

@@ -6,3 +6,6 @@ composer.lock
# IDE support # IDE support
.idea/ .idea/
.vscode/ .vscode/
# cache
cert/

23
bin/generate-cert Executable file
View File

@@ -0,0 +1,23 @@
#!/bin/sh
# shellcheck disable=SC2039
echo -e '\033[44;34;5m=============================\033[0m'
#mkdir -p "$(pwd)"/cert && cd "$(pwd)"/cert || exit
echo 'Credentials directory created'
echo -e '\033[44;34;5m=============================\033[0m'
echo ''
#openssl req -new -x509 -nodes -sha256 -out saml.crt -keyout saml.pem && cd - || exit
echo ''
echo -e '\033[44;34;5m=============================\033[0m'
echo -e '\033[;31;1m🎉Congratulations!\033[0m'
echo 'Now you can found credentials in the following directory:'
echo -e "\033[;36;4m$(pwd)/cert/\033[0m"
echo ''
echo -e "Public key: \033[;35;4mcert/saml.crt\033[0m"
echo -e "Private key: \033[;35;4mcert/saml.pem\033[0m"
echo ''
echo -e '\033[34;1mNotice: If you cannot read saml.pem in IDE,\033[0m'
echo -e '\033[34;1myou can print it in commander directly with following command:\033[0m'
echo ''
echo -e '\033[5mcat ./cert/saml.pem\033[0m'
echo ''

View File

@@ -59,6 +59,9 @@
"config": "Singularity\\HyperfSaml\\ConfigProvider" "config": "Singularity\\HyperfSaml\\ConfigProvider"
} }
}, },
"bin": [
"bin/generate-cert"
],
"repositories": { "repositories": {
"packagist": { "packagist": {
"type": "composer", "type": "composer",