-
Notifications
You must be signed in to change notification settings - Fork 2
Conversation
set -e | ||
mkdir -p archive/$(date +%s) | ||
mv *.zip archive/$(date +$s)/ | ||
/usr/bin/zip rename_email_files_with_request_id.py.zip rename_email_files_with_request_id.py || exit 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reason for the || exit 1
at the end of the line? Won't the set -e
catch that?
c1d2883
to
6fdba59
Compare
export FILE_TO_UPLOAD=rename_email_files_with_request_id.py.zip | ||
mkdir -p archive/$(date +%s) | ||
mv $FILE_TO_UPLOAD archive/$(date +$s)/ | ||
/usr/bin/zip $FILE_TO_UPLOAD rename_email_files_with_request_id.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do lines 6 and 7 need to be the other way round? I think it's trying to mv
a file that doesn't exist at the moment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's meant to be archiving anything that might already exist in there, though the syntax is completely wrong, should probably be *.zip
rather than $FILE_TO_UPLOAD
on line 6. But actually, if the workspace is wiped after every run then this shouldn't be required at all. Zip will add stuff to an archive, perhaps there's an option to completely overwrite just to be on the safe side.
6fdba59
to
36c50ca
Compare
|
|
||
set -e | ||
export FILE_TO_UPLOAD=rename_email_files_with_request_id.py.zip | ||
/usr/bin/zip -FS $FILE_TO_UPLOAD rename_email_files_with_request_id.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be simpler to delete the zip file and create a new one. -FS
has some interesting other features.
This just creates a zip of the code ready for deployment.
36c50ca
to
3194bc3
Compare
@deanwilson updated script |
Merge away. |
This just creates a zip of the code ready for deployment, and exports a variable which is used by a Jenkins job for triggering deployment.
Related: alphagov/govuk-puppet#4427
Further related: alphagov/govuk-terraform-provisioning#46