Skip to content

Instantly share code, notes, and snippets.

@sr2ds
Created January 16, 2019 17:27
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sr2ds/317e291add1ade1677ac2728502a1e0b to your computer and use it in GitHub Desktop.
Save sr2ds/317e291add1ade1677ac2728502a1e0b to your computer and use it in GitHub Desktop.
Continuous Integration - Laravel GitLab on Heroku
image: lorisleiva/laravel-docker:latest
phpunit:
stage: test
script:
- composer install --prefer-dist --no-ansi --no-interaction --no-progress --no-scripts
- cp .env.example .env
- php artisan key:generate
- phpunit --colors=never
production:
stage: deploy
variables:
HEROKU_API_KEY: $HEROKU_PRODUCTION_API_KEY
script:
- apk add ruby ruby-dev ruby-irb ruby-rake ruby-io-console ruby-bigdecimal ruby-json ruby-bundler yarn ruby-rdoc >> /dev/null
- apk update
- gem install dpl >> /dev/null
- dpl --provider=heroku --app=sr2ds-mercado-livre --api-key=$HEROKU_API_KEY
- yarn global add heroku@$HEROKU_CLI_VERSION
- heroku run php artisan migrate --seed --force --exit-code --app sr2ds-mercado-livre
- heroku run php artisan cache:clear --exit-code --app sr2ds-mercado-livre
- heroku run php artisan ml:anuncio --exit-code --app sr2ds-mercado-livre
@hendisantika
Copy link

I have this error:

$ dpl --provider=heroku --app=sr2ds-mercado-livre --api-key=$HEROKU_API_KEY
/usr/lib/ruby/gems/2.6.0/gems/dpl-1.10.15/lib/dpl/cli.rb:49: warning: Insecure world writable dir /builds/kominfo-pemuda-persis/ana-new/. in PATH, mode 040777
Installing deploy dependencies
Successfully installed multipart-post-2.1.1
Successfully installed faraday-1.0.1
Successfully installed rendezvous-0.1.3
Successfully installed netrc-0.11.0
Successfully installed dpl-heroku-1.10.15
Parsing documentation for multipart-post-2.1.1
Installing ri documentation for multipart-post-2.1.1
Parsing documentation for faraday-1.0.1
Installing ri documentation for faraday-1.0.1
Parsing documentation for rendezvous-0.1.3
Installing ri documentation for rendezvous-0.1.3
Parsing documentation for netrc-0.11.0
Installing ri documentation for netrc-0.11.0
Parsing documentation for dpl-heroku-1.10.15
Installing ri documentation for dpl-heroku-1.10.15
Done installing documentation for multipart-post, faraday, rendezvous, netrc, dpl-heroku after 1 seconds
5 gems installed
Preparing deploy
No stash entries found.
API request failed.
Message: Invalid credentials provided.
Reference: 
ERROR: Job failed: exit code 1

Any suggestion?

Thanks

@dimasrizqi
Copy link

maybe wrong in your heroku api key

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment