-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add --build-arg and --build-secret #50
base: main
Are you sure you want to change the base?
Conversation
5e9c40f
to
9116304
Compare
This PR is great and fixes one of my needs as well. |
@@ -18,7 +18,9 @@ If you have an existing `fly.toml` in your repo, this action will copy it with a | |||
| `path` | Path to run the `flyctl` commands from. Useful if you have an existing `fly.toml` in a subdirectory. | | |||
| `postgres` | Optional name of an existing Postgres cluster to `flyctl postgres attach` to. | | |||
| `update` | Whether or not to update this Fly app when the PR is updated. Default `true`. | | |||
| `secrets` | Secrets to be set on the app. Separate multiple secrets with a space | | |||
| `secrets` | Secrets to be set on the app at runtime. Separate multiple secrets with a space | | |||
| `build_args` | Optional Docker --build-arg | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we add this option we don't need to pass dockerfile
option explicitly anymore ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess the answer to your question is yes. I don't have enough context to give you a straight forward good quality answer tho.
my use case is as follow:
I use build_args
to set, inside the image, as an environment variable:
- the
commit sha
. I use this because I need to tell apart which sourcemap sent to Sentry correspond to which build - a flag
autosleep
. My Remix server checks at runtime if that flag is there and if so it shuts itself down after a while in order to scale the fly machine down
build_secrets
I use to set credentials needed by Sentry to upload the sourcemaps
and finally my dockerfile is the same for build and for production but the generated image is different in production than what's used for build because I make use of FROM
more than once in the same dockerfile
FROM can appear multiple times within a single Dockerfile to create multiple images or use one build stage as a dependency for another. Simply make a note of the last image ID output by the commit before each new FROM instruction. Each FROM instruction clears any state created by previous instructions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it , thanks
I have a use case where I rely on a different npm package registry. It requires a token to operate (read), so I need to provide access to it when the docker images are built. I'm doing that by passing it as a "build_arg" to This is something that I can do with Please, consider it. |
Would also love to see this get merged. We have a similar problem needing build args for our frontend services and SHA for issue tracking. Currently we have a fork of this repository to add this functionality. Would love to just be able to use the official action. |
+1 to get this merged. |
+1 |
It looks like #69 adds the ability to set additional options for I haven't tested it but it seems like it might solve the same problem that this PR is. |
#69 adds the ability to update flyctl launch. Is there another PR that added the ability to update flyctl deploy? |
Not that I've seen, but at least #69 looks like it allows setting build args for the initial review app, which in most cases should stay the same for the life of the app, given review apps are usually fairly short-lived |
fix #4
usage example