Compare commits

...

5 Commits

Author SHA1 Message Date
Emmanuel Cazenave 1d87fb8a6b ci: use debvm (#72899)
gitea/publik-devinst/pipeline/head Something is wrong with the build of this commit Details
2024-03-22 11:24:11 +01:00
Emmanuel Cazenave fc6364fb7f use setuptools to build publik-base-theme (#88271)
gitea/publik-devinst/pipeline/head This commit looks good Details
2024-03-18 12:22:41 +01:00
Thomas NOËL ff1d4c69c6 install devscripts (#87970)
gitea/publik-devinst/pipeline/head This commit looks good Details
2024-03-08 18:42:41 +01:00
Emmanuel Cazenave 1dda8a9d6c delete unused template (#87523)
gitea/publik-devinst/pipeline/head This commit looks good Details
2024-02-27 12:31:08 +01:00
Emmanuel Cazenave af108cad77 wcs: use default.zip as skeleton (#86724)
gitea/publik-devinst/pipeline/head This commit looks good Details
2024-02-08 14:44:30 +01:00
9 changed files with 43 additions and 46 deletions

4
Jenkinsfile vendored
View File

@ -7,14 +7,14 @@ pipeline {
stage('Unit Tests (bullseye)') {
steps {
catchError(stageResult: 'FAILURE') {
sh 'sudo ./test-nspawn bullseye'
sh './test-debvm bullseye'
}
}
}
stage('Unit Tests (bookworm)') {
steps {
catchError(stageResult: 'FAILURE') {
sh 'sudo ./test-nspawn bookworm'
sh './test-debvm bookworm'
}
}
}

View File

@ -1,3 +0,0 @@
MIDDLEWARE_CLASSES = ('debug_toolbar.middleware.DebugToolbarMiddleware',) + MIDDLEWARE_CLASSES
INSTALLED_APPS += ('debug_toolbar',)
INTERNAL_IPS = ['127.0.0.1']

View File

@ -1,2 +0,0 @@
theme_repo: "publik-base-theme"
theme_link: "publik-base"

View File

@ -3,6 +3,7 @@
apt:
name:
- acl
- devscripts
- gettext
- graphicsmagick
- graphviz
@ -261,14 +262,30 @@
- source
- name: install theme
import_tasks: tasks/install_theme.yml
import_tasks: tasks/install_source.yml
vars:
src_theme_dir: "{{src_dir}}/{{theme_repo}}"
repo: "publik-base-theme"
repo_dir: "{{src_dir}}/publik-base-theme"
virtualenv: "{{venv_py3}}"
version: "{{publik_base_theme_version|default('main')}}"
do_build: "{{compile_theme}}"
tags:
- theme
- source
- name: create themes directory
file:
path: "{{themes_dir}}"
state: directory
become: yes
- name: link to theme_repo
file:
src: "{{src_dir}}/publik-base-theme"
path: "{{themes_dir}}/publik-base"
state: link
become: yes
- name: create cert directory
file:
path: "{{certs_dir}}"

View File

@ -29,7 +29,6 @@
}},
{"create-wcs": {
"url": "https://{{tenants_conf['demarches-wcs']}}/",
"template_name": "{{wcs_skeleton_filename}}",
"title": "Démarches"
}},
{% if 'dev-passerelle' in tenants_conf and tenants_conf['dev-passerelle'] %}

View File

@ -1,5 +1,5 @@
cook_recipe_path: /tmp/cook-recipe.json
wcs_skeleton_filename: publik.zip
wcs_skeleton_filename: default.zip
wcs_error_email: ""
wcs_language: "fr"
wcs_postgres_user: ""

View File

@ -26,3 +26,4 @@
command: "{{ virtualenv }}/bin/python setup.py build"
args:
chdir: "{{ repo_dir }}"
when: do_build | default(true)

View File

@ -1,35 +0,0 @@
- name: ssh git clone {{theme_repo}}
git:
repo: gitea@git.entrouvert.org:entrouvert/{{theme_repo}}.git
dest: "{{src_theme_dir}}"
version: "{{version}}"
when:
- git_ssh
- name: standard git clone {{theme_repo}}
git:
repo: https://git.entrouvert.org/entrouvert/{{theme_repo}}.git
dest: "{{src_theme_dir}}"
version: "{{version}}"
when:
- not git_ssh
- name: compile theme {{theme_repo}}
make:
chdir: "{{src_theme_dir}}"
target: all
when: compile_theme
- name: create themes directory
file:
path: "{{themes_dir}}"
state: directory
become: yes
- name: link to {{theme_repo}}
file:
src: "{{src_theme_dir}}"
path: "{{themes_dir}}/{{theme_link}}"
state: link
become: yes

20
test-debvm Executable file
View File

@ -0,0 +1,20 @@
#!/bin/sh -ex
# USAGE : ./test-debvm bookworm
if [ $1 = bullseye ] || [ $1 = bookworm ]
then
SUITE=$1
debvm-create --release=$SUITE --size=10G --sshkey=$HOME/.ssh/id_rsa.pub -- --include=ca-certificates,gnupg2,linux-image-generic,locales-all,postgresql,sudo,git,ansible,make --hook-dir=/usr/share/mmdebstrap/hooks/9pmount
debvm-run -g --sshport 2222 -- -daemonize -display none -virtfs "local,path=.,mount_tag=publik-devinst,security_model=none"
debvm-waitssh 2222
ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 2222 root@localhost "cd /media/publik-devinst;./test-debvm run-tests"
kill `ps ax | grep "qemu-system-x86_64" | awk 'NR==1{print $1}'`
rm rootfs.ext4
elif [ $1 = 'run-tests' ]
then
adduser --disabled-password --gecos "" testuser
usermod -a -G sudo testuser
echo 'testuser ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
PORT=`pg_lsclusters | tail -n1 | awk '{ print $3 }'`
su testuser -l -c 'cd /media/publik-devinst; ansible-playbook -e "postgresql_port=$PORT" -i inventory.yml install.yml'
fi