This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-04-11
Channels
- # announcements (7)
- # babashka (125)
- # beginners (45)
- # calva (2)
- # cider (25)
- # clj-kondo (8)
- # clojure (123)
- # clojure-australia (4)
- # clojure-nl (5)
- # clojure-spec (3)
- # clojurescript (15)
- # community-development (6)
- # conjure (3)
- # datomic (6)
- # depstar (1)
- # exercism (1)
- # figwheel-main (5)
- # fulcro (37)
- # honeysql (3)
- # jobs-discuss (1)
- # lsp (79)
- # off-topic (24)
- # pathom (6)
- # schema (1)
- # shadow-cljs (35)
- # spacemacs (9)
- # sql (8)
- # tools-deps (6)
- # vim (9)
- # vrac (1)
- # xtdb (5)
What's the simplest way to do continuous deployment of static pages? I just want my site to update on my raspberry pi every time I push to master. I use gitlab if that makes things easier. Anybody know how to use gitlab ci-cd?
The simplest way would be to use plain ssh
- Create a pair of private/public ssh keys
- Store the private key on a gitlab variable
- Add the public key to your raspberry’s authorized keys
From gitlab-ci.yaml:
- get the contents of the variable and echo them to ~/.ssh/id_rsa
- you might have to either disable ssh host checking, or add the server public key to known hosts
- run scp ...
Do you know how shell runners work? I'm using a hand-rolled static site generator. Since I can't seem to get node and clojure running in docker, I figured I could just use shell commands.
I guess a webhook would be easier, just have gitlab call the webhook on each push to master. On the pi, when the webhook is triggered, pull and build the site.
@U01KQ9EGU79 I’m not sure I understand. Gitlab-ci uses docker by default, but from your point of view it’s just writing shell commands. Shell runners is a kind of gitlab-ci-runner that you install on a server, but it’s really overkill for your usecase.
Can you paste what you’ve tried so far?
Here’s an example that I use for running one of my clojure projects on gitlab-ci. There’s no node, but you could just apt install node
:
build_jar:
stage: build_jar
image: clojure:openjdk-11-lein-stretch
artifacts:
paths: [Services.jar]
script:
# Install clojure tools
- curl -O
- chmod +x linux-install-1.10.2.774.sh
- ./linux-install-1.10.2.774.sh
- clojure -X:build-services
This is actually a weird example as I’m using an image with lein installed (`clojure:openjdk-11-lein-stretch` ) and then I install clojure tools, because at some point I was running lein and clojure in parallel.
Ok, I didn't know that you could specify an image like that. I thought you could only use the default ruby 2.6 unless you host your own runner.
stages:
- deploy
deploy:
stage: deploy
image: clojure:openjdk-17-tools-deps-alpine
script:
- apk add yarn
- yarn install
- yarn release
- mkdir public/
- touch public/index.html
- cp -R public/* /var/www/westrom.xyz/html
Here's what I have so far.Ok, I've created some artifacts.
stages:
- deploy
workflow:
rules:
- if: '$CI_COMMIT_BRANCH'
deploy:
stage: deploy
image: clojure:openjdk-17-tools-deps-alpine
script:
- apk add yarn
- yarn install
- yarn release
artifacts:
paths:
- public
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
Ok, I got it! I found out about variables in gitlab. Now I can do scp. The pipeline is complete! \o/ I must say, although it's nice to use gitlab as it's all integrated, but I don't like how spread out their UI is. Not a very intuitive experience with deploying to a raspberry pi. It's super convoluted trying to do a simple thing like build and deploy.
how do we get that feedback to the people in charge of gitlab 😅
I'm sure there's a way to get that message to them. They're a corporation after all. They're selling gitlab as a product.
good product feedback is more valuable than customers sometimes!
I am trying an experimental idea, a Github issue's tag named "no contrib no release". Example: https://github.com/green-coder/girouette/labels/no%20contrib%20no%20release%20%F0%9F%98%8E Do you think it is going to work or the project will just die as a consequence of it?
Kind of, yes.
Except that solving the issue is not for me.
> Do you think it is going to work or the project will just die as a consequence of it? not sure if it will work, but the worst-case scenario seems pretty harmless :) one would just backpedal
Ok, I got it! I found out about variables in gitlab. Now I can do scp. The pipeline is complete! \o/ I must say, although it's nice to use gitlab as it's all integrated, but I don't like how spread out their UI is. Not a very intuitive experience with deploying to a raspberry pi. It's super convoluted trying to do a simple thing like build and deploy.
This app is absolutely impressive (free Photoshop in the browser) http://photopea.com
Yeah, also if anybody’s interested, a recent discussion on HN: https://news.ycombinator.com/item?id=26768550 and an AMA with the author on Reddit: https://www.reddit.com/r/IAmA/comments/i8j5te/i_made_a_free_alternative_to_photoshop_that_is/