mirror of
https://github.com/kingomarnajjar/desktop-environment.git
synced 2026-07-25 22:27:20 +10:00
headless
This commit is contained in:
parent
5f491d7416
commit
2530f9f52a
3 changed files with 27 additions and 10 deletions
8
.github/workflows/build-and-publish.yml
vendored
8
.github/workflows/build-and-publish.yml
vendored
|
|
@ -36,15 +36,13 @@ jobs:
|
|||
tags: ghcr.io/${{ env.REPOSITORY_OWNER }}/desktop-environment:latest
|
||||
|
||||
- name: Run desktop environment tests
|
||||
run: |
|
||||
./docker/scripts/test-start.sh
|
||||
./docker/scripts/test-stop.sh
|
||||
run: ./docker/scripts/test-start.sh
|
||||
env:
|
||||
DESKTOP_ENVIRONMENT_REGISTRY: ghcr.io/${{ env.REPOSITORY_OWNER }}
|
||||
continue-on-error: true
|
||||
|
||||
- name: Run desktop environment
|
||||
run: ./docker/scripts/test-start.sh
|
||||
- name: Start headless desktop environment
|
||||
run: ./docker/scripts/headless.sh
|
||||
env:
|
||||
DESKTOP_ENVIRONMENT_REGISTRY: ghcr.io/${{ env.REPOSITORY_OWNER }}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,13 +7,18 @@ eval "$($REPO_ROOT/docker/scripts/environment.sh)"
|
|||
docker network create $DESKTOP_ENVIRONMENT_DOCKER_NETWORK
|
||||
|
||||
# Set the desktop environment test container name
|
||||
DESKTOP_ENVIRONMENT_CONTAINER_NAME=${DESKTOP_ENVIRONMENT_CONTAINER_IMAGE}-test-$(date +%s)
|
||||
DESKTOP_ENVIRONMENT_CONTAINER_NAME=${DESKTOP_ENVIRONMENT_CONTAINER_IMAGE}-headless
|
||||
|
||||
# Start the desktop environment test container
|
||||
docker run \
|
||||
--detach \
|
||||
--expose 8080 \
|
||||
--name $DESKTOP_ENVIRONMENT_CONTAINER_NAME \
|
||||
--rm \
|
||||
$DESKTOP_ENVIRONMENT_REGISTRY/$DESKTOP_ENVIRONMENT_CONTAINER_IMAGE \
|
||||
sleep infinity
|
||||
|
||||
# Wait until the desktop environment test container is running before proceeding
|
||||
timeout 10 sh -c "until docker inspect $DESKTOP_ENVIRONMENT_CONTAINER_NAME | grep Status | grep -m 1 running >/dev/null; do sleep 1; done"
|
||||
|
||||
# Start the desktop environment inside the container
|
||||
$REPO_ROOT/docker/scripts/exec.sh /home/$DESKTOP_ENVIRONMENT_USER/.config/scripts/startup.sh
|
||||
|
|
@ -3,14 +3,28 @@ REPO_ROOT=$(dirname $(readlink -f $0))/../..
|
|||
# Export desktop environment shell configuration
|
||||
eval "$($REPO_ROOT/docker/scripts/environment.sh)"
|
||||
|
||||
# Ensure the desktop environment test network exists
|
||||
docker network create $DESKTOP_ENVIRONMENT_DOCKER_NETWORK
|
||||
|
||||
# Set the desktop environment test container name
|
||||
DESKTOP_ENVIRONMENT_CONTAINER_NAME=${DESKTOP_ENVIRONMENT_CONTAINER_IMAGE}-test-$(date +%s)
|
||||
|
||||
# Start the desktop environment test container
|
||||
docker run \
|
||||
--detach \
|
||||
--name $DESKTOP_ENVIRONMENT_CONTAINER_NAME \
|
||||
--rm \
|
||||
$DESKTOP_ENVIRONMENT_REGISTRY/$DESKTOP_ENVIRONMENT_CONTAINER_IMAGE \
|
||||
sleep infinity
|
||||
|
||||
# Wait until the desktop environment test container is running before proceeding
|
||||
timeout 10 sh -c "until docker inspect $DESKTOP_ENVIRONMENT_CONTAINER_NAME | grep Status | grep -m 1 running >/dev/null; do sleep 1; done"
|
||||
|
||||
# Remove desktop environment test container
|
||||
docker rm -f $DESKTOP_ENVIRONMENT_CONTAINER_NAME
|
||||
|
||||
# Check desktop environment container started successfully
|
||||
TEST_RESULT=$?
|
||||
|
||||
# Remove desktop environment test container
|
||||
docker rm -f $DESKTOP_ENVIRONMENT_CONTAINER_NAME
|
||||
|
||||
# Exit with test result exit code
|
||||
exit $TEST_RESULT
|
||||
Loading…
Add table
Reference in a new issue