Skip to content

Commit

Permalink
Merge pull request #90 from yanyanho/main
Browse files Browse the repository at this point in the history
fix the start script
  • Loading branch information
yanyanho authored Dec 13, 2023
2 parents ea10145 + f72cee3 commit ee49388
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 6 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ jobs:
bash ./gradlew build -x test
cd dist
export DBPWD=${{secrets.SPRING_DATASOURCE_PASSWORD}}
export SECRET_ID=${{secrets.SECRETID}}
export SECRET_KEY=${{secrets.SECRETKEY}}
export BUCKET_NAME=${{secrets.BUCKETNAME}}
export REGION_NAME=${{secrets.REGIONNAME}}
bash stop.sh
bash start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ public String upload(MultipartFile file) {
} catch (IOException e) {
}
//拼接返回路径
cosClient.shutdown();
// String imagePath = "https://" + cosProperties.getBucketName() + ".cos." + cosProperties.getRegionName() + ".myqcloud.com/" + key;
return key;
}
Expand Down
10 changes: 5 additions & 5 deletions src/main/resources/application-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ logging:
org.springframework.security: debug

ipfs:
url: /ip4/127.0.0.1/tcp/5001
url: ""

web3j:
client-address: "https://polygon-rpc.com"
Expand All @@ -59,10 +59,10 @@ oauth:
userInfoUri: https://api.github.com/user

qcloud:
secretId: ""
secretKey: ""
bucketName: ""
regionName: ""
secretId: {{SECRET_ID}}
secretKey: {{SECRET_KEY}}
bucketName: {{BUCKET_NAME}}
regionName: {{REGION_NAME}}

login:
filter: true
25 changes: 25 additions & 0 deletions start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,37 @@ CLASSPATH='conf/:apps/*:lib/*'
CURRENT_DIR=$(pwd)/
LOG_DIR=${CURRENT_DIR}log
CONF_DIR=${CURRENT_DIR}conf

if [[ -n "$DBPWD" ]];then
sed "s/{{SPRING_DATASOURCE_PASSWORD}}/$DBPWD/g" conf/application-template.yml > conf/application.yml
else
echo "by hand"
fi

if [[ -n "$SECRET_ID" ]];then
sed "s/{{SECRET_ID}}/$SECRET_ID/g" conf/application-template.yml > conf/application.yml
else
echo "by hand"
fi

if [[ -n "$SECRET_KEY" ]];then
sed "s/{{SECRET_KEY}}/$SECRET_KEY/g" conf/application-template.yml > conf/application.yml
else
echo "by hand"
fi

if [[ -n "$BUCKET_NAME" ]];then
sed "s/{{BUCKET_NAME}}/$BUCKET_NAME/g" conf/application-template.yml > conf/application.yml
else
echo "by hand"
fi

if [[ -n "$REGION_NAME" ]];then
sed "s/{{REGION_NAME}}/$REGION_NAME/g" conf/application-template.yml > conf/application.yml
else
echo "by hand"
fi

SERVER_PORT=$(cat $CONF_DIR/application.yml | grep "server:" -A 3 | grep "port" | awk '{print $2}'| sed 's/\r//')
if [ ${SERVER_PORT}"" = "" ];then
echo "$CONF_DIR/application.yml server port has not been configured"
Expand Down

0 comments on commit ee49388

Please sign in to comment.