Skip to content

Commit 5ff8c9a

Browse files
committed
run planet from dockerized containers, unblock dist upgrade
1 parent 560e74d commit 5ff8c9a

3 files changed

Lines changed: 27 additions & 4 deletions

File tree

pillar/base/planet.sls

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,13 @@ planet:
33
- planetpython.org
44
- www.planetpython.org
55
sites:
6-
planetpython.org:
6+
planetpython:
7+
cache: /srv/cache/
8+
output: /srv/planetpython.org/
9+
image: ghcr.io/python/planetpython:latest
10+
config: config.ini
11+
planetpython-3:
12+
cache: /srv/cache3/
13+
output: /srv/planetpython.org/3/
14+
image: ghcr.io/python/planetpython-3:latest
715
config: config.ini
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
cd /srv/planet/
22
git pull
3-
{% for site in salt["pillar.get"]("planet", {}).get("sites").values() %}
4-
$(which python2.7) /srv/planet/code/planet.py /srv/planet/config/{{ site["config"] }}
3+
{% for site, site_config in salt["pillar.get"]("planet", {}).get("sites").items() %}
4+
docker run --rm -it \
5+
-v {{ site_config["cache"] }}:/srv/cache/ \
6+
-v {{ site_config["output"] }}:/srv/planetpython.org/ \
7+
-v /srv/planet/config/{{ site_config["config"] }}:/planet/config/config.ini \
8+
{{ site_config["image"] }} \
9+
python /planet/code/planet.py /planet/config/config.ini
510
{% endfor %}

salt/planet/init.sls

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,20 @@ include:
44
git:
55
pkg.installed
66

7+
docker.io:
8+
pkg.installed
9+
docker:
10+
service.running:
11+
- enable: True
12+
713
planet-user:
814
user.present:
915
- name: planet
1016
- createhome: False
17+
- groups:
18+
- docker
19+
- require:
20+
- pkg: docker.io
1121

1222
/etc/nginx/sites.d/planet.conf:
1323
file.managed:
@@ -40,7 +50,7 @@ planet-user:
4050

4151
https://github.com/python/planet:
4252
git.latest:
43-
- branch: py2
53+
- branch: main
4454
- target: /srv/planet/
4555
- user: planet
4656
- require:

0 commit comments

Comments
 (0)