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

Update README.md #2

Merged
merged 1 commit into from
Aug 1, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 53 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,62 @@
# Heroku × Flutter
Compile and deploy your Flutter Web projects automatically on Heroku easily.
# Heroku Buildpack for Flutter
![header](https://user-images.githubusercontent.com/38699812/89092029-fb5b8400-d373-11ea-8ac0-6a46c817ae3b.png)
Automate your deployments on Heroku easily.

## 🔨 Setup
#### 1. Add this buildpack in your Heroku app.

#### Add this Buildpack in your Heroku app

You can copy the [link](https://github.com/diezep/heroku-buildpack-flutter) of this repository and paste it in buildpacks or write **diezep/flutter** and will be added automatically.
#### 2. Add PHP buildpack in your Heroku app.
Is necessary add PHP buildpack **after** this buildpack.

PHP Buildpack is needed to run the static files in a web service that can be opened in browsers.
*You can skip this step if you have another way to deploy statics files, like NodeJS, Flask..*

#### **IMPORTANT:**
#### Optional

You can add optional [environment variables](#--environment-variables) to customize the deployment of your project but nothing is required, all are optional.

#### Problems to compile
By default, this buildpack get the **last version** of Flutter automatically, sometimes because is on beta channel, that version may have problems to compile a project with web support.

If this is your case, you can try downgrade the Flutter version manually, add FLUTTER_VERSION variable in your Heroku environment with the number of the most recent version that are currently working correctly.

**[UPDATED] Last working version:** 1.19.0-4.3.pre
**Last working version :** 1.19.0-4.3.pre

## 🚩 TODO :

### Environment variables :

* [x] VERSION to set the name of custom version of Flutter.
* [x] CLEANUP to remove uneccessary files after the build.
* [ ] CACHE to remove and download every file its need to compile the project in every deploy.
* [ ] SUBDIR to ubicate the project if it isn't in a root directory.

### Features :

* [x] No more PHP Buildpack needed.
* [x] Save and restore Flutter and Dart SDK in cache.
* [x] Save and restore [dhttpd](https://github.com/diezep/dhttpd) in cache.
* [ ] Save and restore project dependencies needed in cache.

## 🚧 Environment variables:

All variables were built following the structure **FLUTTER_VARNAME** to identified easily in Heroku configurations. If you want to use some variable, remember **use the structure** following to the variable.

| Variable | Type | Default | Description
|----------|---------|------------------| -------------------|
| CLEANUP | *boolean* | <center>true</center> |Remove **uneccessary files** of your project after the compile. |
| VERSION | <center>*string*</center> | *Last version in [beta channel](https://flutter.dev/docs/development/tools/sdk/releases?tab=linux).* | The **name of the version** you want to use to compile the project.|

### Set variable
Example of setting CLEANUP var in Heroku CLI:
```shellscript
$ heroku config:set FLUTTER_CLEANUP=true -a project-name
```
### Example

The next image is an example of setting environment variables following the structure mentioned above :

![example_use_in_variables](https://user-images.githubusercontent.com/38699812/89090700-42447c00-d36a-11ea-8148-84af7cddfa21.PNG)

<!-- TODO: ## 📌 LICENCE -->
<!-- TODO: ## 📌 CONTRIBUTE -->

And that's it, your web page will be ready in a few minutes.
## 📝 Final note
This buildpack is unofficial that means i don't have any conection with Heroku or Google from Flutter developer team <!--Although I would like belonging to any of the two :D -->. This repository was made as a hobby, i'm always interested in learn new things, this is one demostration of that :)