alphagov / govuk-docker

GOV.UK development environment using Docker 🐳
MIT License
82 stars 22 forks source link

Fix replicate-mongodb.sh to work on linux #667

Closed chrisroos closed 1 year ago

chrisroos commented 1 year ago

The \d in the regexp passed to grep isn't supported in the GNU version of grep. I understand that the equivalent [[:digit:]] should work in all implementations.

The -z option to tar results in the following error on linux:

gzip: stdin: not in gzip format
tar: Child died with signal 13
tar: Error is not recoverable: exiting now

The -z option filters the output through gzip but I don't believe this is necessary because we're explicitly gunziping the dump before passing it to tar.

With these two changes the script runs without error on my linux development environment.

chrisroos commented 1 year ago

I'd appreciate someone testing these changes on a Mac to make sure I haven't broken anything there. You should be able to test with:

gds aws govuk-integration-readonly --assume-role-ttl 3h ./bin/replicate-mongodb.sh content-store
beccapearce commented 1 year ago

This ran on my mac, monterey 12.6.6

chrisroos commented 1 year ago

Awesome. Thanks @KludgeKML and @beccapearce :+1: