marine-defrag / marine-defrag-client

Other
0 stars 0 forks source link

Add deployment via Kamal #155

Closed parndt closed 3 months ago

parndt commented 4 months ago

This complements the deployment added to marine-defrag/marine-defrag-server#112

We first build the application inside a temporary container running the specified node version, and then we deploy its files to the production container so that it can be deployed to the server.

I've had to patch WebpackGitHash.prototype.getSkipHash to support the commit SHA being passed in, as Docker will not be able to access the repository during build.

tmfrnz commented 3 months ago

@parndt please note that I had to remove a few lines in webpack as it was resulting in build errors (guess that merge for this PR was a bit premature =) ) https://github.com/marine-defrag/marine-defrag-client/commit/1245f3a8d222a821e76578df616e0d9ac6843d10

parndt commented 3 months ago

@tmfrnz all good - can you think of another way to pass that info through?

parndt commented 3 months ago

I wonder if we could just rely on there being, or not being, an environment variable before we even define the function:

if (process.env.COMMIT_SHA) {
  WebpackGitHash.prototype.getSkipHash = function(length) {
    return process.env.COMMIT_SHA.substr(0, 7);
  }
}