lhauspie / docker-vsftpd-alpine

Docker image that provides a vsftpd server, with some interesting features
GNU General Public License v3.0
14 stars 11 forks source link

Add CI #8

Open MawsFr opened 3 years ago

MawsFr commented 3 years ago

Description

This replies to the issue #6. It adds a tests and CI to the project that runs tests, builds and pushes the images on Docker hub.

Where are tests

Tests are stored in a nodejs Typescript project in folder <root>/tests. I used testcontainers with the nodejs lib. For the moment there is one test. You can ask for more if needed.

How it works

If you test the CI with workflow make sure your have set the requirments in the chapter Requirements below.

The Dockerfile contained in <root>/tests/ftp-client is used to create an ftp client that can be used in all tests to make calls to the vsftpd server by extending it in other Dockerfiles and replacing its entrypoint like <root>/tests/upload/upload-docker-image/Dockerfile. The build workflow needs to also push it on dockerhub. If you want I can use this instead.

When the command npm run tests is run, the test contained in <root>/tests/upload/upload.spec.ts uses testcontainers to run the <root>/tests/upload/upload-docker-compose.test.yml file.

This file launches two services:

When the uploading is done I compare the checksum of the source file used to be uploaded and the newly uploaded file in <root>/tests/upload/volume-files.

Requirements to test the workflows

To be able to test this PR, you must create an Environment (go here) named test and add following secrets

Name Description
DOCKERHUB_CENTOS_FTP_IMAGE_REPOSITORY The name of the repository that stores the ftp client image. example : lhauspie/centos-ftp
DOCKERHUB_USERNAME Your docker hub username
DOCKERHUB_TOKEN A token generated with your docker hub account (See Create access token)
DOCKERHUB_VSFTPD_IMAGE_REPOSITORY The name of the repository that stores the vsftpd image. example : lhauspie/vsftpd

Github action Workflows

There are two Github action workflows in the folder .github/workflows.

Technologies used

This PR is considered as stable. If you want me to modify something don't hesitate.

Linked to issue #6

hacktoberfest

lhauspie commented 3 years ago

Thanks for your PR and for your interest for this vsftpd docker image.

I will have a look soon.

Regards.