We only compile for a single platform, the one inside our container.
Since we do that, we can massively simplify this build.
Change-Id: Ic7d088fd85f2cf88838cb83524aaf1c8b2e858bf
Enable mod_ssl and enable proxying to ssl-terminated endpoints.
In the case where the artifact is not found, return NULL instead
of the bogus "Artifact_not_found" url, otherwise we can end up in
a loop where we continuously append that to the url.
Strip trailing slashes from the returned proxy target. We can't
guarantee that folks won't have a '/' at the end of the artifact
url they return to Zuul (and in fact, it's probably more correct
that they do). But our regex in mod_rewrite guarantees that we
will add a slash to it. One sure way to handle this is just to
strip it from the data returned from Zuul if present.
Add a .dockerignore file with both itself and the Dockerfile
added, so that docker won't rebuild extra layers (like the C++
compile layer) if we just change the Dockerfile.
Change-Id: I00dfd0b6842abedf938702a816698d1c6526974d
So that we can have nice looking names like "Preview Site", find
the artifact by looking up the 'type' field in metadata.
Change-Id: Ia01e95c77f068bd8ab3a515aa023c1f79332fc67
splice inserts an item into one container removing it from another
container. It seems to be what people use for this usecase in STL
LRU implementations.
Change-Id: I038aea2e3aadfce01ca30946c16fea3ce0b17b4f
So that we can return the preview URL as the success url, use the
artifact name to look up the forward URL.
Change-Id: I8d67e1527d8f911579779a9a036a3c7f5c79a27f
Add an apache vhost config file which uses zuul-preview as a
rewritemap.
Remove extraneous output from zuul-preview.
Add an exception handler around the http code.
Remove the mutex (as we are single threaded).
Run apache as the docker CMD.
gets and puts both mutate the underling structures. Put in a mutex
and use a guard to make sure we're not stepping on ourselves.
This almost certainly could be smarter.
c++17 (which our compiler supports) has std::optional<T> that can
be used for thigns that return a value or nothing (like this) Use
that.
add in some consts and pass parameters by const reference.
use std::uint32_t instead of uint. Initialize it with the constructor
initializer list instead of in the body of the constructor, and use
uniform initialization syntax to do so.
Initialize the cache instantiation using uniform initialization.
Use a few more autos so that we don't have to type const as much.