# # MetaCall Guix by Parra Studios # Docker image for using GuixSD in a CI/CD environment. # # Copyright (C) 2016 - 2019 Vicente Eduardo Ferrer Garcia # # 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: - DOCKER_VERSION: 19.03.2 - DOCKER_BUILDKIT: 1 # Update Docker before_script: - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - - sudo apt-key fingerprint 0EBFCD88 - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable edge" - sudo apt-get update - apt-cache policy docker-ce - sudo apt-get install -y docker-ce="5:${DOCKER_VERSION}~3-0~ubuntu-$(lsb_release -cs)" - sudo mv daemon.json /etc/docker/daemon.json - sudo systemctl restart docker - docker version - docker build --platform=local -o . git://github.com/docker/buildx > logs 2>&1 - tail -n 500 logs - mkdir -p ~/.docker/cli-plugins/ - mv buildx ~/.docker/cli-plugins/docker-buildx # Run the build and packaging script: - docker buildx create --use --name insecure-builder --buildkitd-flags '--allow-insecure-entitlement security.insecure' - sh -c 'while true; do echo "."; sleep 300; done' & - TRAVIS_POLL=$! - echo "Polling process pid (${TRAVIS_POLL})" - docker buildx build --tag metacall/guix --allow security.insecure --build-arg METACALL_GUIX_VERSION="1.0.1" --build-arg METACALL_GUIX_ARCH="x86_64" . > logs 2>&1 - tail -n 500 logs - kill -9 ${TRAVIS_POLL} # Upload the built images to DockerHub after_script: - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin - docker push metacall/guix