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