2019-04-24 21:52:08 +00:00
|
|
|
language: go
|
2019-11-07 00:59:24 +00:00
|
|
|
|
2019-03-24 15:37:31 +00:00
|
|
|
required: sudo
|
2019-11-07 00:59:24 +00:00
|
|
|
|
2019-04-24 21:52:08 +00:00
|
|
|
go:
|
2019-11-30 16:49:52 +00:00
|
|
|
- "1.13"
|
2019-11-07 00:59:24 +00:00
|
|
|
|
2016-12-17 20:57:09 +00:00
|
|
|
services:
|
2019-11-07 00:59:24 +00:00
|
|
|
- docker
|
2019-10-29 20:54:47 +00:00
|
|
|
|
2019-11-02 14:32:58 +00:00
|
|
|
addons:
|
|
|
|
chrome: stable
|
|
|
|
apt:
|
|
|
|
sources:
|
|
|
|
- google-chrome
|
|
|
|
packages:
|
|
|
|
- google-chrome-stable
|
|
|
|
|
2019-11-30 16:49:52 +00:00
|
|
|
install:
|
2019-12-27 11:07:53 +00:00
|
|
|
- export PATH=$PATH:./cmd/authelia-scripts/:/tmp
|
2019-11-02 14:32:58 +00:00
|
|
|
- source bootstrap.sh
|
2019-10-29 20:54:47 +00:00
|
|
|
|
2019-11-07 00:59:24 +00:00
|
|
|
jobs:
|
|
|
|
include:
|
2019-11-30 16:49:52 +00:00
|
|
|
- stage: build & test
|
|
|
|
before_script:
|
|
|
|
- curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
|
|
|
|
- nvm install v12 && nvm use v12
|
2019-12-04 07:41:59 +00:00
|
|
|
- go mod download
|
2019-11-07 00:59:24 +00:00
|
|
|
script:
|
2019-11-02 14:32:58 +00:00
|
|
|
- authelia-scripts --log-level debug ci
|
2019-11-30 16:49:52 +00:00
|
|
|
|
|
|
|
# Run all suites in a dedicated container
|
|
|
|
- &e2e-test
|
|
|
|
stage: end-to-end suite tests
|
|
|
|
env:
|
|
|
|
- SUITE_NAME=BypassAll
|
|
|
|
before_script:
|
|
|
|
# Install chrome driver
|
2019-12-04 07:41:59 +00:00
|
|
|
# TODO(c.michaud): this could be done in authelia-scripts instead for devs to not do the install themselves.
|
|
|
|
# or even provide a docker image with a selenium server.
|
2019-11-30 16:49:52 +00:00
|
|
|
- wget -N https://chromedriver.storage.googleapis.com/78.0.3904.70/chromedriver_linux64.zip -P ~/
|
|
|
|
- unzip ~/chromedriver_linux64.zip -d ~/
|
|
|
|
- rm ~/chromedriver_linux64.zip
|
2019-12-27 11:07:53 +00:00
|
|
|
- sudo mv -f ~/chromedriver /usr/bin/chromedriver
|
|
|
|
- sudo chmod +x /usr/bin/chromedriver
|
|
|
|
- sudo ln -s /usr/bin/google-chrome-stable /usr/bin/chromium-browser
|
2019-12-04 07:41:59 +00:00
|
|
|
- go mod download
|
2019-11-30 16:49:52 +00:00
|
|
|
script:
|
|
|
|
# Run the suite
|
2019-12-27 11:07:53 +00:00
|
|
|
- authelia-scripts --log-level debug suites test $SUITE_NAME --headless
|
2019-11-30 16:49:52 +00:00
|
|
|
# TODO(c.michaud): check if all suites are listed based on `authelia-scripts suites list` command.
|
|
|
|
- <<: *e2e-test
|
|
|
|
env:
|
|
|
|
- SUITE_NAME=Docker
|
|
|
|
- <<: *e2e-test
|
|
|
|
env:
|
|
|
|
- SUITE_NAME=DuoPush
|
|
|
|
- <<: *e2e-test
|
2020-01-10 04:59:22 +00:00
|
|
|
env:
|
|
|
|
- SUITE_NAME=HAProxy
|
|
|
|
- <<: *e2e-test
|
2019-11-30 16:49:52 +00:00
|
|
|
env:
|
|
|
|
- SUITE_NAME=HighAvailability
|
|
|
|
- <<: *e2e-test
|
|
|
|
env:
|
|
|
|
- SUITE_NAME=Kubernetes
|
|
|
|
- <<: *e2e-test
|
|
|
|
env:
|
|
|
|
- SUITE_NAME=LDAP
|
|
|
|
- <<: *e2e-test
|
|
|
|
env:
|
|
|
|
- SUITE_NAME=Mariadb
|
|
|
|
- <<: *e2e-test
|
|
|
|
env:
|
|
|
|
- SUITE_NAME=NetworkACL
|
|
|
|
- <<: *e2e-test
|
|
|
|
env:
|
|
|
|
- SUITE_NAME=Postgres
|
|
|
|
- <<: *e2e-test
|
|
|
|
env:
|
|
|
|
- SUITE_NAME=ShortTimeouts
|
|
|
|
- <<: *e2e-test
|
|
|
|
env:
|
|
|
|
- SUITE_NAME=Standalone
|
|
|
|
- <<: *e2e-test
|
|
|
|
env:
|
|
|
|
- SUITE_NAME=Traefik
|
|
|
|
|
2019-11-07 00:59:24 +00:00
|
|
|
- &build-images
|
|
|
|
stage: build images
|
2020-01-02 07:03:08 +00:00
|
|
|
if: branch = "master" && type != "pull_request" || branch =~ /^v/
|
2019-11-07 00:59:24 +00:00
|
|
|
env:
|
|
|
|
- ARCH=amd64
|
|
|
|
script:
|
|
|
|
- while sleep 9m; do echo '===== Prevent build from terminating ====='; done &
|
|
|
|
- authelia-scripts docker build --arch=$ARCH
|
|
|
|
- kill %1
|
|
|
|
after_success:
|
|
|
|
- authelia-scripts docker push-image --arch=$ARCH
|
2019-11-28 11:14:34 +00:00
|
|
|
before_deploy:
|
2019-12-24 02:14:52 +00:00
|
|
|
- docker create --name authelia-binary authelia/authelia:${TRAVIS_TAG:1}-$ARCH
|
2019-12-02 19:46:27 +00:00
|
|
|
- docker cp authelia-binary:/usr/app/authelia ./authelia-linux-$ARCH
|
|
|
|
- docker cp authelia-binary:/usr/app/public_html ./
|
2020-01-07 11:28:04 +00:00
|
|
|
- tar -I 'zstdmt -T0 -12' -cf authelia-linux-$ARCH.tar.zst authelia-linux-$ARCH public_html
|
2020-01-06 23:12:37 +00:00
|
|
|
- sha256sum authelia-linux-$ARCH.tar.zst > authelia-linux-$ARCH.tar.zst.sha256
|
2019-11-28 11:14:34 +00:00
|
|
|
deploy:
|
|
|
|
provider: releases
|
2019-11-30 16:49:52 +00:00
|
|
|
api_key: "$GITHUB_API_KEY"
|
2019-11-28 11:14:34 +00:00
|
|
|
file_glob: true
|
2020-01-06 23:12:37 +00:00
|
|
|
file: "authelia-linux-$ARCH.tar.zst*"
|
2019-11-28 11:14:34 +00:00
|
|
|
skip_cleanup: true
|
|
|
|
on:
|
|
|
|
tags: true
|
2019-11-07 00:59:24 +00:00
|
|
|
- <<: *build-images
|
|
|
|
env:
|
|
|
|
- ARCH=arm32v7
|
|
|
|
- <<: *build-images
|
|
|
|
env:
|
|
|
|
- ARCH=arm64v8
|
|
|
|
- stage: deploy manifests
|
2020-01-02 07:03:08 +00:00
|
|
|
if: branch = "master" && type != "pull_request" || branch =~ /^v/
|
2019-11-07 00:59:24 +00:00
|
|
|
env:
|
|
|
|
- DOCKER_CLI_EXPERIMENTAL=enabled
|
|
|
|
script:
|
|
|
|
- authelia-scripts docker push-manifest
|
2019-10-29 20:54:47 +00:00
|
|
|
|
2016-12-17 20:57:09 +00:00
|
|
|
notifications:
|
|
|
|
email:
|
|
|
|
recipients:
|
2019-11-07 00:59:24 +00:00
|
|
|
- clement.michaud34@gmail.com
|
2016-12-17 20:57:09 +00:00
|
|
|
on_success: change
|
|
|
|
on_failure: always
|