Browse Source

packages: split enough-pip so it's only use for development

keep-around/549c2509b6c302aea0b970db29f4501b6682d3a8
Loïc Dachary 1 year ago
committed by Loic Dachary
parent
commit
3806c0f165
Signed by: dachary GPG Key ID: 992D23B392F9E4F2
  1. 2
      enough-playbook.yml
  2. 4
      inventory/02-all.yml
  3. 7
      molecule/packages/enough-android-playbook.yml
  4. 54
      molecule/packages/enough-pip-playbook.yml
  5. 9
      molecule/packages/enough-playbook.yml
  6. 5
      molecule/packages/playbook.yml
  7. 12
      molecule/packages/roles/enough-pip/tasks/enough-pip.yml

2
enough-playbook.yml

@ -18,7 +18,7 @@
- import_playbook: "{{ '$SHARE_DIR/molecule/gitlab/gitlab-playbook.yml' | expandvars }}"
- import_playbook: "{{ '$SHARE_DIR/molecule/gitlab/gitlab-ci-playbook.yml' | expandvars }}"
- import_playbook: "{{ '$SHARE_DIR/molecule/packages/packages-playbook.yml' | expandvars }}"
- import_playbook: "{{ '$SHARE_DIR/molecule/packages/enough-playbook.yml' | expandvars }}"
- import_playbook: "{{ '$SHARE_DIR/molecule/packages/enough-android-playbook.yml' | expandvars }}"
- import_playbook: "{{ '$SHARE_DIR/molecule/chat/chat-playbook.yml' | expandvars }}"
- import_playbook: "{{ '$SHARE_DIR/molecule/enough/enough-playbook.yml' | expandvars }}"
- import_playbook: "{{ '$SHARE_DIR/molecule/cloud/cloud-playbook.yml' | expandvars }}"

4
inventory/02-all.yml

@ -49,3 +49,7 @@ wekan-group:
openvpn-group:
hosts:
website-host:
enough-user-group:
children:
api-group:

7
molecule/packages/enough-android-playbook.yml

@ -0,0 +1,7 @@
---
- name: enough android app package
hosts: packages-host
become: true
roles:
- role: enough-android

54
molecule/packages/enough-pip-playbook.yml

@ -0,0 +1,54 @@
---
- name: upload enough to packages (if running from sources)
hosts: packages-host
become: true
roles:
- role: enough-pip
- name: build enough docker image on the host using it (if running from sources)
hosts: enough-user-group
become: true
roles:
- role: certificate
vars:
certificate_authority: letsencrypt_staging
certificate_create: false
tasks:
- name: get the Enough version from setup.cfg, if running from sources
shell: |
set -e
cd $(git rev-parse --show-toplevel)
grep -q 'name = enough' setup.cfg
sed -n -e 's/^version = \(.*\)/\1/p' setup.cfg
changed_when: False
ignore_errors: True
register: enough_version
delegate_to: localhost
become: no
- when: enough_version.rc == 0
block:
- name: get enough installation script
uri:
dest: /usr/local/bin/enough-build-docker-image.sh
url: https://packages.{{ domain }}/docker-enough/enough-build-docker-image.sh
- name: apt-get install curl
apt:
name:
- curl
state: present
- name: install enough
shell: |
set -e
bash -x /usr/local/bin/enough-build-docker-image.sh
docker run --rm enough install --no-version internal/data/install.sh > /usr/local/bin/enough
test -s /usr/local/bin/enough
chmod +x /usr/local/bin/enough

9
molecule/packages/enough-playbook.yml

@ -1,9 +0,0 @@
---
- name: install Enough packages builders
hosts: packages-host
roles:
- role: enough-pip
- role: enough-android
become: True

5
molecule/packages/playbook.yml

@ -1,9 +1,10 @@
---
- import_playbook: ../infrastructure/stretch-playbook.yml
- import_playbook: ../infrastructure/buster-playbook.yml
- import_playbook: ../firewall/firewall-playbook.yml
- import_playbook: ../icinga/test-icinga-playbook.yml
- import_playbook: ../bind/bind-playbook.yml
- import_playbook: ../bind/bind-client-playbook.yml
- import_playbook: ../icinga/icinga-playbook.yml
- import_playbook: packages-playbook.yml
- import_playbook: enough-playbook.yml
- import_playbook: enough-android-playbook.yml
- import_playbook: enough-pip-playbook.yml

12
molecule/packages/roles/enough-pip/tasks/enough-pip.yml

@ -19,7 +19,6 @@
path: /usr/share/nginx/html/enough
state: directory
owner: debian
when: enough_version.stdout != ''
- name: python setup.py sdist
shell: |
@ -32,35 +31,30 @@
git checkout ChangeLog
delegate_to: localhost
become: no
when: enough_version != ''
- name: cp enough-{{ enough_version.stdout }}.tar.gz
copy:
src: ../../../../../dist/enough-{{ enough_version.stdout }}.tar.gz
dest: /usr/share/nginx/html/enough/enough-{{ enough_version.stdout }}.tar.gz
become: no
when: enough_version != ''
- name: mkdir -p /usr/share/nginx/html/docker-enough
file:
path: /usr/share/nginx/html/docker-enough
state: directory
owner: debian
when: enough_version != ''
- name: cp enough/internal/data/enough.dockerfile
copy:
src: ../../../../../enough/internal/data/enough.dockerfile
dest: /usr/share/nginx/html/docker-enough/enough.dockerfile
become: no
when: enough_version != ''
- name: cp enough/common/data/base.dockerfile
copy:
src: ../../../../../enough/common/data/base.dockerfile
dest: /usr/share/nginx/html/docker-enough/base.dockerfile
become: no
when: enough_version != ''
- name: shell script to build image from this package host
copy:
@ -73,9 +67,11 @@
-e "s/replace this comment/$(date +%s)/" \
-e "s/domain enough.community/domain {{ domain }}/" \
Dockerfile
docker build --build-arg PIP3_OPTS='--extra-index-url=https://{{ packages_vhost_fqdn }}/ --trusted-host={{ packages_vhost_fqdn }}' --build-arg ENOUGH_VERSION={{ enough_version.stdout }} -t enough .
docker build --build-arg PIP3_OPTS='--extra-index-url=https://{{ packages_vhost_fqdn }}/ --trusted-host={{ packages_vhost_fqdn }}' --build-arg ENOUGH_VERSION={{ enough_version.stdout }} -t enough:{{ enough_version.stdout }} .
docker tag enough:{{ enough_version.stdout }} enough:latest
docker tag enough:{{ enough_version.stdout }} enoughcommunity/enough:latest
docker tag enough:{{ enough_version.stdout }} enoughcommunity/enough:{{ enough_version.stdout }}
cd -
rm -fr $d
dest: /usr/share/nginx/html/docker-enough/enough-build-docker-image.sh
become: no
when: enough_version != ''
Loading…
Cancel
Save