- Create playbooks/build_paperclip_image.yml to build image locally from repo - Clone/update paperclipai/paperclip main branch on deploy host - Build with --target production for lean, current, self-managed image - Update docker-compose to use paperclip-local:latest instead of reeoss image - Gives full control over Paperclip version and dependency updates - OpenCode v1.2.24 local adapter pre-installed in source build - Enables rapid iteration and custom patches on Paperclip platform Deployment flow: 1. ansible-playbook playbooks/build_paperclip_image.yml # Build from source 2. ansible-playbook playbooks/deploy_paperclip_stack.yml # Deploy with local image
41 lines
1.1 KiB
YAML
41 lines
1.1 KiB
YAML
---
|
|
- name: Build Paperclip Docker image from source
|
|
hosts: illuminations
|
|
become: true
|
|
vars:
|
|
paperclip_repo_dir: /opt/paperclip-repo
|
|
paperclip_image_name: paperclip-local
|
|
paperclip_image_tag: latest
|
|
|
|
tasks:
|
|
- name: Install git (if not present)
|
|
apt:
|
|
name: git
|
|
state: present
|
|
|
|
- name: Clone or update Paperclip repository
|
|
git:
|
|
repo: https://github.com/paperclipai/paperclip.git
|
|
dest: "{{ paperclip_repo_dir }}"
|
|
update: yes
|
|
register: git_clone
|
|
|
|
- name: Build Paperclip Docker image
|
|
shell: |
|
|
cd {{ paperclip_repo_dir }}
|
|
docker build --target production -t {{ paperclip_image_name }}:{{ paperclip_image_tag }} .
|
|
register: docker_build
|
|
changed_when: "'Successfully tagged' in docker_build.stdout"
|
|
|
|
- name: Show build result
|
|
debug:
|
|
msg: "Built image: {{ paperclip_image_name }}:{{ paperclip_image_tag }}"
|
|
|
|
- name: Show image details
|
|
shell: docker images {{ paperclip_image_name }}:{{ paperclip_image_tag }}
|
|
register: image_info
|
|
|
|
- name: Image info
|
|
debug:
|
|
msg: "{{ image_info.stdout_lines }}"
|