Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the netlify preview to show packages #308

Merged
merged 2 commits into from
Mar 29, 2018

Conversation

wilzbach
Copy link
Member

As mentioned in #307, downloading the Json doesn't work (or well it takes 10 minutes), so I made --mirror support importing a manually downloaded copy of the Json file.

This is also handy for my local development, when I want to quickly nuke the entire database and on my machine --mirror=... doesn't work well either (could be due to my crappy internet though).

@dlang-bot
Copy link
Collaborator

Thanks for your pull request, @wilzbach!

@wilzbach
Copy link
Member Author

. "$(curl -fsSL --retry 5 --retry-max-time 120 --connect-timeout 5 --speed-time 30 --speed-limit 1024 https://dlang.org/install.sh | bash -s install "dmd-${DMD_VERSION}" --activate)"
. "$(curl "${CURL_FLAGS[@]}" https://dlang.org/install.sh | bash -s install "dmd-${DMD_VERSION}" --activate)"

curl "${CURL_FLAGS[@]}" https://code.dlang.org/api/packages/dump | gunzip > mirror.json
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could also upload a JSON dump somewhere else if this becomes a problem, but for now there aren't too many PRs at dub-registry so having a separate file for this will probably just be more work.

packs = requestHTTP(url ~ InetPath("api/packages/dump")).readJson().deserializeJson!(DbPackage[]);
}

logInfo("Updated for %s downloaded.", url);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this say updates?

@@ -71,6 +92,8 @@ nothrow {
logDiagnostic("Full error: %s", e.toString().sanitize);
}
}

logInfo("Updated for '%s' successfully processed.", fileOrUrl);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Fixed. Thanks!

@wilzbach
Copy link
Member Author

FYI @ others: I'm going to merge this now, s.t. we can play with the preview on the other PRs. As there's no auto-deploy or similar setup, this shouldn't be an issue.

@dlang-bot dlang-bot merged commit 6491f13 into dlang:master Mar 29, 2018
@wilzbach wilzbach deleted the netlify-mirror branch April 3, 2018 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants