-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from civitaspo/develop
0.0.5
- Loading branch information
Showing
22 changed files
with
810 additions
and
202 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
src/main/resources/pro/civitaspo/digdag/plugin/ecs_task/rb/run.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
set -ex | ||
set -o pipefail | ||
|
||
mkdir -p ./digdag-operator-ecs_task | ||
cd digdag-operator-ecs_task | ||
|
||
# Create output files | ||
touch out.json stdout.log stderr.log | ||
|
||
# Download requirements | ||
aws s3 cp s3://${ECS_TASK_RB_BUCKET}/${ECS_TASK_RB_PREFIX}/ ./ --recursive | ||
|
||
# Move workspace | ||
cd workspace | ||
|
||
# Unset e option for returning ruby results to digdag | ||
set +e | ||
|
||
# Run setup command | ||
${ECS_TASK_RB_SETUP_COMMAND} \ | ||
2>> ../stderr.log \ | ||
| tee -a ../stdout.log | ||
|
||
# Run | ||
cat ../runner.rb \ | ||
| ruby \ | ||
-I . \ | ||
-r ${ECS_TASK_RB_REQUIRE} \ | ||
-- - \ | ||
"${ECS_TASK_RB_COMMAND}" \ | ||
../in.json \ | ||
../out.json \ | ||
2>> ../stderr.log \ | ||
| tee -a ../stdout.log | ||
|
||
# Capture exit code | ||
EXIT_CODE=$? | ||
|
||
# Set e option | ||
set -e | ||
|
||
# Move out workspace | ||
cd .. | ||
|
||
# For logging driver | ||
cat stderr.log 1>&2 | ||
|
||
# Upload results | ||
aws s3 cp ./out.json s3://${ECS_TASK_RB_BUCKET}/${ECS_TASK_RB_PREFIX}/ | ||
aws s3 cp ./stdout.log s3://${ECS_TASK_RB_BUCKET}/${ECS_TASK_RB_PREFIX}/ | ||
aws s3 cp ./stderr.log s3://${ECS_TASK_RB_BUCKET}/${ECS_TASK_RB_PREFIX}/ | ||
|
||
# Exit with the ruby exit code | ||
exit $EXIT_CODE | ||
|
Oops, something went wrong.