Compare commits
1 Commits
7ac941a841
...
cnt-deploy
Author | SHA1 | Date | |
---|---|---|---|
2ce3f4ff51 |
@ -1,2 +0,0 @@
|
|||||||
/content/
|
|
||||||
/public/
|
|
17
.drone.yml
17
.drone.yml
@ -2,28 +2,16 @@
|
|||||||
kind: pipeline
|
kind: pipeline
|
||||||
name: continuous deployment
|
name: continuous deployment
|
||||||
steps:
|
steps:
|
||||||
- name: push hugo image
|
- name: build image
|
||||||
image: plugins/docker
|
image: plugins/docker
|
||||||
settings:
|
settings:
|
||||||
username:
|
username:
|
||||||
from_secret: docker_reg_username
|
from_secret: docker_reg_username
|
||||||
password:
|
password:
|
||||||
from_secret: docker_reg_passwd
|
from_secret: docker_reg_passwd
|
||||||
dockerfile: Dockerfile.hugo
|
|
||||||
repo: decentral1se/beta.lumbung.space
|
repo: decentral1se/beta.lumbung.space
|
||||||
tags: latest
|
tags: latest
|
||||||
|
|
||||||
- name: push scripts image
|
|
||||||
image: plugins/docker
|
|
||||||
settings:
|
|
||||||
username:
|
|
||||||
from_secret: docker_reg_username
|
|
||||||
password:
|
|
||||||
from_secret: docker_reg_passwd
|
|
||||||
dockerfile: Dockerfile.scripts
|
|
||||||
repo: decentral1se/beta.lumbung.space-scripts
|
|
||||||
tags: latest
|
|
||||||
|
|
||||||
- name: deploy stack
|
- name: deploy stack
|
||||||
image: decentral1se/stack-ssh-deploy:latest
|
image: decentral1se/stack-ssh-deploy:latest
|
||||||
settings:
|
settings:
|
||||||
@ -31,9 +19,6 @@ steps:
|
|||||||
host: lumbung.space
|
host: lumbung.space
|
||||||
deploy_key:
|
deploy_key:
|
||||||
from_secret: drone_ssh_lumbung.space
|
from_secret: drone_ssh_lumbung.space
|
||||||
depends_on:
|
|
||||||
- push hugo image
|
|
||||||
- push scripts image
|
|
||||||
trigger:
|
trigger:
|
||||||
branch:
|
branch:
|
||||||
- main
|
- main
|
||||||
|
@ -1,11 +0,0 @@
|
|||||||
FROM python:3.9.9-alpine
|
|
||||||
|
|
||||||
RUN apk add --no-cache git bash
|
|
||||||
|
|
||||||
WORKDIR /src/
|
|
||||||
|
|
||||||
RUN git clone https://git.autonomic.zone/ruangrupa/lumbunglib /src/
|
|
||||||
|
|
||||||
RUN pip install -U setuptools pip
|
|
||||||
|
|
||||||
RUN pip install .
|
|
55
README.md
55
README.md
@ -7,41 +7,13 @@
|
|||||||
> This is a work in progress. The end goal of this is to have a new design and
|
> This is a work in progress. The end goal of this is to have a new design and
|
||||||
> implementation for [`lumbung.space`](https://lumbung.space) for January 2022.
|
> implementation for [`lumbung.space`](https://lumbung.space) for January 2022.
|
||||||
|
|
||||||
## FAQ
|
|
||||||
|
|
||||||
### How does the CI/CD work?
|
|
||||||
|
|
||||||
The [`.drone.yml`](./.drone.yml) triggers a build on [drone.autonomic.zone](https://drone.autonomic.zone/ruangrupa/living-room) of the [`Dockerfile.hugo`](./Dockerfile.hugo) and the [`Dockerfile.scripts`](./Dockerfile.scripts) and then deploys the [`compose.yml`](./compose.yml) stack using `docker stack deploy`.
|
|
||||||
|
|
||||||
### How often is the content regenerated?
|
|
||||||
|
|
||||||
See the `sleep ...` statements in the [`compose.yml`](./compose.yml).
|
|
||||||
|
|
||||||
### How do I see if content generation is working?
|
|
||||||
|
|
||||||
(requires `lumbung.space` docker context)
|
|
||||||
|
|
||||||
- `docker service logs -f beta_lumbung_space_peertube`
|
|
||||||
- `docker service logs -f beta_lumbung_space_calendar`
|
|
||||||
- `docker service logs -f beta_lumbung_space_feed`
|
|
||||||
|
|
||||||
Where `beta_lumbung_space_<service-name>` and you see the service name in the [`compose.yml`](./compose.yml).
|
|
||||||
|
|
||||||
### How do I add a feed?
|
|
||||||
|
|
||||||
Add your RSS feed URL to [`feeds_list.txt`](./feeds_list.txt) and don't forget [this deploy step](https://git.autonomic.zone/ruangrupa/living-room#deploy-a-new-feeds_list-txt).
|
|
||||||
|
|
||||||
### How do I wipe all the generated content?
|
|
||||||
|
|
||||||
(requires `lumbung.space` docker context)
|
|
||||||
|
|
||||||
`docker exec -it $(docker container ls -q -f name=beta_lumbung_space_app) bash -c "rm -rf /src/content/*"`
|
|
||||||
|
|
||||||
## Hacking
|
## Hacking
|
||||||
|
|
||||||
|
[Install Hugo](https://gohugo.io/getting-started/installing/).
|
||||||
|
|
||||||
### Generate the site
|
### Generate the site
|
||||||
|
|
||||||
[Install Hugo](https://gohugo.io/getting-started/installing/) and `hugo serve --watch`
|
`hugo serve --watch`
|
||||||
|
|
||||||
### Generate `lumbung[dot]space` posts
|
### Generate `lumbung[dot]space` posts
|
||||||
|
|
||||||
@ -58,27 +30,6 @@ lumbunglib-cal
|
|||||||
|
|
||||||
export OUTPUT_DIR=content/video
|
export OUTPUT_DIR=content/video
|
||||||
lumbunglib-vid
|
lumbunglib-vid
|
||||||
|
|
||||||
export OUTPUT_DIR=content/feed
|
|
||||||
lumbunglib-feed # reads ./feeds_list.txt
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Afterwards, you can automatically run it with `make gen`.
|
Afterwards, you can automatically run it with `make gen`.
|
||||||
|
|
||||||
After a `git pull`, you may need to run `pip install git+https://git.autonomic.zone/ruangrupa/lumbunglib` again.
|
|
||||||
|
|
||||||
### Manually deploying new images
|
|
||||||
|
|
||||||
- `docker login -u decentral1se -p $(logins/dockerhub/decentral1se)`
|
|
||||||
- `make push-hugo`
|
|
||||||
- `make push-scripts`
|
|
||||||
|
|
||||||
### Manually deploy the site
|
|
||||||
|
|
||||||
(requires `lumbung.space` docker context)
|
|
||||||
|
|
||||||
- `make deploy`
|
|
||||||
|
|
||||||
### Deploy a new `feeds_list.txt`
|
|
||||||
|
|
||||||
Increment the `_v<n>` (e.g. `v1` -> `v2`) in [`compose.yml`](./compose.yml) `configs` to avoid any deployment error.
|
|
||||||
|
60
compose.yml
60
compose.yml
@ -33,69 +33,9 @@ services:
|
|||||||
- "traefik.http.services.coop-cloud-site.loadbalancer.server.port=1313"
|
- "traefik.http.services.coop-cloud-site.loadbalancer.server.port=1313"
|
||||||
- "traefik.http.routers.coop-cloud-site.tls.certresolver=production"
|
- "traefik.http.routers.coop-cloud-site.tls.certresolver=production"
|
||||||
|
|
||||||
peertube:
|
|
||||||
image: decentral1se/beta.lumbung.space-scripts:latest
|
|
||||||
volumes:
|
|
||||||
- content:/src/content
|
|
||||||
environment:
|
|
||||||
OUTPUT_DIR: /src/content/video
|
|
||||||
command: |
|
|
||||||
bash -c "
|
|
||||||
while true
|
|
||||||
do
|
|
||||||
echo 'generating peertube posts...'
|
|
||||||
lumbunglib-vid
|
|
||||||
echo 'going to sleep for 5 minutes...'
|
|
||||||
sleep 300
|
|
||||||
done
|
|
||||||
"
|
|
||||||
|
|
||||||
calendar:
|
|
||||||
image: decentral1se/beta.lumbung.space-scripts:latest
|
|
||||||
volumes:
|
|
||||||
- content:/src/content
|
|
||||||
environment:
|
|
||||||
OUTPUT_DIR: /src/content/calendar
|
|
||||||
CALENDAR_URL: "https://cloud.lumbung.space/remote.php/dav/public-calendars/WbnHM8YdCkKT6bcT?export"
|
|
||||||
command: |
|
|
||||||
bash -c "
|
|
||||||
while true
|
|
||||||
do
|
|
||||||
echo 'generating calendar posts...'
|
|
||||||
lumbunglib-cal
|
|
||||||
echo 'going to sleep for 5 minutes...'
|
|
||||||
sleep 300
|
|
||||||
done
|
|
||||||
"
|
|
||||||
|
|
||||||
feed:
|
|
||||||
image: decentral1se/beta.lumbung.space-scripts:latest
|
|
||||||
volumes:
|
|
||||||
- content:/src/content
|
|
||||||
configs:
|
|
||||||
- source: feeds_list
|
|
||||||
target: /src/feeds_list.txt
|
|
||||||
environment:
|
|
||||||
OUTPUT_DIR: /src/content/feed
|
|
||||||
command: |
|
|
||||||
bash -c "
|
|
||||||
while true
|
|
||||||
do
|
|
||||||
echo 'generating feed posts...'
|
|
||||||
lumbunglib-feed
|
|
||||||
echo 'going to sleep for 5 minutes...'
|
|
||||||
sleep 300
|
|
||||||
done
|
|
||||||
"
|
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
content:
|
content:
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
proxy:
|
proxy:
|
||||||
external: true
|
external: true
|
||||||
|
|
||||||
configs:
|
|
||||||
feeds_list:
|
|
||||||
name: beta_lumbung_space_feeds_list_v1
|
|
||||||
file: feeds_list.txt
|
|
||||||
|
@ -1 +0,0 @@
|
|||||||
https://artivismo.org/feed/
|
|
12
makefile
12
makefile
@ -7,18 +7,10 @@ gen:
|
|||||||
@CALENDAR_URL="https://cloud.lumbung.space/remote.php/dav/public-calendars/WbnHM8YdCkKT6bcT?export"; \
|
@CALENDAR_URL="https://cloud.lumbung.space/remote.php/dav/public-calendars/WbnHM8YdCkKT6bcT?export"; \
|
||||||
OUTPUT_DIR=content/calendar; \
|
OUTPUT_DIR=content/calendar; \
|
||||||
lumbunglib-cal && \
|
lumbunglib-cal && \
|
||||||
OUTPUT_DIR=content/video lumbunglib-vid && \
|
OUTPUT_DIR=content/video lumbunglib-vid
|
||||||
OUTPUT_DIR=content/feed lumbunglib-feed
|
|
||||||
|
|
||||||
push-hugo:
|
push-hugo:
|
||||||
@docker build -t decentral1se/beta.lumbung.space -f Dockerfile.hugo . && \
|
@docker build -t decentral1se/beta.lumbung.space -f Dockerfile.hugo . && \
|
||||||
docker push decentral1se/beta.lumbung.space
|
docker push decentral1se/beta.lumbung.space
|
||||||
|
|
||||||
push-scripts:
|
.PHONY: serve gen push-hugo
|
||||||
@docker build --no-cache -t decentral1se/beta.lumbung.space-scripts -f Dockerfile.scripts . && \
|
|
||||||
docker push decentral1se/beta.lumbung.space-scripts
|
|
||||||
|
|
||||||
deploy:
|
|
||||||
@DOCKER_CONTEXT=lumbung.space docker stack deploy -c compose.yml beta_lumbung_space
|
|
||||||
|
|
||||||
.PHONY: serve gen push-hugo push-scripts deploy
|
|
||||||
|
Reference in New Issue
Block a user