-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Build testflinger-testenv container image | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- agent/extra/testflinger-testenv/** | ||
workflow_dispatch: | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }}/testflinger-testenv | ||
|
||
jobs: | ||
build-testflinger-testenv: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
with: | ||
config-inline: | | ||
[registry."docker.io"] | ||
mirrors = ["https://github-runner-dockerhub-cache.canonical.com:5000"] | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
- name: Build and push backend Docker image | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: ./agent/extra/testflinger-testenv | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM ubuntu:20.04 | ||
ENV container docker | ||
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y software-properties-common expect sudo openssh-client virtualenv curl wget build-essential python3-setuptools python3-dev python3-pip python3-requests python3-psutil git | ||
RUN pip3 install PyYaml netifaces | ||
RUN adduser -u 1000 --disabled-password ubuntu | ||
RUN echo "ubuntu ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/ubuntu && \ | ||
chmod 0440 /etc/sudoers.d/ubuntu | ||
#Avoid sudo rlimit error | ||
RUN echo "Set disable_coredump false" >> /etc/sudo.conf | ||
USER ubuntu | ||
WORKDIR /home/ubuntu | ||
CMD [ "/bin/bash" ] |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This Dockerfile creates a basic test environment for running the test phase of testflinger agents in a Docker container. |