build-image #9
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: build-image | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| octavia_version: | |
| type: string | |
| description: "Octavia repository tag or branch (e.g. 'stable/2024.1')" | |
| default: stable/2024.1 | |
| openstack_release: | |
| type: string | |
| description: "OpenStack release name (e.g. 'caracal')" | |
| default: caracal | |
| base_os: | |
| type: string | |
| description: "Base operating system (e.g. 'ubuntu-minimal')" | |
| default: ubuntu-minimal | |
| dist_release_id: | |
| type: string | |
| description: "Distribution release id (e.g. 'jammy')" | |
| default: jammy | |
| image_size: | |
| type: number | |
| description: "Size of the image in gigabyte" | |
| default: 2 | |
| env: | |
| IMAGE_NAME: amphora-x64-haproxy-${{ inputs.openstack_release }}-${{ inputs.base_os }}-${{ inputs.dist_release_id }} | |
| jobs: | |
| build-image: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.9" | |
| cache: "pip" | |
| - name: Install dependencies | |
| env: | |
| OCTAVIA_VERSION: ${{ inputs.octavia_version }} | |
| run: | | |
| python3 -m venv venv | |
| venv/bin/pip install -U pip | |
| venv/bin/pip install -r requirements.txt | |
| sudo apt update | |
| sudo apt install -y qemu-utils git kpartx debootstrap | |
| git clone -b $OCTAVIA_VERSION https://opendev.org/openstack/octavia | |
| - name: Run diskimage-builder | |
| env: | |
| BASE_OS: ${{ inputs.base_os }} | |
| DIST_RELEASE_ID: ${{ inputs.dist_release_id }} | |
| IMAGE_SIZE: ${{ inputs.image_size }} | |
| run: | | |
| source venv/bin/activate | |
| octavia/diskimage-create/diskimage-create.sh -a amd64 -i $BASE_OS -d $DIST_RELEASE_ID -s $IMAGE_SIZE -o $IMAGE_NAME.qcow2 | |
| sha256sum $IMAGE_NAME.qcow2 > $IMAGE_NAME.qcow2.sha256 | |
| - name: Upload image | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ env.IMAGE_NAME }} | |
| path: | | |
| *.qcow2 | |
| *.qcow2.sha256 |