acm icon indicating copy to clipboard operation
acm copied to clipboard

bash: heroku: command not found

Open jerinpetergeorge opened this issue 3 years ago • 1 comments

Everything was perfect, except this line - https://github.com/outline/acm/blob/b5085d4246296babec1c8b11630aa63165687ae8/cert.sh#L29

It seems the dyno couldn't find the Heroku binary. How can I run the command successfully?

The script that I have used

#!/bin/sh
set -e

# NEEDS THE FOLLOWING VARS IN ENV:
# DOMAIN
# CLOUDFLARE_TOKEN
# CLOUDFLARE_ACCOUNT_ID
# HEROKU_API_KEY
# HEROKU_APP

git clone https://github.com/Neilpang/acme.sh.git
cd ./acme.sh

# Force ensures it doesnt fail because of lack of cron
./acme.sh --install --force

# Map to environment variables that the ACME script requires
export CF_Token=$CLOUDFLARE_TOKEN
export CF_Account_ID=$CLOUDFLARE_ACCOUNT_ID

# Generate wildcard certificate (this will take approx 130s)
~/.acme.sh/acme.sh --server letsencrypt --issue -d $DOMAIN  -d "*.$DOMAIN"  --dns dns_cf

# Update the certificate in the live app
heroku certs:update "/app/.acme.sh/$DOMAIN/fullchain.cer" "/app/.acme.sh/$DOMAIN/$DOMAIN.key" --confirm $HEROKU_APP --app $HEROKU_APP

jerinpetergeorge avatar Sep 02 '21 19:09 jerinpetergeorge

You probably need to add https://elements.heroku.com/buildpacks/heroku/heroku-buildpack-cli

frodsan avatar Sep 16 '21 09:09 frodsan