guix-docker-images/.travis.yml

70 lines
2.4 KiB
YAML
Raw Normal View History

2019-09-18 07:16:43 +02:00
#
# MetaCall Guix by Parra Studios
2020-10-29 21:30:45 +01:00
# Docker image for using Guix in a CI/CD environment.
2019-09-18 07:16:43 +02:00
#
2020-01-03 01:15:37 +01:00
# Copyright (C) 2016 - 2020 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>
2019-09-18 07:16:43 +02:00
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
language: minimal
branches:
only:
- master
sudo: required
services:
- docker
dist: bionic
# Global environment variables
env:
global:
2019-09-18 07:57:26 +02:00
- DOCKER_VERSION: 19.03.2
- DOCKER_BUILDKIT: 1
2019-09-18 07:16:43 +02:00
2019-09-18 07:29:25 +02:00
# Update Docker
2019-09-18 07:16:43 +02:00
before_script:
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- sudo apt-key fingerprint 0EBFCD88
2019-09-18 07:44:23 +02:00
- sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable edge"
2019-09-19 18:30:10 +02:00
- sudo rm -rf /etc/apt/sources.list.d/pgdg.list
2019-09-18 07:16:43 +02:00
- sudo apt-get update
2019-09-18 07:44:23 +02:00
- apt-cache policy docker-ce
2019-09-18 08:09:24 +02:00
- sudo apt-get install -y docker-ce="5:${DOCKER_VERSION}~3-0~ubuntu-$(lsb_release -cs)"
- sudo mv daemon.json /etc/docker/daemon.json
2019-09-18 09:09:08 +02:00
- sudo systemctl restart docker
- docker version
2019-11-27 00:57:55 +01:00
- |
sh -c 'while true; do echo "."; sleep 60; done' &
export TRAVIS_POLL_INSTALL=$!
- mkdir -vp ~/.docker/cli-plugins/
- curl -sL "https://github.com/docker/buildx/releases/download/v0.5.1/buildx-v0.5.1.linux-amd64" > ~/.docker/cli-plugins/docker-buildx
- chmod a+x ~/.docker/cli-plugins/docker-buildx
- docker buildx version
- kill -9 ${TRAVIS_POLL_INSTALL}
2019-09-18 07:16:43 +02:00
# Run the build and packaging and upload the built images to DockerHub
2019-09-18 07:16:43 +02:00
script:
- docker buildx create --use --name insecure-builder --buildkitd-flags '--allow-insecure-entitlement security.insecure'
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
2019-11-27 00:57:55 +01:00
- |
2019-11-27 01:08:48 +01:00
sh -c 'while true; do echo "."; sleep 60; done' &
2019-11-27 00:57:55 +01:00
export TRAVIS_POLL_BUILD=$!
- docker buildx build -t metacall/guix -o type=registry --allow security.insecure --build-arg METACALL_GUIX_VERSION="1.3.0" --build-arg METACALL_GUIX_ARCH="x86_64" . > logs 2>&1
- kill -9 ${TRAVIS_POLL_BUILD}
2019-11-27 01:56:16 +01:00
- tail -n 500 logs