blob: 888110c3d1e4095bcc3a293f4fdf76e6a9f9374f [file] [log] [blame]
Mohammed Naser1de55192023-04-28 17:13:35 -04001VERSION --use-copy-link 0.7
Mohammed Naser8613c862023-04-24 17:26:51 -04002
Mohammed Naser168acc32024-01-09 17:15:26 -05003go.build:
4 FROM golang:1.21
5 WORKDIR /src
6 ARG GOOS=linux
7 ARG GOARCH=amd64
8 ARG VARIANT
9 COPY --dir go.mod go.sum ./
10 RUN go mod download
11
12libvirt-tls-sidecar.build:
13 FROM +go.build
14 ARG GOOS=linux
15 ARG GOARCH=amd64
16 ARG VARIANT
17 COPY --dir cmd internal ./
18 RUN GOARM=${VARIANT#"v"} go build -o main cmd/libvirt-tls-sidecar/main.go
19 SAVE ARTIFACT ./main
20
21libvirt-tls-sidecar.platform-image:
22 ARG TARGETPLATFORM
23 ARG TARGETARCH
24 ARG TARGETVARIANT
25 FROM --platform=$TARGETPLATFORM ./images/base+image
26 COPY \
27 --platform=linux/amd64 \
28 (+libvirt-tls-sidecar.build/main --GOARCH=$TARGETARCH --VARIANT=$TARGETVARIANT) /usr/bin/libvirt-tls-sidecar
29 ENTRYPOINT ["/usr/bin/libvirt-tls-sidecar"]
30 LABEL org.opencontainers.image.source=https://github.com/vexxhost/atmosphere
31 SAVE IMAGE --push ghcr.io/vexxhost/atmosphere/libvirt-tls-sidecar:latest
32
33libvirt-tls-sidecar.image:
34 BUILD --platform=linux/amd64 --platform=linux/arm64 +libvirt-tls-sidecar.platform-image
35
Mohammed Naser1de55192023-04-28 17:13:35 -040036build.wheels:
Mohammed Naser7060df82023-12-29 15:12:17 -050037 FROM ./images/builder+image
Mohammed Naser8613c862023-04-24 17:26:51 -040038 COPY pyproject.toml poetry.lock ./
Mohammed Naser1de55192023-04-28 17:13:35 -040039 ARG --required only
40 RUN poetry export --only=${only} -f requirements.txt --without-hashes > requirements.txt
Mohammed Naser8613c862023-04-24 17:26:51 -040041 RUN pip wheel -r requirements.txt --wheel-dir=/wheels
42 SAVE ARTIFACT requirements.txt
43 SAVE ARTIFACT /wheels
Mohammed Naser1de55192023-04-28 17:13:35 -040044 SAVE IMAGE --cache-hint
Mohammed Naser8613c862023-04-24 17:26:51 -040045
Mohammed Naser1de55192023-04-28 17:13:35 -040046build.venv:
47 ARG --required only
48 FROM +build.wheels --only ${only}
Mohammed Naser8613c862023-04-24 17:26:51 -040049 RUN python3 -m venv /venv
50 ENV PATH=/venv/bin:$PATH
51 RUN pip install -r requirements.txt
Mohammed Naser1de55192023-04-28 17:13:35 -040052 SAVE IMAGE --cache-hint
53
54build.venv.dev:
55 FROM +build.venv --only main,dev
Mohammed Naser8613c862023-04-24 17:26:51 -040056 SAVE ARTIFACT /venv
57
Mohammed Naser1de55192023-04-28 17:13:35 -040058build.venv.runtime:
59 FROM +build.venv --only main
60 SAVE ARTIFACT /venv
61
62build.collections:
63 FROM +build.venv.runtime
64 COPY charts /src/charts
65 COPY meta /src/meta
66 COPY playbooks /src/playbooks
67 COPY plugins /src/plugins
68 COPY roles /src/roles
69 COPY galaxy.yml /src/galaxy.yml
70 RUN ansible-galaxy collection install --collections-path /usr/share/ansible/collections /src
71 SAVE ARTIFACT /usr/share/ansible/collections
72 SAVE IMAGE --cache-hint
73
74image:
Michiel Piscaerb19c1cf2024-01-08 22:09:04 +010075 ARG RELEASE=2023.1
76 FROM ./images/cloud-archive-base+image --RELEASE ${RELEASE}
Mohammed Naser1de55192023-04-28 17:13:35 -040077 ENV ANSIBLE_PIPELINING=True
Mohammed Naseraa48ddb2023-12-30 00:11:22 -050078 DO ./images+APT_INSTALL --PACKAGES "rsync openssh-client"
Mohammed Nasere720d782023-07-10 15:57:21 -040079 COPY +build.venv.runtime/venv /venv
80 ENV PATH=/venv/bin:$PATH
81 COPY +build.collections/ /usr/share/ansible
Mohammed Naser1de55192023-04-28 17:13:35 -040082 ARG tag=latest
Mohammed Naserccc70cc2023-04-28 22:20:34 +000083 SAVE IMAGE --push ghcr.io/vexxhost/atmosphere:${tag}
Mohammed Naser8613c862023-04-24 17:26:51 -040084
Mohammed Naser7060df82023-12-29 15:12:17 -050085images:
Mohammed Naser05726e72024-01-02 14:55:33 -050086 BUILD ./images/barbican+image
Mohammed Naser9b9b3e22024-01-02 15:17:43 -050087 BUILD ./images/cinder+image
Mohammed Naser7060df82023-12-29 15:12:17 -050088 BUILD ./images/cluster-api-provider-openstack+image
Mohammed Naser6a31b342024-01-02 15:26:44 -050089 BUILD ./images/designate+image
Mohammed Naser05726e72024-01-02 14:55:33 -050090 BUILD ./images/glance+image
91 BUILD ./images/heat+image
Mohammed Naserc6392302024-01-04 00:43:02 -050092 BUILD ./images/horizon+image
93 BUILD ./images/ironic+image
94 BUILD ./images/keystone+image
Mohammed Naser19d63122024-01-08 17:10:05 -050095 BUILD ./images/libvirtd+image
Mohammed Naserc6392302024-01-04 00:43:02 -050096 BUILD ./images/magnum+image
97 BUILD ./images/manila+image
98 BUILD ./images/neutron+image
99 BUILD ./images/nova-ssh+image
100 BUILD ./images/nova+image
Mohammed Naser05726e72024-01-02 14:55:33 -0500101 BUILD ./images/octavia+image
Mohammed Naser19d63122024-01-08 17:10:05 -0500102 BUILD ./images/openvswitch+image
103 BUILD ./images/ovn+images
Mohammed Naser05726e72024-01-02 14:55:33 -0500104 BUILD ./images/placement+image
Mohammed Nasera7301772024-01-02 15:02:39 -0500105 BUILD ./images/senlin+image
Mohammed Naser19d63122024-01-08 17:10:05 -0500106 BUILD ./images/tempest+image
Mohammed Naser7060df82023-12-29 15:12:17 -0500107
Mohammed Naser8613c862023-04-24 17:26:51 -0400108pin-images:
Mohammed Naser1de55192023-04-28 17:13:35 -0400109 FROM +build.venv.dev
ricolinb8ab0172023-06-01 15:41:02 +0800110 COPY roles/defaults/vars/main.yml /defaults.yml
Mohammed Naser8613c862023-04-24 17:26:51 -0400111 COPY build/pin-images.py /usr/local/bin/pin-images
Mohammed Naserc6392302024-01-04 00:43:02 -0500112 RUN --no-cache /usr/local/bin/pin-images /defaults.yml /pinned.yml
ricolinb8ab0172023-06-01 15:41:02 +0800113 SAVE ARTIFACT /pinned.yml AS LOCAL roles/defaults/vars/main.yml
Mohammed Naserd03bba32023-04-25 12:54:58 +0000114
115gh:
116 FROM alpine:3
117 RUN apk add --no-cache github-cli
118
119trigger-image-sync:
120 FROM +gh
121 ARG --required project
122 RUN --secret GITHUB_TOKEN gh workflow run --repo vexxhost/docker-openstack-${project} sync.yml
Mohammed Naser0c428872023-09-21 12:59:20 +0000123
124image-sync:
125 FROM golang:1.19
126 ARG --required project
127 WORKDIR /src
128 COPY . /src
129 RUN --secret GITHUB_TOKEN go run ./cmd/atmosphere-ci image repo sync ${project}