I run horwood.cloud

Pixelfed

Could you help fund my server 👉 Fund me

  • 3 Posts
  • 22 Comments
Joined 2 years ago
cake
Cake day: July 27th, 2023

help-circle












  • I do this with semaphore, the below playbook would check out the git repo and reapply the compose file.

    • docker_hosts is the host to run this on
    • project_dir is where the compose file is on disk

    I dont use github, but my own git server not on the internet.

    ---
    - name: Update docker imges
      hosts: "{{ docker_hosts }}"
      gather_facts: false
      tasks:
        - name: Read-write git checkout from github
          ansible.builtin.git:
            repo: git@github.com:yourname/docker.git
            dest: /home/username/git/docker
    
        - name: Create and start services
          community.docker.docker_compose_v2:
            project_src: "{{ project_dir }}"
            build: never
            pull: always
            state: present
          register: output
    
        - ansible.builtin.debug:
            var: output.stderr_lines