I find solution by installing heroku cli on circleci
[config.yml file]
version: 2
jobs:
build:
machine: true
steps:
- checkout
# test
- run: |
docker-compose -f docker-compose.unittests.yml run --rm unittests
# build image
- run: |
docker info
docker build -t aspnetapp DotNetCoreSampleApi
# deploy the image
- run: |
docker login -username=$HEROKU_USERNAME --password=$HEROKU_API_KEY registry.heroku.com
docker tag aspnetapp registry.heroku.com/$HEROKU_APP_NAME/web
docker push registry.heroku.com/$HEROKU_APP_NAME/web
- run:
name: Setup Heroku
command: |
chmod +x .circleci/setup-heroku.sh
.circleci/setup-heroku.sh
- run:
name: Deploy to Heroku
command: |
heroku container:release web --app $HEROKU_APP_NAME
[setup-heroku.sh]
#!/bin/bash
set -eu
git remote add heroku https://git.heroku.com/$HEROKU_APP_NAME.git
wget -qO- https://cli-assets.heroku.com/install-ubuntu.sh | sh
cat > ~/.netrc << EOF
machine api.heroku.com
login $HEROKU_LOGIN
password $HEROKU_API_KEY
machine git.heroku.com
login $HEROKU_LOGIN
password $HEROKU_API_KEY
EOF
chmod 600 ~/.netrc
Add heroku.com to the list of known hosts
ssh-keyscan -H heroku.com >> ~/.ssh/known_hosts