Test the current docker image #1222
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
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 |