You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To deploy an application to Heroku, we recommend installing the [Heroku CLI][].
22
28
23
-
If you're creating a new Heroku application, `cd` to the directory
24
-
containing your code, and run:
29
+
If you're creating a new Heroku application, `cd` to the directory containing your code, and run:
25
30
26
31
```sh
27
32
heroku create --buildpack emk/rust
28
33
```
29
34
30
-
This will only work if your application has a `Cargo.toml` and uses `git`.
31
-
If you want to set a particular name for application, see `heroku create
32
-
--help` first.
35
+
This will only work if your application has a `Cargo.toml` and uses `git`. If you want to set a particular name for application, see `heroku create --help` first.
33
36
34
37
To use this as the buildpack for an existing application, run:
35
38
36
39
```sh
37
40
heroku buildpacks:set emk/rust
38
41
```
39
42
40
-
You will also need to create a `Procfile` pointing to the release version of
41
-
your application, and commit it to `git`:
43
+
You will also need to create a `Procfile` pointing to the release version of your application, and commit it to `git`:
42
44
43
45
```Procfile
44
46
web: ./target/release/hello
@@ -54,9 +56,7 @@ git push heroku master
54
56
55
57
### Running Diesel migrations during the release phase
56
58
57
-
This will install the diesel CLI at build time and make it available in your dyno.
58
-
Migrations will run whenever a new version of your app is released. Add the
59
-
following line to your `RustConfig`
59
+
This will install the diesel CLI at build time and make it available in your dyno. Migrations will run whenever a new version of your app is released. Add the following line to your `RustConfig`
60
60
61
61
```sh
62
62
RUST_INSTALL_DIESEL=1
@@ -72,36 +72,23 @@ release: ./target/release/diesel migration run
72
72
73
73
## Specifying which version of Rust to use
74
74
75
-
By default, your application will be built using the latest stable Rust.
76
-
Normally, this is pretty safe: New stable Rust releases have excellent
77
-
backwards compatibility.
75
+
By default, your application will be built using the latest stable Rust. Normally, this is pretty safe: New stable Rust releases have excellent backwards compatibility.
78
76
79
-
But you may wish to use `nightly` Rust or to lock your Rust version to a
80
-
known-good configuration for more reproducible builds. To specify a specific
81
-
version of the toolchain, use a [`rust-toolchain`](https://github.com/rust-lang-nursery/rustup.rs#the-toolchain-file) file in the format rustup
82
-
uses.
77
+
But you may wish to use `nightly` Rust or to lock your Rust version to a known-good configuration for more reproducible builds. To specify a specific version of the toolchain, use a [`rust-toolchain`](https://github.com/rust-lang-nursery/rustup.rs#the-toolchain-file) file in the format rustup uses.
83
78
84
-
Note: if you previously specified a `VERSION` variable in `RustConfig`, that will continue to work,
85
-
and will override a `rust-toolchain` file.
79
+
Note: if you previously specified a `VERSION` variable in `RustConfig`, that will continue to work, and will override a `rust-toolchain` file.
86
80
87
81
## Combining with other buildpacks
88
82
89
-
If you have a project which combines both Rust and another programming
90
-
language, you can insert this buildpack before your existing one as
91
-
follows:
83
+
If you have a project which combines both Rust and another programming language, you can insert this buildpack before your existing one as follows:
92
84
93
85
```sh
94
86
heroku buildpacks:add --index 1 emk/rust
95
87
```
96
88
97
-
If you have a valid `Cargo.toml` in your project, this is all you need to
98
-
do. The Rust buildpack will run first, and your existing buildpack will
99
-
run second.
89
+
If you have a valid `Cargo.toml` in your project, this is all you need to do. The Rust buildpack will run first, and your existing buildpack will run second.
100
90
101
-
But if you only need Rust to build a particular Ruby gem, and you have no
102
-
top-level `Cargo.toml` file, you'll need to let the buildpack know to skip
103
-
the build stage. You can do this by adding the following line to
104
-
`RustConfig`:
91
+
But if you only need Rust to build a particular Ruby gem, and you have no top-level `Cargo.toml` file, you'll need to let the buildpack know to skip the build stage. You can do this by adding the following line to `RustConfig`:
105
92
106
93
```sh
107
94
RUST_SKIP_BUILD=1
@@ -121,8 +108,7 @@ If you need to tweak this buildpack, the following information may help.
121
108
122
109
### Testing with Docker
123
110
124
-
To test changes to the buildpack using the included
125
-
`docker-compose-test.yml`, run:
111
+
To test changes to the buildpack using the included `docker-compose-test.yml`, run:
126
112
127
113
```sh
128
114
./test_buildpack
@@ -134,7 +120,6 @@ Then make sure there are no Rust-related *.so files getting linked:
134
120
ldd heroku-rust-cargo-hello/target/release/hello
135
121
```
136
122
137
-
This uses the Docker image `heroku/cedar`, which allows us to test in an
138
-
official Cedar-like environment.
123
+
This uses the Docker image `heroku/cedar`, which allows us to test in an official Cedar-like environment.
0 commit comments