-
dcsc
dss
-
lovetox
can anybody give me a clue, what i need to google to find out how people deploy their webapps to production?
-
Zash
"how to become potato farmer"
-
lovetox
as it seems "How to deploy to production" does yield a million articles not one of them going into detail how the code gets transfered to the server
-
Zash
The standard IT answer applies, "It Depends™"
-
lovetox
like my ideas are - have cron job the does git pull every minute - triggering a webhook that does then trigger some script on the server
-
lovetox
but i dont want to write that webhook myself so ..
-
Zash
Like, on what kind of stack it is. Stack html pages? Just copy over with some file transfer mechanism. More complex? More "it depends"
-
lovetox
- sshing into the server and triggering a script there, comes also to mind
-
Zash
Oh, so you want a thing that makes a docker container in a docker container and triggers a docker container manager manger to docker the docker docker into production docker? Well then
-
lovetox
Zash i need to execute a script on the server
-
lovetox
i simply want my CI call something that triggers a script on the server
-
Zash
`@hourly cd /path/to/app; docker-compose up -d` in a cronjob?
-
lovetox
yes as i said that one idea, but sounds not like a good idea
-
Zash
> does yield a million articles because there are probably more methods invented than there are IT people
-
lovetox
ok Zash, lets start with how you do it with prosody website :)
-
Zash
I've been wanting to make a thing that runs things based on hooks (web- or xmpp-/pubsub-) but I've yet to NIH that
-
Zash
The prosody website doesn't involve CI
-
Zash
It's a hook in the repo that prods a port with netcat which starts a systemd job that runs `hg pull -u && make` in /var/www
-
Zash
so, `netcat localhost someport` -> systemd socket activation -> build the site.service, a one-off job that does that
-
Zash
Elsewhere I just a post-receive hook that runs `make` when you push to the repo
-
Zash
So many variants!
-
Zash
The socket activation thing enables running the build as a different user than the vcs repo user
-
Zash
So I guess architectually, that's pretty close to a webhook thing that runs commands
-
Zash
except without the web, which is nice
-
jonas’
why netcat localhost and not socat UNIX:foobar, to avoid this being at the mercy of a iptables rule to protect from external abuse?
-
Zash
do I look like I want to figure out how to systemd socket activation UNIX sockets?
-
jonas’
(also, unix sockets are *even less* web than bare TCP)
-
jonas’
Zash, just use SocketStream=/path/to/somewhere instead of a port number?
-
Zash
It listens on ::1 anyway, good luck reaching it
-
jonas’
ah, ListenStream= it is
-
jonas’
> If the address starts with a slash ("/"), it is read as file system socket in the AF_UNIX socket family.
-
jonas’
and then you get the added benefits of posix permission control
-
Zash
I've mentally categorized the whole thing under "it works, don't """fix""" it"
-
lovetox
ok i think i write my own webhook thingy
-
lovetox
seems to be a 30 line flask script
-
Zash
and now you have a million lines of python running with _what_ privileges?
-
Zash
the socket activation thing means only systemd, which is already there, is involved
-
lovetox
sorry i dont know a single thing about all the things you have written
-
lovetox
so your method is probably better, but im not inclined to read me into linux system socket systemd things
-
lovetox
when i can write 30 lines of python
-
jonas’
it's probably fewer lines of systemd unit files.
-
Zash
depends on what you value
-
jonas’
but eh, you do you
-
Zash
I tried to minimize extra stuff running while sending signals across privilege barriers and arrived at that
-
lovetox
its a web api, and it supports a single get request
-
Zash
I like the pages.sr.ht method, where the CI job uploads a tarball of the website somewhere with curl
-
lovetox
if that is suddenly insecure, i think we have big problems :)
-
Zash
In the ENTERPRISE world it'll probably be webhooks triggering kubernetes something something I wanna live in the woods and grow potatoes between the firs
-
nephele
I love docker, it creates jobs out of nothing ;)