-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Build multi-arch amd64, arm64, armv6, armv7 with buildx * Uses mariadb 10.4, as 10.3 was failing with arm64 tests * Update README.md * Fixes #30
- Loading branch information
Showing
3 changed files
with
116 additions
and
66 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,94 @@ | ||
os: | ||
- linux | ||
|
||
os: linux | ||
dist: xenial | ||
|
||
sudo: required | ||
language: generic | ||
|
||
env: | ||
global: | ||
- NAME=lychee-laravel | ||
- REPO=lycheeorg/lychee-laravel | ||
|
||
matrix: | ||
- DOCKER_REPO=lycheeorg/lychee-laravel | ||
jobs: | ||
- secure: "FXXbM8yDCuf9h17rAyO63XCgI2wJ5EKROY3u1MNxudz54sz3VloZ/SNnVqzdjzYPX9LXfCxVpaDhNLmQtNbqYXg4WBq+5ZuuS0efxFgVaBK0HK6lVoS3/BsJR/U1cglag0Apn2wjFgL3j7d2ZREeG7WIEuDHW5QWcVWhFGWvcAG9JRChFostdde1wbZ6SLTTW2SZFypoRThIdh5PCOnX1oCCmfzeTiCy74uTaiOkkOWsseWeDBy09UrDsFDKd8WX9R7E7g9arv4f9tjzmk1ikQM6Bnfa4YONsY9NjiKFS7/1qfXqg6Z5WfuNr+tW90KrXlk3quCPTn9PEThfqJkgS3BcsLwdhM0OUPx0BXml3RFzYl7jrtj6Wg1vSh6JJIrCh6YrBvg62qRgBs8VPI7QJ60VC56QjhZCiH1YjkjKF0+vVSygC6oJ8wsSciFGu3Cfi4ix6K8iCN90URr6YGl7WOANgfzBTwil/w1Q3IKmzNj6K2UWD+Dm92k/7dkJ2/N5gZ8LUmqhxs5nRzLBZvm77xp/ykRtadP5MHC6HTVHBM6f4tfe6jLWWSi4D8GzQX5sN6Xd2VhvifFsxQeexobhxA918ZjxvUgXHP8mng/WUYccr8DJQmom6uyXpqNpVXGRbjW4CVmgLGBZ05+lgBEmqkyEiXggNRcZipi4E9FICys=" | ||
|
||
language: php | ||
|
||
php: | ||
- '7.2' | ||
|
||
services: | ||
- docker | ||
|
||
addons: | ||
mariadb: '10.3' | ||
|
||
before_install: | ||
- mysql -e 'create database homestead_test;' | ||
- chmod +x deploy.sh | ||
|
||
install: | ||
- docker build --pull -t $REPO':'$TRAVIS_BUILD_NUMBER . | ||
- docker run -d --name=$NAME -e PUID=1000 -e PGID=1000 -e PHP_TZ=America/New_York | ||
-e DB_CONNECTION=mysql -e DB_HOST=mariadb -e DB_PORT=3306 -e DB_DATABASE=homestead_test | ||
-e DB_USERNAME=root -e DB_PASSWORD= -p 127.0.0.1:80:80 $REPO':'$TRAVIS_BUILD_NUMBER | ||
jobs: | ||
include: | ||
|
||
before_script: | ||
# Build and push to staging | ||
- stage: build | ||
before_install: | ||
# Setup multi-arch builds | ||
- curl -fsSL https://get.docker.com | sh | ||
- echo '{"experimental":"enabled"}' | sudo tee /etc/docker/daemon.json | ||
- mkdir -p $HOME/.docker | ||
- echo '{"experimental":"enabled"}' | sudo tee $HOME/.docker/config.json | ||
- sudo service docker start | ||
install: | ||
- docker run --rm --privileged multiarch/qemu-user-static --reset -p yes | ||
- docker buildx create --name xbuilder --use | ||
script: | ||
- docker login -u $REGISTRY_USER -p $REGISTRY_PASS | ||
- echo "Building mulit arch and pushing testing" | ||
- docker buildx build | ||
--progress plain | ||
--platform linux/arm/v7,linux/arm/v6,linux/arm64,linux/amd64 | ||
-t $DOCKER_REPO':testing' | ||
--push | ||
. | ||
|
||
script: | ||
- docker ps -a | awk '{print $NF}' | grep -w $NAME | cat | ||
# Pull images and test them | ||
- stage: "Test amd64" | ||
arch: amd64 | ||
addons: | ||
mariadb: '10.4' | ||
services: docker | ||
before_install: | ||
- sudo mysql -e 'create database homestead_test;' | ||
install: | ||
- docker run -d --name=$NAME -e PUID=1000 -e PGID=1000 -e PHP_TZ=America/New_York | ||
-e DB_CONNECTION=mysql -e DB_HOST=mariadb -e DB_PORT=3306 -e DB_DATABASE=homestead_test | ||
-e DB_USERNAME=root -e DB_PASSWORD= -p 127.0.0.1:80:80 $DOCKER_REPO':testing' | ||
script: | ||
- docker ps -a | awk '{print $NF}' | grep -w $NAME | cat | ||
after_script: | ||
- docker stop $NAME && docker rm $NAME | ||
|
||
# after_success: | ||
# - ./deploy.sh | ||
deploy: | ||
- provider: script | ||
script: ./deploy.sh | ||
skip_cleanup: true | ||
on: | ||
branch: master | ||
- provider: script | ||
script: ./deploy.sh | ||
skip_cleanup: true | ||
on: | ||
tags: true | ||
- provider: script | ||
script: ./deploy.sh | ||
skip_cleanup: true | ||
on: | ||
all_branches: true | ||
# Pull images and test them | ||
- stage: "Test arm64" | ||
arch: arm64 | ||
addons: | ||
mariadb: '10.4' | ||
services: docker | ||
before_install: | ||
- sudo mysql -e 'create database homestead_test;' | ||
install: | ||
- docker run -d --name=$NAME -e PUID=1000 -e PGID=1000 -e PHP_TZ=America/New_York | ||
-e DB_CONNECTION=mysql -e DB_HOST=mariadb -e DB_PORT=3306 -e DB_DATABASE=homestead_test | ||
-e DB_USERNAME=root -e DB_PASSWORD= -p 127.0.0.1:80:80 $DOCKER_REPO':testing' | ||
script: | ||
- docker ps -a | awk '{print $NF}' | grep -w $NAME | cat | ||
after_script: | ||
- docker stop $NAME && docker rm $NAME | ||
|
||
after_script: | ||
- docker stop $NAME && docker rm $NAME | ||
# Finally Push tags and master | ||
- stage: deploy | ||
before_install: | ||
- curl -fsSL https://get.docker.com | sh | ||
- echo '{"experimental":"enabled"}' | sudo tee /etc/docker/daemon.json | ||
- mkdir -p $HOME/.docker | ||
- echo '{"experimental":"enabled"}' | sudo tee $HOME/.docker/config.json | ||
- sudo service docker start | ||
install: | ||
- docker run --rm --privileged multiarch/qemu-user-static --reset -p yes | ||
- docker buildx create --name xbuilder --use | ||
deploy: | ||
- provider: script | ||
on: | ||
branch: master | ||
script: ./deploy.sh | ||
- provider: script | ||
on: | ||
tags: true | ||
script: ./deploy.sh | ||
- provider: script | ||
on: | ||
all_branches: true | ||
script: ./deploy.sh |
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
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