我需要在 aws 数据管道中使用 bash 脚本调用 ruby 文件
我尝试使用带有命令参数的 shell 命令活动
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"
> }
> ]
> }
样本.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 路径(“命令”:“bash -lc 'cd ~/pipeline_test(bucket_name)/inputs/ && ruby sample.rb'”,)
我得到脚本退出状态 1
帮我解决它。