Add a 'Deploy to Heroku' button#1285
Open
daneov wants to merge 4 commits into
Open
Conversation
This allows someone that forks this repository to download the bundled package from his build as an artifact for easy inspection.
GitHub CI has both installed, but not every system does so - Heroku
Heroku uses 'buildpacks' which contain tools needed to build an application for a given technology, but allow little customization and have a pre-set number of tools included (or I haven't found a way to include both `composer` and `node` in 1 environment, short of defining such a build environment by hand). This is why we need to invoke 2 seperate buildpacks sequentially: 1. `composer install`` 2. `npm run build` Defining the environment variables like this allows the developer to easily fill in the required values with minimal overhead. Heroku heavily uses environment variables to configure applications, and doesn't allow for after-deployment adjustments. Using environment variables for configuration does not fit into the current way the config is set up since this uses constants, which need to be fixed at the start of the program. This leads us to the following 2 points: 1. Since these are constants, they cannot be read directly from the environment and we have to perform an in-file replace to make them active. 2. A change in environment variables triggers a restart of a dyno, but not a redeploy. This means that we cannot configure these at build, so we have to perform this change when a Dyno is (re)started. The [.profile](https://devcenter.heroku.com/articles/dynos#the-profile-file) file allows us to manipulate the environment and files for the Dyno, or runner, allowing us to alter the `config.php` file and apply the desired config, while still sticking to non-mutable configuration once the application is booted.. We also need a custom logger to propagate the CodeIgniter logs towards Heroku. See https://devcenter.heroku.com/articles/php-logging#codeigniter-3-x
Author
|
@alextselegidis: |
Owner
|
Hello! Thanks for this PR! Let me check this out and get back to you.
|
Author
|
@alextselegidis just a ping so this is not forgotten. Hope you're having a good time 👋🏼 |
Owner
|
Thanks!
|
Author
|
Not sure if this one is forgotten or not, but closing it due to inactivity. |
Owner
|
Hi @daneov, I'd still want to take a look on this one. Let me keep this alive :)
|
Author
|
That was accidental, please ignore. |
|
Any word on this change? |
Owner
|
Hello! I'll write back on this one soon.
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Goal of this PR
To facilitate easy deployment to Heroku, and perform the changes needed to make that possible.
This PR resolves #1284.
Individual commits
composer testrunning, and don't know why there were so many deletions in thepackage.jsonfile, but everything still works.composerandnodein 1 environment is not possible in Heroku, since they providebuildpacks, specialised environment for building eithernodeorphpenvironments.I've used the environment variable
CIto distinguish between Heroku and another environment, since they commonly set that to indicate a CI environment. Not making this distinction would result in a failing build at Heroku because the binarycomposerwould not be present in anodeenvironment.