blob: 4d5b174b98f9b449e5b35bd689449bdc419f88c7 [file] [log] [blame]
Mohammed Naser19871ba2023-03-27 22:38:39 +00001# Copyright (c) 2023 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
15name: manila
16
17on:
18 pull_request:
19 paths:
20 - .github/workflows/manila.yml
21 push:
22 branches:
23 - main
24 paths:
25 - .github/workflows/manila.yml
26 workflow_dispatch:
27
28jobs:
29 build-image:
30 runs-on: ubuntu-latest
31 steps:
32 - name: Checkout project
33 uses: actions/checkout@v3
34 with:
35 fetch-depth: 0
36
37 - name: Install dependencies
38 run: |
39 sudo apt-get install -y debootstrap qemu-utils
40 pipx install diskimage-builder==3.28.0
41 pipx install python-swiftclient
42 pipx install poetry
43 poetry self add "poetry-dynamic-versioning[plugin]"
44
45 - name: Clone openstack/manila-image-elements
46 uses: actions/checkout@v3
47 with:
48 repository: openstack/manila-image-elements
49 path: manila-image-elements
50
51 - name: Cache DIB_IMAGE_CACHE
52 uses: actions/cache@v3
53 with:
54 path: ~/.cache/image-create
55 key: dib-image-cache
56
57 - name: Build image
58 run: disk-image-create -o manila-$(poetry version --short).qcow2 vm ubuntu-minimal dhcp-all-interfaces manila-ssh ubuntu-nfs ubuntu-cifs
59 env:
60 ELEMENTS_PATH: manila-image-elements/elements
61
62 - name: Publish image
63 if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
64 run: |
65 swift post -r '.r:*,.rlistings' atmosphere-images
66 swift upload atmosphere-images manila-$(poetry version --short).qcow2
67 env:
68 OS_AUTH_URL: https://auth.vexxhost.net/v3
69 OS_REGION_NAME: ca-ymq-1
70 OS_USER_DOMAIN_NAME: Default
71 OS_USERNAME: ${{ secrets.OS_USERNAME }}
72 OS_PASSWORD: ${{ secrets.OS_PASSWORD }}
73 OS_PROJECT_DOMAIN_NAME: Default
74 OS_PROJECT_NAME: ${{ secrets.OS_PROJECT_NAME }}