travis has a config to set the buildpack source for heroku deployment using the Anvil deploy strategy, but it doesn't specify how to set that config value using the git deploy strategy.
how do you set buildpack config value as a heroku config variable before deployment if you're using the git deployment strategy in travis?
thanks.
For git deploys, Heroku relies on the BUILDPACK_URL environment variable to be configured for your repository.
Anvil doesn't utilize these settings, hence it needs to be manually specified in the deployment settings.
Related
So I originally named my github repo my_repo, but then renamed it my-repo shortly after creation, like within the first day. This was roughly a year ago.
Ever since, I've been building the project with Travis CI, using the free .org version. Now after making all my repos private and upgrading to the pro version with travis-ci.com, I've had to provide new API credentials in my .travis.yml. So I have to do so with
travis encrypt $(heroku auth:token) --add deploy.api_key --pro
This has worked with other repositories, but not this particular one. Instead, I get
repository not known to https://api.travis-ci.com/: dben89x/my_repo
However, on my Travis CI dashboard, it's trying to build it as dben89x/my-repo. I'm not sure how to tell travis to build it as dben89x/my-repo.
All my git remotes are set up as my-repo. I've tried logging out in the CLI and logging back in.
I found the answer here: https://github.com/travis-ci/travis-ci/issues/3264#issuecomment-180246348
Went into .git/config and changed
[travis]
slug = dben89x/my_repo
to
[travis]
slug = dben89x/my-repo
I'm trying to deploy a runnable Spring Boot jar via Heroku CLI.
On 2018-11-06 it was sufficient to define the java.runtime.version=11 Config Var in the application settings.
Since 2018-11-07 Heroku ignores it and uses the default 1.8 Java. I have also pushed the system.properties file with content java.runtime.version=11, but it gets ignored either.
Does anybody have a workaround for this?
Make sure you have commited changes to the master branch of your local git repository before pushing to Heroku.
In my project I use Travis-CI for continuous integration (builds on every MR to master branch) and also for deploying the artifact to Heroku. Here is my .travis.yml file:
language: java
jdk: oraclejdk8
branches:
only:
- master
script:
mvn package
deploy:
provider: heroku
api_key: $HEROKU_API_KEY
notifications:
email:
on_success: never
on_failure: always
And here is my Procfile:
web java -Dserver.port=$PORT -jar target/my-artifact.jar
Here you can see that I use PORT Heroku variable, but I also use few custom variables. Sometimes I need to update their values after new build. Previously I did it manually, but I'm looking how I can automate this. I need to update Heroku environment variables with values which I determine in time of Travis-CI build. How can I do that?
You can set your environment variables using the Heroku platform API: https://devcenter.heroku.com/articles/platform-api-reference#config-vars
In Travis, you can run a task pre-deploy using the 'before_deploy' step (https://docs.travis-ci.com/user/customizing-the-build#The-Build-Lifecycle)
So create a script that uses the Heroku platform API to update your environment and run it as part of your before_deploy step.
I have a front-end build and deploy that I want to run on circleci with node. The deploy part needs a config file with api keys and passwords which I don't want to store in git. How do I add a config file to my build?
disclaimer: Developer Evangelist at CircleCI.
The CircleCI config file itself would be stored in Git. API keys, passwords, and secrets you'd store in private environment variables via the CircleCI UI.
I deploy a JAR file to Heroku using the heroku-cli-deploy plugin:
heroku deploy:jar webapp.jar
If I run this command inside a Git repository, the version of the displayed in the Heroku dashboard is the version of the currently checked out commit.
If I run this out of a Git tree, there are no version info displayed in the dashboard.
Is there any chance to specify the SHA1 of the release programmatically without running the deploy command from inside the git repository ?
The version can be injected using the cli parameter --build-version. For example:
heroku deploy:jar webapp.jar --app webapp --build-version `git rev-parse --short HEAD`
NOTE! It seems that Heroku is filtering the value and it has to be a git hash. So it's not possible to push --build-version v1.0.0 for example.