Skip to content

Commit

Permalink
Introduce CI
Browse files Browse the repository at this point in the history
  • Loading branch information
sibprogrammer committed Aug 5, 2024
1 parent 66dc733 commit 1c2a7aa
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 1999-2024. WebPros International GmbH.
name: test

on:
push:
paths:
- 'latest/**'
- 'tests/**'
pull_request:
paths:
- 'latest/**'
- 'tests/**'

jobs:
test:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- run: docker compose -f ./tests/docker-compose.yml run tests
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Dockerfiles for Plesk

[![Test Status](https://github.com/plesk/docker/actions/workflows/test.yml/badge.svg)](https://github.com/plesk/docker/actions/workflows/test.yml)

Dockerfiles for building Plesk images.

# Ready to Use Images
Expand Down
17 changes: 17 additions & 0 deletions tests/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 1999-2024. WebPros International GmbH.
services:
tests:
build: ../latest/
logging:
driver: none
ports:
["8443:8443"]
tmpfs:
- /tmp
- /run
- /run/lock
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup
- .:/opt/tests/
cgroup: host
command: /opt/tests/wait-for-plesk.sh
16 changes: 16 additions & 0 deletions tests/wait-for-plesk.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
### Copyright 1999-2024. WebPros International GmbH.

COUNTER=1

while : ; do
curl -ksL https://localhost:8443/ | grep "<title>Plesk" > /dev/null
[ $? -eq 0 ] && exit 0
echo "($COUNTER) Waiting for the Plesk initialization..."
sleep 5
COUNTER=$((COUNTER + 1))
if [ $COUNTER -eq 60 ]; then
echo "Too long, interrupting..."
exit 1
fi
done

0 comments on commit 1c2a7aa

Please sign in to comment.