.travis.yml 5.94 KB
Newer Older
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
os: linux
dist: focal
language: shell


env:
  global:
    BUILD_SCRIPT: cl-docker-images-build/cl-docker-images-build
    DOCKER_BUILDKIT: "1"
    DOCKER_CLI_EXPERIMENTAL: "enabled"

stages:
  - name: build
  - name: deploy

services:
  - docker

before_install:
  - echo '{"experimental":true}' | sudo tee /etc/docker/daemon.json
  - sudo service docker restart
  - docker info
  - |
    # Log in earlier, to hopefully avoid running into Docker Hub's new pull
    # limits.
    if [ -n "$DOCKER_PASSWORD" ]; then
      docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
    fi
  - |
    if [ "$TRAVIS_BRANCH" = "master" ]; then
      BUILD_TAG_SUFFIX="-tmp-master"
    else
      BUILD_TAG_SUFFIX="-tmp"
    fi
    export BUILD_TAG_SUFFIX

_nonnightly: &nonnightly
38
  if: ((NOT (type = cron) OR env(BASE_IMAGE_UPDATE) = yes) AND NOT (branch =~ ^nightly-.*$))
39
40
41
42

_nightly: &nightly
  allow_failures:
    if: NOT (type = cron)
Eric Timmons's avatar
Eric Timmons committed
43
44
45
46
47
48
49
50
  before_script:
    - mkdir tmp
    - cd tmp
    - git clone https://github.com/Clozure/ccl.git
    - cd ccl
    - export EXTRA_BUILDARGS="--build-arg ref=$(git rev-parse HEAD)"
    - cd ../..
    - rm -rf tmp
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
119
120
121
122
123
124
125

_build_job: &build_job
  stage: build
  script:
    # Pull the previous images
    - $BUILD_SCRIPT pull
    # Build the image
    - $BUILD_SCRIPT build
  after_success: |
    if [ -n "$DOCKER_PASSWORD" ]; then
      $BUILD_SCRIPT push_build_image
    fi

jobs:
  include:
    # Regular images
    # Debian Buster
    - arch: amd64
      env:
        ARCH: amd64
        OS_NAME: debian
        OS_VERSION: "buster"
      <<: [*build_job, *nonnightly]
    - arch: arm64
      env:
        ARCH: arm32v7
        OS_NAME: debian
        OS_VERSION: "buster"
      <<: [*build_job, *nonnightly]
    # Debian Stretch
    - arch: amd64
      env:
        ARCH: amd64
        OS_NAME: debian
        OS_VERSION: "stretch"
      <<: [*build_job, *nonnightly]
    - arch: arm64
      env:
        ARCH: arm32v7
        OS_NAME: debian
        OS_VERSION: "stretch"
      <<: [*build_job, *nonnightly]
    # Ubuntu Focal
    - arch: amd64
      env:
        ARCH: amd64
        OS_NAME: ubuntu
        OS_VERSION: "focal"
      <<: [*build_job, *nonnightly]
    - arch: arm64
      install:
        - unset DOCKER_BUILDKIT
        - sudo apt-get remove -y docker docker.io containerd runc
        - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
        - sudo add-apt-repository "deb [arch=arm64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
        - sudo apt-get update
        - sudo apt-get install -y docker-ce docker-ce-cli containerd.io
      env:
        ARCH: arm32v7
        OS_NAME: ubuntu
        OS_VERSION: "focal"
      <<: [*build_job, *nonnightly]
    # Ubuntu Bionic
    - arch: amd64
      env:
        ARCH: amd64
        OS_NAME: ubuntu
        OS_VERSION: "bionic"
      <<: [*build_job, *nonnightly]
    - arch: arm64
      env:
        ARCH: arm32v7
        OS_NAME: ubuntu
        OS_VERSION: "bionic"
      <<: [*build_job, *nonnightly]
Eric Timmons's avatar
Eric Timmons committed
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
    # Nightly images
    # Debian Buster
    - arch: amd64
      env:
        ARCH: amd64
        OS_NAME: debian
        OS_VERSION: "buster"
        VERSION: nightly
      <<: [*build_job, *nightly]
    - arch: arm64
      env:
        ARCH: arm32v7
        OS_NAME: debian
        OS_VERSION: "buster"
        VERSION: nightly
      <<: [*build_job, *nightly]
    # Debian Stretch
    - arch: amd64
      env:
        ARCH: amd64
        OS_NAME: debian
        OS_VERSION: "stretch"
        VERSION: nightly
      <<: [*build_job, *nightly]
    - arch: arm64
      env:
        ARCH: arm32v7
        OS_NAME: debian
        OS_VERSION: "stretch"
        VERSION: nightly
      <<: [*build_job, *nightly]
    # Ubuntu Focal
    - arch: amd64
      env:
        ARCH: amd64
        OS_NAME: ubuntu
        OS_VERSION: "focal"
        VERSION: nightly
      <<: [*build_job, *nightly]
    - arch: arm64
      install:
        - unset DOCKER_BUILDKIT
        - sudo apt-get remove -y docker docker.io containerd runc
        - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
        - sudo add-apt-repository "deb [arch=arm64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
        - sudo apt-get update
        - sudo apt-get install -y docker-ce docker-ce-cli containerd.io
      env:
        ARCH: arm32v7
        OS_NAME: ubuntu
        OS_VERSION: "focal"
        VERSION: nightly
      <<: [*build_job, *nightly]
    # Ubuntu Bionic
    - arch: amd64
      env:
        ARCH: amd64
        OS_NAME: ubuntu
        OS_VERSION: "bionic"
        VERSION: nightly
      <<: [*build_job, *nightly]
    - arch: arm64
      env:
        ARCH: arm32v7
        OS_NAME: ubuntu
        OS_VERSION: "bionic"
        VERSION: nightly
      <<: [*build_job, *nightly]
    # Deploy nightly
    - arch: amd64
      stage: deploy
197
      if: ((type = cron) AND branch = master)
Eric Timmons's avatar
Eric Timmons committed
198
199
200
201
202
203
204
205
206
207
208
209
      env:
        INCLUDE_WINDOWS_IN_MANIFEST: "no"
        VERSION: nightly
      script:
        - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
        # First, download all the nightly builds, retag them, and push them to
        # the arch specific repos
        - $BUILD_SCRIPT pull_retag_and_push_linux_arch_images
        # Next, create and push all the linux manifests
        - $BUILD_SCRIPT release_linux_manifests
        # Last, release shared manifests
        - $BUILD_SCRIPT release_shared_manifests
210
    # Deploy rebuilds
211
212
    - arch: amd64
      stage: deploy
213
      if: ((type = cron) AND branch = stable)
214
215
216
217
218
219
220
221
222
      script:
        - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
        # First, download all the nightly builds, retag them, and push them to
        # the arch specific repos
        - $BUILD_SCRIPT pull_retag_and_push_linux_arch_images
        # Next, create and push all the linux manifests
        - $BUILD_SCRIPT release_linux_manifests
        # Last, release shared manifests
        - $BUILD_SCRIPT release_shared_manifests