~tsileo/microblog.pub

microblog.pub/.drone.yml -rw-r--r-- 3.4 KiB View raw
9c12a673Thomas Sileo Tweak CSS for DMs admin section 8 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
---
priviliged: true  # Needed for Docker in Docker
kind: pipeline
name: default
steps:
  # Run Mypy/Flake8/black linters before any further work is done
  - name: lint
    image: python:3
    commands:
      - pip install -U pip
      - pip install mypy flake8 black
      - black --check .
      - flake8
      # - mypy --ignore-missing-imports .
      - mypy --ignore-missing-imports setup_wizard

  # Build the container images we need for the test suite
  - name: build_containers
    image: docker:dind
    environment:
      DOCKER_HOST: tcp://docker:2375
    commands:
      - apk update && apk upgrade && apk add --no-cache bash git openssh curl
      - docker network create fede
      - docker pull mongo
      - docker pull poussetaches/poussetaches
      - docker build . -t microblogpub:latest
  
  # Run poussetaches (will be shared by the two microblog.pub instances) "in the background"
  - name: run_poussetaches
    image: docker:dind
    detach: true
    environment:
      DOCKER_HOST: tcp://docker:2375
      POUSSETACHES_AUTH_KEY: lol
    commands:
      - docker run -p 7991:7991 --net fede -e POUSSETACHES_AUTH_KEY --name poussetaches poussetaches/poussetaches

  # Run MongoDB (will be shared by the two microblog.pub instances) "in the background"
  - name: run_mongodb
    image: docker:dind
    detach: true
    environment:
      DOCKER_HOST: tcp://docker:2375
    commands:
      - docker run -p 27017:27017 --net fede --name mongo mongo

  # Run a first microblog.pub instance "in the background"
  - name: microblogpub_instance1
    image: docker:dind
    detach: true
    environment:
      DOCKER_HOST: tcp://docker:2375
      MICROBLOGPUB_DEBUG: 1
      MICROBLOGPUB_POUSSETACHES_HOST: http://poussetaches:7991
      MICROBLOGPUB_INTERNAL_HOST: http://instance1_web:5005
      MICROBLOGPUB_MONGODB_HOST: mongo:27017
      POUSSETACHES_AUTH_KEY: lol
    commands:
      - sleep 5
      - 'docker run -p 5006:5005 --net fede -v "`pwd`/tests/fixtures/instance1/config:/app/config" -e MICROBLOGPUB_DEBUG -e MICROBLOGPUB_INTERNAL_HOST -e MICROBLOGPUB_MONGODB_HOST -e MICROBLOGPUB_POUSSETACHES_HOST -e POUSSETACHES_AUTH_KEY --name instance1_web microblogpub'

  # Run the second microblog.pub instance "in the background"
  - name: microblogpub_instance2
    image: docker:dind
    detach: true
    environment:
      DOCKER_HOST: tcp://docker:2375
      MICROBLOGPUB_DEBUG: 1
      MICROBLOGPUB_POUSSETACHES_HOST: http://poussetaches:7991
      MICROBLOGPUB_INTERNAL_HOST: http://instance2_web:5005
      MICROBLOGPUB_MONGODB_HOST: mongo:27017
      POUSSETACHES_AUTH_KEY: lol
    commands:
      - 'docker run -p 5007:5005 --net fede -v "`pwd`/tests/fixtures/instance2/config:/app/config" -e MICROBLOGPUB_DEBUG -e MICROBLOGPUB_INTERNAL_HOST -e MICROBLOGPUB_MONGODB_HOST -e MICROBLOGPUB_POUSSETACHES_HOST -e POUSSETACHES_AUTH_KEY --name instance2_web microblogpub'

  # Run some tests against the two instances to ensure federation is working
  - name: federation_test
    image: python:3
    commands:
      - pip install -U pip
      - pip install -r dev-requirements.txt
      # Federation tests (with two local instances)
      - python -m pytest -v -s --ignore data -k federatio

# Setup the services needed to do some "Docker in Docker" (or dind)
services:
- name: docker
  image: docker:dind
  privileged: true
---
kind: signature
hmac: 9fc3e2eb3b237ab868843f94221124cdc397c454de798b9bcc43c8896615826a

...