forked from moby/buildkit
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.travis.yml
118 lines (112 loc) · 5.33 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
sudo: required
language: minimal
env:
global:
- DOCKER_CHANNEL="stable"
- DOCKER_CLI_EXPERIMENTAL="enabled"
- PLATFORMS="linux/amd64,linux/arm/v7,linux/arm64,linux/s390x,linux/ppc64le"
- PREFER_BUILDCTL="1"
before_install:
# update docker
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) $DOCKER_CHANNEL"
- sudo apt-get update
- sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce docker-ce-cli
# check
- sudo systemctl restart docker
- docker info
install:
- docker buildx create --name builder --driver docker-container --driver-opt image=$REPO_SLUG_ORIGIN --use
- docker run --rm --privileged tonistiigi/binfmt:latest --install all
- docker run --name buildkit -d --privileged -p 1234:1234 $REPO_SLUG_ORIGIN --debug --addr tcp://0.0.0.0:1234 --oci-worker-gc=false
- sudo docker cp buildkit:/usr/bin/buildctl /usr/bin/
- export BUILDKIT_HOST=tcp://0.0.0.0:1234
after_script:
- if [[ "$TRAVIS_TEST_RESULT" == 1 ]]; then docker ps -a && docker logs buildkit && sudo dmesg; fi
jobs:
include:
- stage: building
name: "Build"
script:
- ./hack/login_ci_cache
- ./hack/build_ci_first_pass binaries
- ./hack/build_ci_first_pass integration-tests
- stage: testing
name: "Client integration tests"
script:
- TESTPKGS=./client TESTFLAGS='-v --timeout=20m' ./hack/test integration
- TESTPKGS=./cmd/buildctl ./hack/test integration
- TESTPKGS=./worker/containerd ./hack/test integration
- script:
- ./hack/lint
- SKIP_INTEGRATION_TESTS=1 ./hack/test integration gateway
- ./hack/validate-vendor
- ./hack/validate-generated-files
- ./hack/validate-shfmt
- TESTPKGS=./frontend ./hack/test
name: "Unit Tests & Lint & Vendor & Proto"
- script:
- TESTPKGS=./frontend/dockerfile TESTFLAGS='-v --parallel=5 --timeout=30m' ./hack/test
name: "Dockerfile integration tests"
- script: TESTPKGS=./frontend/dockerfile ./hack/test dockerfile
name: "External Dockerfile tests"
- script: RUNC_PLATFORMS=$PLATFORMS PLATFORMS="${PLATFORMS},darwin/amd64,windows/amd64" ./hack/cross
name: "Cross"
- script:
- ./hack/images local $REPO_SLUG_TARGET
- TARGET=rootless ./hack/images local $REPO_SLUG_TARGET
name: "Build image"
if: type == cron
# - stage: deploy
# script: skip
# name: "Deploy"
# if: type != pull_request
# deploy:
# - provider: script
# script: ./hack/images master $REPO_SLUG_TARGET push && TARGET=rootless ./hack/images master $REPO_SLUG_TARGET push
# on:
# repo: moby/buildkit
# branch: master
# condition: $TRAVIS_EVENT_TYPE != "cron"
# - provider: script
# script: ./hack/images $TRAVIS_TAG $REPO_SLUG_TARGET push && TARGET=rootless ./hack/images $TRAVIS_TAG $REPO_SLUG_TARGET push && PLATFORMS="${PLATFORMS},darwin/amd64,windows/amd64" ./hack/release-tar $TRAVIS_TAG release-out
# on:
# repo: moby/buildkit
# tags: true
# condition: $TRAVIS_TAG =~ ^v[0-9]
# - provider: releases
# api_key:
# secure: "hA0L2F6O1MLEJEbUDzxokpO6F6QrAIkltmVG3g0tTAoVj1xtCOXSmH3cAnVbFYyOz9q8pa/85tbpyEEIHVlqvWk2a5/QS16QaBW6XxH+FiZ3oQ44JbtpsjpmBFxdhfeFs8Ca6Nj29AOtDx21HHWsZKlBZFvC4Ubc05AM1rgZpJyZVDvYsjZIunc8/CPCbvAAp6RLnLHxAYXF+TQ7mAZP2SewsW/61nPjPIp2P4d93CduA9kUSxtC/1ewmU2T9Ak2X1Nw2ecPTonGjO51xNa6Ebo1hsbsRt5Krd1IR5rSkgXqLrhQO+19J3sUrQr2p8su6hCTKXR5TQz9L5C9VG8T3yOLbA7/FKBndWgBCm7EB7SezhFkm91e3Phkd/Hi5PF4ZKUSKyOYORHpoeg7ggBXaQF5r0OolqvNjxe7EhE+zlUIqnk5eprVrXT8H1QDF0Jg7pfdqVV9AIZO6i+e+1wOVDaP6K6tiWGdkRFH0wahcucZ/8xVoa8JVNZKke2mMCuLGsNWcN4DeLhkxa6giw3tkqbnY+eTYcW/PyVFMAVsZ8rOjQu4u4mm82FYBI7UywWQJTReD1LO2ibxHk74nwtyauX7KsCPFh2CA27DKlsQ1/xkjaCpE6vduzKzPj2DSHp6tKjxn2edPWRI+/4JxLD6KUFX1f1KqD0pKy/qVsZhEPI="
# file: release-out/**/*
# skip_cleanup: true
# file_glob: true
# on:
# repo: moby/buildkit
# tags: true
# condition: $TRAVIS_TAG =~ ^v[0-9]
# - provider: script
# script: ./frontend/dockerfile/cmd/dockerfile-frontend/hack/release master mainline $DF_REPO_SLUG_TARGET push
# on:
# repo: moby/buildkit
# branch: master
# condition: $TRAVIS_EVENT_TYPE != "cron"
# - provider: script
# script: ./frontend/dockerfile/cmd/dockerfile-frontend/hack/release master labs $DF_REPO_SLUG_TARGET push
# on:
# repo: moby/buildkit
# branch: master
# condition: $TRAVIS_EVENT_TYPE != "cron"
# - provider: script
# script: ./frontend/dockerfile/cmd/dockerfile-frontend/hack/release tag $TRAVIS_TAG $DF_REPO_SLUG_TARGET push
# on:
# repo: moby/buildkit
# tags: true
# condition: $TRAVIS_TAG =~ ^dockerfile/[0-9]
# - provider: script
# script: ./frontend/dockerfile/cmd/dockerfile-frontend/hack/release daily _ $DF_REPO_SLUG_TARGET push
# on:
# repo: moby/buildkit
# branch: master
# condition: $TRAVIS_EVENT_TYPE == "cron"
before_deploy:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin