off-topic

https://github.com/clojurians/community-development/blob/master/Code-of-Conduct.md Clojurians Slack Community Code of Conduct. Searchable message archives are at https://clojurians-log.clojureverse.org/
West 2021-04-11T01:14:25.190200Z

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?

solf 2021-04-11T07:36:07.191600Z

@c.westrom 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 <https://download.clojure.org/install/linux-install-1.10.2.774.sh>
    - chmod +x linux-install-1.10.2.774.sh
    - ./linux-install-1.10.2.774.sh
    - clojure -X:build-services

solf 2021-04-11T07:37:46.191800Z

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.

West 2021-04-11T18:18:28.195400Z

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.

West 2021-04-11T18:19:00.195600Z

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.

West 2021-04-11T18:31:46.195900Z

https://gitlab.com/wildwestrom/mysite/

West 2021-04-11T18:43:41.196200Z

I'm doing a lot of trial and error with this.

West 2021-04-11T19:36:42.196500Z

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"'

West 2021-04-11T19:42:24.196700Z

Now how can I move these artifacts to my pi? If it's through ssh, then how exactly?

sova-soars-the-sora 2021-04-13T17:57:57.212300Z

how do we get that feedback to the people in charge of gitlab 😅

West 2021-04-13T19:56:13.213700Z

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.

sova-soars-the-sora 2021-04-14T15:48:51.222800Z

good product feedback is more valuable than customers sometimes!

solf 2021-04-11T02:19:12.190400Z

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 ...

West 2021-04-11T05:59:59.191100Z

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.

gklijs 2021-04-11T06:08:02.191300Z

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.

2021-04-11T08:04:59.194100Z

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?

vemv 2021-04-11T16:33:25.194600Z

as in, "if a random developer doesn't solve this issue for me, I won't cut a release?"

2021-04-11T16:41:07.194800Z

Kind of, yes.

2021-04-11T16:41:41.195Z

Except that solving the issue is not for me.

vemv 2021-04-11T16:47:11.195200Z

> 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

raspasov 2021-04-11T22:29:15.198100Z

This app is absolutely impressive (free Photoshop in the browser) http://photopea.com

👍 1
👀 1
raspasov 2021-04-12T09:46:54.203600Z

👍 That’s where I learned about it.

👍 1