forked from trainindata/deploying-machine-learning-models
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Section 11.5 - Using Docker with Heroku
- Loading branch information
1 parent
4314c6e
commit c25e909
Showing
2 changed files
with
37 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -113,6 +113,26 @@ jobs: | |
name: Deploy to Heroku | ||
command: | | ||
git push https://heroku:[email protected]/$HEROKU_APP_NAME.git master | ||
section_11_build_and_push_to_heroku_docker: | ||
<<: *defaults | ||
steps: | ||
- checkout | ||
- setup_remote_docker: | ||
docker_layer_caching: true | ||
- run: docker login --username=$HEROKU_EMAIL --password=$HEROKU_API_KEY registry.heroku.com | ||
- run: | ||
name: Setup Heroku CLI | ||
command: | | ||
wget -qO- https://cli-assets.heroku.com/install-ubuntu.sh | sh | ||
- run: | ||
name: Build and Push Image | ||
command: | | ||
make build-ml-api-heroku push-ml-api-heroku | ||
- run: | ||
name: Release to Heroku | ||
command: | | ||
heroku container:release web --app $HEROKU_APP_NAME | ||
workflows: | ||
version: 2 | ||
|
@@ -130,7 +150,14 @@ workflows: | |
branches: | ||
only: | ||
- master | ||
- section_10_deploy_to_heroku: | ||
# - section_10_deploy_to_heroku: | ||
# requires: | ||
# - train_and_upload_regression_model | ||
# filters: | ||
# branches: | ||
# only: | ||
# - master | ||
- section_11_build_and_push_to_heroku_docker: | ||
requires: | ||
- train_and_upload_regression_model | ||
filters: | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
NAME=udemy-ml-api | ||
COMMIT_ID=$(shell git rev-parse HEAD) | ||
|
||
|
||
build-ml-api-heroku: | ||
docker build --build-arg PIP_EXTRA_INDEX_URL=${PIP_EXTRA_INDEX_URL} -t registry.heroku.com/$(NAME)/web:$(COMMIT_ID) . | ||
|
||
push-ml-api-heroku: | ||
docker push registry.heroku.com/${HEROKU_APP_NAME}/web:$(COMMIT_ID) |