blob: 5c40c75ce570fa69cf91a8e23bbf0e84a5750ce5 [file] [log] [blame]
Mohammed Naserda994232024-04-13 12:34:01 -04001# 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
15FROM golang:1.18 AS octavia-test-server
16ADD --keep-git-dir=true https://opendev.org/openstack/octavia-tempest-plugin.git#master /src
17RUN 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
22FROM registry.atmosphere.dev/library/openstack-venv-builder:main AS build
23ARG TEMPEST_GIT_REF=c0da6e843a74c2392c8e87e8ff36d2fea12949c4
24ADD --keep-git-dir=true https://opendev.org/openstack/tempest.git#${TEMPEST_GIT_REF} /src/tempest
25RUN git -C /src/tempest fetch --unshallow
26ADD --keep-git-dir=true https://opendev.org/openstack/barbican-tempest-plugin.git#master /src/barbican-tempest-plugin
27RUN git -C /src/barbican-tempest-plugin fetch --unshallow
28ADD --keep-git-dir=true https://opendev.org/openstack/cinder-tempest-plugin.git#master /src/cinder-tempest-plugin
29RUN git -C /src/cinder-tempest-plugin fetch --unshallow
30ADD --keep-git-dir=true https://opendev.org/openstack/heat-tempest-plugin.git#master /src/heat-tempest-plugin
31RUN git -C /src/heat-tempest-plugin fetch --unshallow
32ADD --keep-git-dir=true https://opendev.org/openstack/keystone-tempest-plugin.git#master /src/keystone-tempest-plugin
33RUN git -C /src/keystone-tempest-plugin fetch --unshallow
34ADD --keep-git-dir=true https://opendev.org/openstack/neutron-tempest-plugin.git#master /src/neutron-tempest-plugin
35RUN git -C /src/neutron-tempest-plugin fetch --unshallow
36ADD --keep-git-dir=true https://opendev.org/openstack/octavia-tempest-plugin.git#master /src/octavia-tempest-plugin
37RUN git -C /src/octavia-tempest-plugin fetch --unshallow
38ADD https://releases.openstack.org/constraints/upper/master /upper-constraints.txt
39RUN --mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private <<EOF bash -xe
40pip3 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
49EOF
50
51FROM registry.atmosphere.dev/library/openstack-python-runtime:main
52RUN <<EOF bash -xe
53apt-get update -qq
54apt-get install -qq -y --no-install-recommends \
55 iputils-ping openssh-client
56apt-get clean
57rm -rf /var/lib/apt/lists/*
58EOF
59COPY --from=octavia-test-server --link /build/test_server.bin /opt/octavia-tempest-plugin/test_server.bin
60COPY --from=build --link /var/lib/openstack /var/lib/openstack