Mohammed Naser | 1de5519 | 2023-04-28 17:13:35 -0400 | [diff] [blame^] | 1 | VERSION --use-copy-link 0.7 |
Mohammed Naser | 8613c86 | 2023-04-24 17:26:51 -0400 | [diff] [blame] | 2 | FROM python:3.10 |
| 3 | |
| 4 | poetry: |
| 5 | RUN pip3 install poetry |
| 6 | |
Mohammed Naser | 1de5519 | 2023-04-28 17:13:35 -0400 | [diff] [blame^] | 7 | build.wheels: |
Mohammed Naser | 8613c86 | 2023-04-24 17:26:51 -0400 | [diff] [blame] | 8 | FROM +poetry |
| 9 | COPY pyproject.toml poetry.lock ./ |
Mohammed Naser | 1de5519 | 2023-04-28 17:13:35 -0400 | [diff] [blame^] | 10 | ARG --required only |
| 11 | RUN poetry export --only=${only} -f requirements.txt --without-hashes > requirements.txt |
Mohammed Naser | 8613c86 | 2023-04-24 17:26:51 -0400 | [diff] [blame] | 12 | RUN pip wheel -r requirements.txt --wheel-dir=/wheels |
| 13 | SAVE ARTIFACT requirements.txt |
| 14 | SAVE ARTIFACT /wheels |
Mohammed Naser | 1de5519 | 2023-04-28 17:13:35 -0400 | [diff] [blame^] | 15 | SAVE IMAGE --cache-hint |
Mohammed Naser | 8613c86 | 2023-04-24 17:26:51 -0400 | [diff] [blame] | 16 | |
Mohammed Naser | 1de5519 | 2023-04-28 17:13:35 -0400 | [diff] [blame^] | 17 | build.venv: |
| 18 | ARG --required only |
| 19 | FROM +build.wheels --only ${only} |
Mohammed Naser | 8613c86 | 2023-04-24 17:26:51 -0400 | [diff] [blame] | 20 | RUN python3 -m venv /venv |
| 21 | ENV PATH=/venv/bin:$PATH |
| 22 | RUN pip install -r requirements.txt |
Mohammed Naser | 1de5519 | 2023-04-28 17:13:35 -0400 | [diff] [blame^] | 23 | SAVE IMAGE --cache-hint |
| 24 | |
| 25 | build.venv.dev: |
| 26 | FROM +build.venv --only main,dev |
Mohammed Naser | 8613c86 | 2023-04-24 17:26:51 -0400 | [diff] [blame] | 27 | SAVE ARTIFACT /venv |
| 28 | |
Mohammed Naser | 1de5519 | 2023-04-28 17:13:35 -0400 | [diff] [blame^] | 29 | build.venv.runtime: |
| 30 | FROM +build.venv --only main |
| 31 | SAVE ARTIFACT /venv |
| 32 | |
| 33 | build.collections: |
| 34 | FROM +build.venv.runtime |
| 35 | COPY charts /src/charts |
| 36 | COPY meta /src/meta |
| 37 | COPY playbooks /src/playbooks |
| 38 | COPY plugins /src/plugins |
| 39 | COPY roles /src/roles |
| 40 | COPY galaxy.yml /src/galaxy.yml |
| 41 | RUN ansible-galaxy collection install --collections-path /usr/share/ansible/collections /src |
| 42 | SAVE ARTIFACT /usr/share/ansible/collections |
| 43 | SAVE IMAGE --cache-hint |
| 44 | |
| 45 | image: |
| 46 | FROM python:3.10-slim |
| 47 | COPY +build.venv.runtime/venv /venv |
| 48 | COPY +build.collections/ /usr/share/ansible |
| 49 | ENV ANSIBLE_PIPELINING=True |
Mohammed Naser | 8613c86 | 2023-04-24 17:26:51 -0400 | [diff] [blame] | 50 | ENV PATH=/venv/bin:$PATH |
Mohammed Naser | 1de5519 | 2023-04-28 17:13:35 -0400 | [diff] [blame^] | 51 | ENTRYPOINT ["bash"] |
| 52 | ARG tag=latest |
| 53 | SAVE IMAGE --push quay.io/vexxhost/atmosphere:${tag} |
Mohammed Naser | 8613c86 | 2023-04-24 17:26:51 -0400 | [diff] [blame] | 54 | |
| 55 | pin-images: |
Mohammed Naser | 1de5519 | 2023-04-28 17:13:35 -0400 | [diff] [blame^] | 56 | FROM +build.venv.dev |
Mohammed Naser | 8613c86 | 2023-04-24 17:26:51 -0400 | [diff] [blame] | 57 | COPY roles/defaults/defaults/main.yml /defaults.yml |
| 58 | COPY build/pin-images.py /usr/local/bin/pin-images |
| 59 | RUN /usr/local/bin/pin-images /defaults.yml /pinned.yml |
| 60 | SAVE ARTIFACT /pinned.yml AS LOCAL roles/defaults/defaults/main.yml |
Mohammed Naser | d03bba3 | 2023-04-25 12:54:58 +0000 | [diff] [blame] | 61 | |
| 62 | gh: |
| 63 | FROM alpine:3 |
| 64 | RUN apk add --no-cache github-cli |
| 65 | |
| 66 | trigger-image-sync: |
| 67 | FROM +gh |
| 68 | ARG --required project |
| 69 | RUN --secret GITHUB_TOKEN gh workflow run --repo vexxhost/docker-openstack-${project} sync.yml |