Skip to content

Commit 1c2a7aa

Browse files
committed
Introduce CI
1 parent 66dc733 commit 1c2a7aa

File tree

4 files changed

+54
-0
lines changed

4 files changed

+54
-0
lines changed

.github/workflows/test.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Copyright 1999-2024. WebPros International GmbH.
2+
name: test
3+
4+
on:
5+
push:
6+
paths:
7+
- 'latest/**'
8+
- 'tests/**'
9+
pull_request:
10+
paths:
11+
- 'latest/**'
12+
- 'tests/**'
13+
14+
jobs:
15+
test:
16+
runs-on: ubuntu-24.04
17+
steps:
18+
- uses: actions/checkout@v4
19+
- run: docker compose -f ./tests/docker-compose.yml run tests

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Dockerfiles for Plesk
22

3+
[![Test Status](https://github.com/plesk/docker/actions/workflows/test.yml/badge.svg)](https://github.com/plesk/docker/actions/workflows/test.yml)
4+
35
Dockerfiles for building Plesk images.
46

57
# Ready to Use Images

tests/docker-compose.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Copyright 1999-2024. WebPros International GmbH.
2+
services:
3+
tests:
4+
build: ../latest/
5+
logging:
6+
driver: none
7+
ports:
8+
["8443:8443"]
9+
tmpfs:
10+
- /tmp
11+
- /run
12+
- /run/lock
13+
volumes:
14+
- /sys/fs/cgroup:/sys/fs/cgroup
15+
- .:/opt/tests/
16+
cgroup: host
17+
command: /opt/tests/wait-for-plesk.sh

tests/wait-for-plesk.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
### Copyright 1999-2024. WebPros International GmbH.
3+
4+
COUNTER=1
5+
6+
while : ; do
7+
curl -ksL https://localhost:8443/ | grep "<title>Plesk" > /dev/null
8+
[ $? -eq 0 ] && exit 0
9+
echo "($COUNTER) Waiting for the Plesk initialization..."
10+
sleep 5
11+
COUNTER=$((COUNTER + 1))
12+
if [ $COUNTER -eq 60 ]; then
13+
echo "Too long, interrupting..."
14+
exit 1
15+
fi
16+
done

0 commit comments

Comments
 (0)