aws データ パイプラインで bash スクリプトを使用して ruby ファイルを呼び出す必要があります
コマンド引数でシェルコマンドアクティビティを使用してみました
jsonファイル
> {
> "objects": [
> {
> "terminateAfter": "1 Hours",
> "id": "ResourceId5",
> "schedule": {
> "ref": "ScheduleId4"
> },
> "name": "Resource1",
> "logUri": "s3://pipeline_test/output1/",
> "type": "Ec2Resource"
> },
> {
> "id": "ActivityId1",
> "schedule": {
> "ref": "ScheduleId4"
> },
> "name": "Shell",
> "command": "bash -lc 'cd ~/pipeline_test/inputs/ && ruby sample.rb'", # bash command script path for ruby file
> "runsOn": {
> "ref": "ResourceId5"
> },
> "type": "ShellCommandActivity",
> "output": {
> "ref": "DataNodeId3"
> }
> },
> {
> "id": "DataNodeId3",
> "schedule": {
> "ref": "ScheduleId4"
> },
> "directoryPath": "s3://pipeline_test/output/",
> "name": "Output",
> "type": "S3DataNode"
> },
> {
> "id": "Default",
> "scheduleType": "timeseries",
> "name": "Default",
> "role": "DataPipelineDefaultRole",
> "resourceRole": "DataPipelineDefaultResourceRole"
> },
> {
> "id": "ScheduleId4",
> "startDateTime": "2013-08-01T00:00:00",
> "name": "schedule",
> "type": "Schedule",
> "period": "20 Minutes",
> "endDateTime": "2013-08-03T00:00:00"
> }
> ]
> }
sample.rb
f = File.open('text.txt', 'a+')
old_out = $stdout
$stdout = f
puts "Start time #{Time.now}"
puts "Welcome"
puts "End time #{Time.now}"
f.close
s3 パスの指定方法がわかりません ("command": "bash -lc 'cd ~/pipeline_test(bucket_name)/inputs/ && ruby sample.rb'", )
私はスクリプト終了ステータス1を取得しています
それを解決するために私を助けてください。