37 lines
1.4 KiB
YAML
37 lines
1.4 KiB
YAML
os: linux
|
|
dist: bionic
|
|
language: shell
|
|
git:
|
|
quiet: true
|
|
env:
|
|
global:
|
|
- HADOLINT_VERSION=1.18.0
|
|
services:
|
|
- docker
|
|
before_install:
|
|
- sudo curl -L https://github.com/hadolint/hadolint/releases/download/v$HADOLINT_VERSION/hadolint-$(uname -s)-$(uname -m) -o /usr/local/bin/hadolint
|
|
- sudo chmod 755 /usr/local/bin/hadolint
|
|
- CLIENT_PORT=$(cat /dev/urandom|od -N2 -An -i|awk -v f=10000 -v r=19999 '{printf "%i\n", f + r * $1 / 65536}')
|
|
- "[ $(netstat -an | grep LISTEN | grep :$CLIENT_PORT | wc -l) -eq 0 ] || { ./$0 && exit 0 || exit 1; }"
|
|
install:
|
|
- docker build
|
|
--no-cache
|
|
--tag ${TRAVIS_REPO_SLUG}:${TRAVIS_COMMIT} .
|
|
- docker build
|
|
--no-cache
|
|
--tag ${TRAVIS_REPO_SLUG}:nossl
|
|
-f Dockerfile_nossl .
|
|
script:
|
|
- DOCKERCONTAINER=$(docker run -d -p 127.0.0.1:${CLIENT_PORT}:21 -e ADDRESS=ftp.example.com ${TRAVIS_REPO_SLUG}:${TRAVIS_COMMIT})
|
|
- sleep 5
|
|
- docker ps -f id=${DOCKERCONTAINER}
|
|
- nc 127.0.0.1 ${CLIENT_PORT} < /dev/null
|
|
- hadolint Dockerfile
|
|
- hadolint Dockerfile_nossl
|
|
- docker stop ${DOCKERCONTAINER} && docker rm -fv ${DOCKERCONTAINER}
|
|
after_success:
|
|
- docker tag ${TRAVIS_REPO_SLUG}:${TRAVIS_COMMIT} aminvakil/alpine-ftp-server-tls
|
|
- echo "$DOCKER_PASSWORD" | docker login -u aminvakil --password-stdin
|
|
- docker push aminvakil/alpine-ftp-server-tls
|
|
- docker tag ${TRAVIS_REPO_SLUG}:nossl aminvakil/alpine-ftp-server-tls:nossl
|
|
- docker push aminvakil/alpine-ftp-server-tls:nossl
|