xiaohongshu
xiaohongshu
jravan-ec2
JRA-VAN API(EC2)へのファイル送信とコード更新ガイド
Full skill instructions
JRA-VAN API(EC2 Windows Server)にコードを送信し、更新する際の定型コマンドを提供します。EC2にはGitがインストールされていないため、AWS SSM経由で直接ファイルを送信します。
jravan-api/*.pyコマンド:
INSTANCE_ID=$(aws ec2 describe-instances \
--filters "Name=tag:Name,Values=*jravan*" \
--query 'Reservations[].Instances[].InstanceId' \
--output text)
echo "Instance ID: $INSTANCE_ID"
出力例:
Instance ID: i-0123456789abcdef0
コマンドテンプレート:
# 1. ファイルをBase64エンコード
FILE_B64=$(base64 jravan-api/<ファイル名>.py | tr -d '\n')
# 2. SSM経由でEC2に送信
aws ssm send-command \
--instance-ids "$INSTANCE_ID" \
--document-name "AWS-RunPowerShellScript" \
--parameters "commands=[\"[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('$FILE_B64')) | Out-File -FilePath C:\\jravan-api\\<ファイル名>.py -Encoding UTF8 -Force\"]"
実行例(sync_jvlink.py を送信):
FILE_B64=$(base64 jravan-api/sync_jvlink.py | tr -d '\n')
aws ssm send-command \
--instance-ids "$INSTANCE_ID" \
--document-name "AWS-RunPowerShellScript" \
--parameters "commands=[\"[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('$FILE_B64')) | Out-File -FilePath C:\\jravan-api\\sync_jvlink.py -Encoding UTF8 -Force\"]"
コマンド:
aws ssm send-command \
--instance-ids "$INSTANCE_ID" \
--document-name "AWS-RunPowerShellScript" \
--parameters 'commands=["cd C:\\jravan-api; python sync_jvlink.py"]'
コマンド:
aws ssm send-command \
--instance-ids "$INSTANCE_ID" \
--document-name "AWS-RunPowerShellScript" \
--parameters 'commands=["cd C:\\jravan-api; python sync_jvlink.py --from 20260101"]'
引数:
--from YYYYMMDD: 指定日付からデータを同期コマンド:
# CloudWatch Logsでログを確認
aws logs tail /aws/ec2/jravan --follow
# sync_jvlink.py を送信
INSTANCE_ID=$(aws ec2 describe-instances --filters "Name=tag:Name,Values=*jravan*" --query 'Reservations[].Instances[].InstanceId' --output text) && \
FILE_B64=$(base64 jravan-api/sync_jvlink.py | tr -d '\n') && \
aws ssm send-command --instance-ids "$INSTANCE_ID" --document-name "AWS-RunPowerShellScript" --parameters "commands=[\"[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('$FILE_B64')) | Out-File -FilePath C:\\jravan-api\\sync_jvlink.py -Encoding UTF8 -Force\"]"
# 複数ファイルをループで送信
for file in sync_jvlink.py race_api.py; do
FILE_B64=$(base64 jravan-api/$file | tr -d '\n')
aws ssm send-command \
--instance-ids "$INSTANCE_ID" \
--document-name "AWS-RunPowerShellScript" \
--parameters "commands=[\"[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('$FILE_B64')) | Out-File -FilePath C:\\jravan-api\\$file -Encoding UTF8 -Force\"]"
echo "Sent: $file"
sleep 2
done
# 1. ファイル送信
INSTANCE_ID=$(aws ec2 describe-instances --filters "Name=tag:Name,Values=*jravan*" --query 'Reservations[].Instances[].InstanceId' --output text)
FILE_B64=$(base64 jravan-api/sync_jvlink.py | tr -d '\n')
aws ssm send-command --instance-ids "$INSTANCE_ID" --document-name "AWS-RunPowerShellScript" --parameters "commands=[\"[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('$FILE_B64')) | Out-File -FilePath C:\\jravan-api\\sync_jvlink.py -Encoding UTF8 -Force\"]"
# 2. 5秒待機
sleep 5
# 3. データ再同期
aws ssm send-command --instance-ids "$INSTANCE_ID" --document-name "AWS-RunPowerShellScript" --parameters 'commands=["cd C:\\jravan-api; python sync_jvlink.py"]'
# 4. ログ確認
aws logs tail /aws/ec2/jravan --follow
インスタンスIDが見つからない
Error: An error occurred (InvalidInstanceID.NotFound)
aws ec2 describe-instances --filters "Name=tag:Name,Values=*jravan*"SSMエージェント未起動
Error: TargetNotConnected
PowerShell構文エラー
Error: At line:1 char:...
tr -d '\n' を確認ファイルが見つからない
base64: jravan-api/sync_jvlink.py: No such file or directory
ls jravan-api/ で存在確認sync_jvlink.py - JV-Linkデータ同期スクリプトrace_api.py - レースAPIサーバー(FastAPI)config.py - 設定ファイル/jravan-ec2
ファイル: sync_jvlink.py
同期モード: 差分
実行コマンド:
# 1. インスタンスID取得
INSTANCE_ID=$(aws ec2 describe-instances --filters "Name=tag:Name,Values=*jravan*" --query 'Reservations[].Instances[].InstanceId' --output text)
# 2. ファイル送信
FILE_B64=$(base64 jravan-api/sync_jvlink.py | tr -d '\n')
aws ssm send-command \
--instance-ids "$INSTANCE_ID" \
--document-name "AWS-RunPowerShellScript" \
--parameters "commands=[\"[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('$FILE_B64')) | Out-File -FilePath C:\\jravan-api\\sync_jvlink.py -Encoding UTF8 -Force\"]"
# 3. 差分同期実行
aws ssm send-command \
--instance-ids "$INSTANCE_ID" \
--document-name "AWS-RunPowerShellScript" \
--parameters 'commands=["cd C:\\jravan-api; python sync_jvlink.py"]'
完了。ログを確認してください。
/jravan-ec2
同期モード: 2026年1月1日から完全同期
実行コマンド:
aws ssm send-command \
--instance-ids "$INSTANCE_ID" \
--document-name "AWS-RunPowerShellScript" \
--parameters 'commands=["cd C:\\jravan-api; python sync_jvlink.py --from 20260101"]'
main/CLAUDE.md の「EC2 コード更新」セクションmain/aidlc-docs/construction/unit_01_ai_dialog_public/docs/jra-van_setup.mdtr -d '\n')xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience