abra app deploy handles re-deploy and shows env updates
#712
Open
opened 2025-11-02 01:07:26 +00:00 by pharaohgraphy
·
7 comments
No Branch/Tag Specified
main
renovate/golang-1.27
local-integration-testing
renovate/github.com-charmbracelet-bubbletea-2.x
fix/492
renovate/github.com-charmbracelet-lipgloss-2.x
renovate/otel-weaver-0.x
renovate/codespell-2.x
renovate/tonistiigi-xx-1.x
renovate/alpine-3.x
renovate/github.com-charmbracelet-log-2.x
chore-deps
fix/deps
fix/613
0.13.0-beta
0.13.0-rc2-beta
0.13.0-rc1-beta
0.12.0-beta
0.11.0-beta
0.10.1-beta
0.10.0-beta
0.10.0-rc2-beta
0.10.0-rc1-beta
0.9.0-beta
0.8.1-beta
0.8.0-beta
0.8.0-rc2-beta
0.8.0-rc1-beta
0.7.0-beta
0.7.0-rc3-beta
0.7.0-rc2-beta
0.6.0-beta
0.5.1-beta
0.5.0-alpha
0.4.1-alpha
0.4.0-alpha
0.4.0-alpha-rc8
0.4.0-alpha-rc7
0.4.0-alpha-rc6
0.4.0-alpha-rc5
0.4.0-alpha-rc4
0.4.0-alpha-rc3
0.4.0-alpha-rc2
0.4.0-alpha-rc1
0.3.1-alpha-rc2
0.3.1-alpha-rc1
0.3.1-rc1
0.3.0-alpha
0.2.2-alpha
0.2.1-alpha
0.2.0-alpha
0.1.8-alpha
0.1.7-alpha
0.1.6-alpha
0.1.5-alpha
0.1.4-alpha
0.1.3-alpha
0.1.2-alpha
0.1.1-alpha
0.1.0-alpha
10.0.5
10.0.3
10.0.2
10.0.1
10.0.0
9.0.0
8.0.1
8.0.0
0.7.4
0.7.3
0.7.2
0.7.1
0.7.0
checkout
0.6.0
0.5.0
0.4.1
0.4.0
0.3.1
0.3.0
0.2.0
0.1.2
0.1.1
0.1.0
Labels
Clear labels
bug
build
ci/cd
critical fix
design
documentation
duplicate
easy-first-issue
enhancement
help wanted
i10n
i18n
installer
invalid
question
release
release-candidate
security
tech-debt
test
wontfix
Something is not working
go build related issues
Building things with CI/CD
https://docs.coopcloud.tech/federation/resolutions/passed/010/
UI/UX
Documenting all the things
This issue or pull request already exists
Something for new people to get stuck into. We hope it's easy!
New feature
Need some help
Everything to do with localisation
Everything to do with internationalisation
Everything to do with the install script.
Something is wrong
More information is needed
Release management
Related to the new release candidate
Security related
Unit/integration testing
This won't be fixed
Milestone
No items
No Milestone
Projects
Clear projects
No projects
Abra "next"
Prioritised
Assignees
3wordchant
aadil (Aadil Ayub)
abra-bot (Abra Bot)
ammaratef45
amras (Sarma)
Apfelwurm
BornDeleuze
Brooke
carla
cas (Cassowary)
coopcloud
cyrnel
decentral1se (d1)
dede
devydave
fauno (fauno)
iexos
jade (Jade Ambrose)
jjsfunhouse
jmakdah2 (Jackie Makdah)
joe-irving (Joe Irving)
kawaiipunk (KawaiiPunk)
knoflook
kolaente
lambdabundesverband
linnealovespie (April)
moosemower
moritz
notplants
oxaliq (sorrel)
p4u1
pharaohgraphy (Andrew 🐦🔥❤️🔥✴️)
renovate-bot (Comrade Renovate Bot)
ripclap
simon
sixsmith (Sixsmith)
stevensting
trav (Trav Fryer)
val (val (he/him))
yksflip
Clear assignees
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: toolshed/abra#712
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Hey all, this is my first issue here so please take it easy on me 😅
Issue
This caught me by surprise as the docs do not mention how to deal with config-only changes, but talk about managing secrets.
I automatically assumed that config would be treated the same as secrets: change it, and deploy 🙏
But
abra app deploy myapp.example.comjust says there's nothing new to deploy 💀👉I found
--force -fthough and have been using that flag since, but it doesn't feel "right"?Expected behaviour
My ideal DX (developer experience) would be:
app config ..app deploy ...envchanges in summary (ideally what vars changed, but just a mention of "config updates" suffices for now!).envand simply restarts the service (if that's the best way to do it?)This approach keeps the Dev aware of what they're doing & why the app is being deployed.
It also gives peace of mind because you're always wondering "did that just work?" seeing the config diff or at least "config has changed" will do the trick 💯
PS: while my expertise is predominantly JS-based, I'm happy to hack my way thru this enhancement, likely with a bit of guidance 😊
What do we all think? 🤔
Thanks for raising @pharaohgraphy 👋
I have a feeling you might be referring to "config" as "env vars"? Docker swarm has the concept of configs on it's own and if these change, they are shown in the deployment overview since #657.
So, to summarise, and correct me if wrong:
-ffromabra app deployabra app deploydo what-fdoes and just re-deploy (credit also @p4u1)I think this seems doable. @3wordchant do you have some wisdom for this as the person who implemented the "show changes" functionality. I have a slight worry the overview get's too crowded but OTOH, we do not show things that don't change?
The docker swarm runtime will update the container/env/etc. for us, no restart required.
Sounds like an very good idea, simplifying the CLI interface and increasing the amount of useful information that is shown on deploy overview. Thanks for bringing this up! New perspectives on the using the tool are very valuable 🙏 🫶
"app deploy" should work if config (.env) for the app has changedto `abra app deploy` handles re-deploy and shows env updatesWhile working on our automation, we realised that it would still be nice to have the -f flag for the case that no input changed but we still want tp redeploy.
Default behaviour:
With
-f:This way we can run ´abra app deploy --no-input` in our automation and detect when no changes were detected and nothing had to be redeployed
@decentral1se you're correct, the confusion stems from the fact that Abra calls it
configbut Docker is just injecting Env vars... not sure it's worth renaming, it would be a breaking change 🤷@p4u1 I agree, we should keep
-fit's a useful escape-hatch in general.I will note this though, I've noticed more than just a couple times that mutating an env var via
abra app config ...then running a forced deploy can often ADD the env var with the new value to the Docker service, but it DOES NOT remove the old one..I had to go on the server itself a few times to manually do:
docker service ... --env-rm "MY_ENV"then re-add it manually viadocker service ... --env-add ...I want to flag this now, because I have a feeling this will become an issue if we don't address it properly, I'm unsure how Abra does most things under the hood, so forgive me for potentially missing important context on this. 😅
FWIW: This has been a hindrance for testing new apps and more importantly for hacking away at recipes, it has slowed down my productivity significantly enough to be an issue
That's true, we just append and don't care what is already added on:
.Config.EnvAFAIU since theDockerfileorcompose.ymlmight specify additional env vars thatabrawon't gather from the.envfile... so removing stuff might break something else... do you see a way to resolve this?@p4u1 would you parse the output or should we be adding a
-moutput forabra app deploy? Trying to satisfy Ansible with output parsing that might change through different versions might be a recipe for pain. It might make sense to break out a separate issue for idempotency inabrafor automation tools 🤔@decentral1se My 2c is Abra should be 'smarter' about this rather than gung-ho, here's what I envision SHOULD work based on what I've tried manually in the server's CLI via
docker service ..commands:abra app env ...and updates the env file locally then saves itabra app deploy ....envand server's.env, it finds the names of the vars that have been mutateddocker service ... --env-rm ...for all the env vars that have mutateddocker service ... --env-add ...for all the new values of the env vars mutatedThis ensures we don't destroy env vars injected outside of Abra, this is how I've done it manually and it seems to work just fine for all the apps that I've tried. 🤷
Merging #775.