Created
April 12, 2016 14:12
-
-
Save aherve/d6743bfc76141447bec04682ceaff22c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| ######### READ ENV VARIABLES ########### | |
| echo "reading env variables" | |
| eval `./jsonenv.py < $PAYLOAD_FILE` | |
| eval `./jsonenv.py < $CONFIG_FILE` | |
| ######### DOWNLOAD FILE ########### | |
| echo "downloading" | |
| aws s3 cp s3://$S3_INPUT_BUCKET/$S3_INPUT_DIRNAME/$S3_INPUT_FILENAME ./orig.pdf | |
| ############ CONVERT FILE ####### | |
| echo "converting file" | |
| convert -density 100 ./orig.pdf \ | |
| -fill "rgba(0,0,0,0.1)" \ | |
| -pointsize 40 \ | |
| -gravity center -draw "rotate -30 text 5,0 '$WATERMARK_TEXT'" \ | |
| ./result.pdf | |
| ############ REUPLOAD ########### | |
| echo "uploading" | |
| aws s3 cp ./result.pdf s3://$S3_DEST_BUCKET/$S3_DEST_DIRNAME/$S3_DEST_FILENAME |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment