Created
April 25, 2016 15:20
-
-
Save grischard/66d637be555c54bb411d7c308ef8c3bc 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
#!/bin/bash | |
## Activate our environment | |
cd udata | |
source bin/activate | |
# Package udata | |
cd /home/admin/udata/udata | |
inv clean | |
inv assets | |
inv dist | |
python setup.py sdist | |
# clean up udata-gouvfr just in case there's leftovers | |
cd /home/admin/udata-gouvfr | |
inv clean | |
# Clone udata-gouvfr | |
rm -rf /tmp/udata-gouvlu | |
cp -a /home/admin/udata-gouvfr /tmp/udata-gouvlu | |
cd /tmp/udata-gouvlu | |
# Rename files | |
# Manually move parent directories first, otherwise `find` gets lost | |
mv /tmp/udata-gouvlu/udata_gouvfr /tmp/udata-gouvlu/udata_gouvlu | |
mv /tmp/udata-gouvlu/theme/less/gouvfr /tmp/udata-gouvlu/theme/less/gouvlu | |
# mv gouvfr gouvlu | |
find /tmp/udata-gouvlu -name "*gouvfr*" -exec rename 's/gouvfr/gouvlu/' '{}' \; | |
# s/gouvfr/gouvlu/ in all files | |
find /tmp/udata-gouvlu -type f -exec perl -i -p -e 's/gouvfr/gouvlu/g;' '{}' + | |
# Package udata-gouvlu | |
inv assets | |
inv dist | |
python setup.py sdist | |
# Upload to S3 bucket | |
aws --region eu-central-1 s3 cp /home/admin/udata/udata/dist/udata-0.1.0.dev0.tar.gz s3://ctie-opendata-client-data/udata.tar.gz --acl public-read | |
aws --region eu-central-1 s3 cp /tmp/udata-gouvlu/dist/udata-gouvlu-0.1.0.dev0.tar.gz s3://ctie-opendata-client-data/udata-gouvlu.tar.gz --acl public-read |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment