-
Notifications
You must be signed in to change notification settings - Fork 97
43 lines (34 loc) · 1.01 KB
/
docker-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: Test the current docker image
on:
schedule:
# We want to run it every day
- cron: '0 0 * * *'
jobs:
test-docker-image:
runs-on: ubuntu-22.04
timeout-minutes: 1
services:
ftpserver:
image: fclairamb/ftpserver
ports:
- 2121-2130:2121-2130
steps:
- name: Run sample
env:
SERVER_PORT: 2121
run: |
set -xe
# Getting a file
curl https://placekitten.com/2048/2048 -o kitty.jpg
# Waiting for server to be ready
while ! nc -z localhost ${SERVER_PORT} </dev/null; do sleep 1; done
# Upload a file
curl -v -T kitty.jpg ftp://test:test@localhost:${SERVER_PORT}/remote.jpg
# Download a file
curl -v ftp://test:test@localhost:2121/remote.jpg -o remote.jpg
# Checking that the output file exists
if [ ! -f remote.jpg ]; then
exit 1
fi
# Comparing file contents
diff kitty.jpg remote.jpg