首先贴上我的配置:
name: Java CI with Maven
env:
AWS_EC2_METADATA_DISABLED: true
on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn -B package -Dmaven.test.skip
- name: 上传 jar 包和启动脚本到服务器中-reck
run: sshpass -p ${{secrets.RECK_PWD}} scp -r -o StrictHostKeyChecking=no ./target/vac-chat-java-0.0.1-SNAPSHOT.jar root@${{secrets.RECK_IP}}:/root/vac/chat/vac-chat-api/
- name: 启动项目-reck
run: sshpass -p ${{secrets.RECK_PWD}} ssh -o StrictHostKeyChecking=no root@${{secrets.RECK_IP}} "cd /root/vac/chat/vac-chat-api && chmod +x start.sh && ./start.sh"
- name: 上传 jar 包和启动脚本到服务器中-amazon
run: sshpass -p ${{secrets.AMAZON_PWD}} scp -r -o StrictHostKeyChecking=no ./target/vac-chat-java-0.0.1-SNAPSHOT.jar root@${{secrets.AMAZON_IP}}:/root/vac/chat/vac-chat-api/
- name: 启动项目-amazon
run: sshpass -p ${{secrets.AMAZON_PWD}} ssh -o StrictHostKeyChecking=no root@${{secrets.AMAZON_IP}} "cd /root/vac/chat/vac-chat-api && chmod +x start.sh && ./start.sh"
现在就是运行到启动项目那一步报了:Error: Process completed with exit code 255.
查了下好像是因为默认的 ubuntu 从 18.04 提到了 22.04 导致 aws-cli 从 v1 变成了 v2 ,然后需要操作什么,有人遇到过吗
1
billzhuang 2023-09-11 17:37:04 +08:00
设置 AWS_DEFAULT_REGION
|
2
vacuitym OP @billzhuang 想请教些这个怎么设置,以及为什么我没使用 aws 也要设置这个
|
3
billzhuang 2023-09-11 18:19:21 +08:00
start.sh 贴出来
|