blob: 230720e71e015c43d78a6b24a327368e66238be1 [file] [log] [blame]
Mohammed Naser1de55192023-04-28 17:13:35 -04001VERSION --use-copy-link 0.7
Mohammed Naser8613c862023-04-24 17:26:51 -04002FROM python:3.10
3
4poetry:
5 RUN pip3 install poetry
6
Mohammed Naser1de55192023-04-28 17:13:35 -04007build.wheels:
Mohammed Naser8613c862023-04-24 17:26:51 -04008 FROM +poetry
9 COPY pyproject.toml poetry.lock ./
Mohammed Naser1de55192023-04-28 17:13:35 -040010 ARG --required only
11 RUN poetry export --only=${only} -f requirements.txt --without-hashes > requirements.txt
Mohammed Naser8613c862023-04-24 17:26:51 -040012 RUN pip wheel -r requirements.txt --wheel-dir=/wheels
13 SAVE ARTIFACT requirements.txt
14 SAVE ARTIFACT /wheels
Mohammed Naser1de55192023-04-28 17:13:35 -040015 SAVE IMAGE --cache-hint
Mohammed Naser8613c862023-04-24 17:26:51 -040016
Mohammed Naser1de55192023-04-28 17:13:35 -040017build.venv:
18 ARG --required only
19 FROM +build.wheels --only ${only}
Mohammed Naser8613c862023-04-24 17:26:51 -040020 RUN python3 -m venv /venv
21 ENV PATH=/venv/bin:$PATH
22 RUN pip install -r requirements.txt
Mohammed Naser1de55192023-04-28 17:13:35 -040023 SAVE IMAGE --cache-hint
24
25build.venv.dev:
26 FROM +build.venv --only main,dev
Mohammed Naser8613c862023-04-24 17:26:51 -040027 SAVE ARTIFACT /venv
28
Mohammed Naser1de55192023-04-28 17:13:35 -040029build.venv.runtime:
30 FROM +build.venv --only main
31 SAVE ARTIFACT /venv
32
33build.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
45image:
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 Naser8613c862023-04-24 17:26:51 -040050 ENV PATH=/venv/bin:$PATH
Mohammed Naser1de55192023-04-28 17:13:35 -040051 ENTRYPOINT ["bash"]
52 ARG tag=latest
53 SAVE IMAGE --push quay.io/vexxhost/atmosphere:${tag}
Mohammed Naser8613c862023-04-24 17:26:51 -040054
55pin-images:
Mohammed Naser1de55192023-04-28 17:13:35 -040056 FROM +build.venv.dev
Mohammed Naser8613c862023-04-24 17:26:51 -040057 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 Naserd03bba32023-04-25 12:54:58 +000061
62gh:
63 FROM alpine:3
64 RUN apk add --no-cache github-cli
65
66trigger-image-sync:
67 FROM +gh
68 ARG --required project
69 RUN --secret GITHUB_TOKEN gh workflow run --repo vexxhost/docker-openstack-${project} sync.yml