Mohammed Naser | da99423 | 2024-04-13 12:34:01 -0400 | [diff] [blame] | 1 | # Copyright (c) 2024 VEXXHOST, Inc. |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 4 | # not use this file except in compliance with the License. You may obtain |
| 5 | # a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 12 | # License for the specific language governing permissions and limitations |
| 13 | # under the License. |
| 14 | |
| 15 | FROM golang:1.18 AS octavia-test-server |
| 16 | ADD --keep-git-dir=true https://opendev.org/openstack/octavia-tempest-plugin.git#master /src |
| 17 | RUN GO111MODULE=off CGO_ENABLED=0 GOOS=linux go build \ |
| 18 | -a -ldflags '-s -w -extldflags -static' \ |
| 19 | -o /build/test_server.bin \ |
| 20 | /src/octavia_tempest_plugin/contrib/test_server/test_server.go |
| 21 | |
| 22 | FROM registry.atmosphere.dev/library/openstack-venv-builder:main AS build |
| 23 | ARG TEMPEST_GIT_REF=c0da6e843a74c2392c8e87e8ff36d2fea12949c4 |
| 24 | ADD --keep-git-dir=true https://opendev.org/openstack/tempest.git#${TEMPEST_GIT_REF} /src/tempest |
| 25 | RUN git -C /src/tempest fetch --unshallow |
| 26 | ADD --keep-git-dir=true https://opendev.org/openstack/barbican-tempest-plugin.git#master /src/barbican-tempest-plugin |
| 27 | RUN git -C /src/barbican-tempest-plugin fetch --unshallow |
| 28 | ADD --keep-git-dir=true https://opendev.org/openstack/cinder-tempest-plugin.git#master /src/cinder-tempest-plugin |
| 29 | RUN git -C /src/cinder-tempest-plugin fetch --unshallow |
| 30 | ADD --keep-git-dir=true https://opendev.org/openstack/heat-tempest-plugin.git#master /src/heat-tempest-plugin |
| 31 | RUN git -C /src/heat-tempest-plugin fetch --unshallow |
| 32 | ADD --keep-git-dir=true https://opendev.org/openstack/keystone-tempest-plugin.git#master /src/keystone-tempest-plugin |
| 33 | RUN git -C /src/keystone-tempest-plugin fetch --unshallow |
| 34 | ADD --keep-git-dir=true https://opendev.org/openstack/neutron-tempest-plugin.git#master /src/neutron-tempest-plugin |
| 35 | RUN git -C /src/neutron-tempest-plugin fetch --unshallow |
| 36 | ADD --keep-git-dir=true https://opendev.org/openstack/octavia-tempest-plugin.git#master /src/octavia-tempest-plugin |
| 37 | RUN git -C /src/octavia-tempest-plugin fetch --unshallow |
| 38 | ADD https://releases.openstack.org/constraints/upper/master /upper-constraints.txt |
| 39 | RUN --mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private <<EOF bash -xe |
| 40 | pip3 install \ |
| 41 | --constraint /upper-constraints.txt \ |
| 42 | /src/tempest \ |
| 43 | /src/barbican-tempest-plugin \ |
| 44 | /src/cinder-tempest-plugin \ |
| 45 | /src/heat-tempest-plugin \ |
| 46 | /src/keystone-tempest-plugin \ |
| 47 | /src/neutron-tempest-plugin \ |
| 48 | /src/octavia-tempest-plugin |
| 49 | EOF |
| 50 | |
| 51 | FROM registry.atmosphere.dev/library/openstack-python-runtime:main |
| 52 | RUN <<EOF bash -xe |
| 53 | apt-get update -qq |
| 54 | apt-get install -qq -y --no-install-recommends \ |
| 55 | iputils-ping openssh-client |
| 56 | apt-get clean |
| 57 | rm -rf /var/lib/apt/lists/* |
| 58 | EOF |
| 59 | COPY --from=octavia-test-server --link /build/test_server.bin /opt/octavia-tempest-plugin/test_server.bin |
| 60 | COPY --from=build --link /var/lib/openstack /var/lib/openstack |