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