docker/.travis.yml

91 lines
2.9 KiB
YAML

language: bash
services: docker
stages:
- test scripts
# small tests for PRs
- name: test images (amd64)
if: branch != master
# full test for master
- name: test images (full)
if: branch = master
# build and push for master
- name: deploy
if: branch = master
install:
- git clone https://github.com/docker-library/official-images.git ~/official-images
before_script:
- env | sort
- image="friendica/server:${VERSION}${VARIANT:+-$VARIANT}"
- if [[ "$ARCH" == 'i386' ]]; then sed -i -e 's/FROM php/FROM i386\/php/g' "${VERSION}/${VARIANT}/Dockerfile"; fi
script:
- travis_retry docker build -t "$image" "${VERSION}/${VARIANT}"
- ~/official-images/test/run.sh "$image"
- .travis/test-example-dockerfiles.sh "$image"
after_script:
- docker images
jobs:
include:
- &test-scripts
stage: test scripts
env: SCRIPT=update.sh
sudo: false
services: []
install: skip
before_script: skip
script:
- hash_before=$(git write-tree)
- ./update.sh
- bash -c "[[ $hash_before = $(git add -A && git write-tree) ]]"
after_script: skip
- <<: *test-scripts
env: SCRIPT=generate-stackbrew-library.sh
install:
- wget -O "$HOME/bin/bashbrew" https://doi-janky.infosiftr.net/job/bashbrew/lastSuccessfulBuild/artifact/bin/bashbrew-amd64
- chmod +x "$HOME/bin/bashbrew"
script:
- ./generate-stackbrew-library.sh
- <<: *test-scripts
env: SCRIPT=test-entrypoint.sh
script:
- ./.travis/test-entrypoint.sh
- stage: test images (amd64)
env: VERSION=2020.03-dev VARIANT=fpm-alpine ARCH=amd64
- env: VERSION=2020.03-dev VARIANT=fpm ARCH=amd64
- env: VERSION=2020.03-dev VARIANT=apache ARCH=amd64
- env: VERSION=2019.12 VARIANT=fpm-alpine ARCH=amd64
- env: VERSION=2019.12 VARIANT=fpm ARCH=amd64
- env: VERSION=2019.12 VARIANT=apache ARCH=amd64
- stage: test images (full)
env: VERSION=2020.03-dev VARIANT=fpm-alpine ARCH=amd64
- env: VERSION=2020.03-dev VARIANT=fpm-alpine ARCH=i386
- env: VERSION=2020.03-dev VARIANT=fpm ARCH=amd64
- env: VERSION=2020.03-dev VARIANT=fpm ARCH=i386
- env: VERSION=2020.03-dev VARIANT=apache ARCH=amd64
- env: VERSION=2020.03-dev VARIANT=apache ARCH=i386
- env: VERSION=2019.12 VARIANT=fpm-alpine ARCH=amd64
- env: VERSION=2019.12 VARIANT=fpm-alpine ARCH=i386
- env: VERSION=2019.12 VARIANT=fpm ARCH=amd64
- env: VERSION=2019.12 VARIANT=fpm ARCH=i386
- env: VERSION=2019.12 VARIANT=apache ARCH=amd64
- env: VERSION=2019.12 VARIANT=apache ARCH=i386
- stage: deploy
env: SCRIPT=build_and_push.sh
install:
- wget -O "$HOME/bin/bashbrew" https://doi-janky.infosiftr.net/job/bashbrew/lastSuccessfulBuild/artifact/bin/bashbrew-amd64
- chmod +x "$HOME/bin/bashbrew"
script: skip
deploy:
provider: script
script: ./build_and_push.sh