.gitlab-ci.yml 5.04 KB
Newer Older
Eric Timmons's avatar
Eric Timmons committed
1
2
variables:
  GIT_SUBMODULE_STRATEGY: recursive
Eric Timmons's avatar
Eric Timmons committed
3
4
  DOCKER_HUB_CI_REPO: daewok/clpm-ci

Eric Timmons's avatar
Eric Timmons committed
5
include:
6
  - template: 'Workflows/MergeRequest-Pipelines.gitlab-ci.yml'
7
  - local: "/.gitlab-ci.versions.yml"
Eric Timmons's avatar
Eric Timmons committed
8

Eric Timmons's avatar
Eric Timmons committed
9
10
stages:
  - prep
Eric Timmons's avatar
Eric Timmons committed
11
  - build
Eric Timmons's avatar
Eric Timmons committed
12

13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
##############################################################################
# Build Docker images for CI
##############################################################################

.alpine-image:
  stage: prep
  image:
    name: gcr.io/kaniko-project/executor:debug
    entrypoint: [""]
  script:
    - mkdir -p /kaniko/.docker
    - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
    - |
      /kaniko/executor --cache --cache-repo $CI_REGISTRY_IMAGE/kaniko \
                       --context $CI_PROJECT_DIR \
                       --build-arg sbcl_version=$SBCL_VERSION \
                       --build-arg alpine_version=$ALPINE_VERSION \
                       --dockerfile $CI_PROJECT_DIR/docker/Dockerfile.alpine-ci \
                       --destination $CI_REGISTRY_IMAGE/ci:$SBCL_VERSION-alpine$ALPINE_VERSION-$ARCH
32
33
34
35
36
  rules:
    - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_PROJECT_NAMESPACE == "clpm" || $ARCH == "amd64")'
      changes:
        - .gitlab-ci.versions.yml
        - docker/Dockerfile.alpine-ci
37
38
39
40
41
42
43
44
45
46
47
48
49
50

.debian-image:
  stage: prep
  image:
    name: gcr.io/kaniko-project/executor:debug
    entrypoint: [""]
  script:
    - mkdir -p /kaniko/.docker
    - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
    - |
      /kaniko/executor --cache --cache-repo $CI_REGISTRY_IMAGE/kaniko \
                       --context $CI_PROJECT_DIR \
                       --build-arg sbcl_version=$SBCL_VERSION \
                       --build-arg debian_version=$DEBIAN_VERSION \
Eric Timmons's avatar
Eric Timmons committed
51
                       --customPlatform=linux/$ARCH \
52
53
                       --dockerfile $CI_PROJECT_DIR/docker/Dockerfile.debian-ci \
                       --destination $CI_REGISTRY_IMAGE/ci:$SBCL_VERSION-$DEBIAN_VERSION-$ARCH
54
55
56
57
58
  rules:
    - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_PROJECT_NAMESPACE == "clpm" || $ARCH == "amd64")'
      changes:
        - .gitlab-ci.versions.yml
        - docker/Dockerfile.debian-ci
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

alpine-image:amd64:
  extends: .alpine-image
  variables:
    ARCH: amd64

alpine-image:arm64:
  extends: .alpine-image
  variables:
    ARCH: arm64
  tags:
    - arm64

debian-image:amd64:
  extends: .debian-image
  variables:
    ARCH: amd64

debian-image:arm64:
  extends: .debian-image
  variables:
    ARCH: arm64
  tags:
    - arm64

Eric Timmons's avatar
Eric Timmons committed
84
85
86
87
88
89
90
91
92
debian-image:arm:
  extends: .debian-image
  variables:
    ARCH: arm
  tags:
    - arm64
  rules:
    - when: on_success

93
##############################################################################
94
# Build static releases
95
96
##############################################################################

97
.static-release:
98
  stage: build
99
  image: $CI_REGISTRY_IMAGE/ci:$SBCL_VERSION-alpine$ALPINE_VERSION-$ARCH
Eric Timmons's avatar
Eric Timmons committed
100
  before_script:
101
    - git checkout -B $CI_COMMIT_BRANCH $CI_COMMIT_SHA
102
  script:
103
    - sbcl --script scripts/build-release.lisp --static
104
105
  artifacts:
    paths:
106
      - releases/
107

108
109
static-release:linux:amd64:
  extends: .static-release
110
111
112
  variables:
    ARCH: amd64

Eric Timmons's avatar
Eric Timmons committed
113
114
115
116
117
static-release:linux:arm64:
  extends: .static-release
  variables:
    ARCH: arm64
  tags:
118
    - arm64
119
120
  rules:
    - if: '$CI_PROJECT_NAMESPACE == "clpm"'
Eric Timmons's avatar
Eric Timmons committed
121

122
##############################################################################
123
# Build dynamic releases
124
##############################################################################
Eric Timmons's avatar
Eric Timmons committed
125

126
.dynamic-release:
127
  stage: build
128
  image: $CI_REGISTRY_IMAGE/ci:$SBCL_VERSION-$DEBIAN_VERSION-$ARCH
Eric Timmons's avatar
Eric Timmons committed
129
  before_script:
130
    - git checkout -B $CI_COMMIT_BRANCH $CI_COMMIT_SHA
131
  script:
132
    - sbcl --script scripts/build-release.lisp
133
134
  artifacts:
    paths:
135
      - releases/
Eric Timmons's avatar
Eric Timmons committed
136

137
138
dynamic-release:linux:amd64:
  extends: .dynamic-release
Eric Timmons's avatar
Eric Timmons committed
139
140
141
  variables:
    ARCH: amd64

142
143
144
145
146
147
dynamic-release:linux:arm64:
  extends: .dynamic-release
  variables:
    ARCH: arm64
  tags:
    - arm64
148
149
  rules:
    - if: '$CI_PROJECT_NAMESPACE == "clpm"'
Eric Timmons's avatar
Eric Timmons committed
150

Eric Timmons's avatar
Eric Timmons committed
151
152
153
154
155
156
157
158
dynamic-release:linux:armv7:
  extends: .dynamic-release
  variables:
    ARCH: arm
  tags:
    - arm64
  rules:
    - if: '$CI_PROJECT_NAMESPACE == "clpm"'
Eric Timmons's avatar
Eric Timmons committed
159

160
dynamic-release:macos:amd64:
Eric Timmons's avatar
Eric Timmons committed
161
  stage: build
162
  extends: .dynamic-release
Eric Timmons's avatar
Eric Timmons committed
163
164
  tags:
    - macos-0.4-amd64
Eric Timmons's avatar
Eric Timmons committed
165
  needs: []
166
167
  rules:
    - if: '$CI_PROJECT_NAMESPACE == "clpm"'
Eric Timmons's avatar
Eric Timmons committed
168

169
dynamic-release:windows:amd64:
Eric Timmons's avatar
Eric Timmons committed
170
  stage: build
171
  image: $CI_REGISTRY_IMAGE/ci:$SBCL_VERSION-windowsservercore
Eric Timmons's avatar
Eric Timmons committed
172
173
174
175
176
177
178
179
  variables:
    GIT_STRATEGY: clone
    GIT_SUBMODULE_STRATEGY: none
    GIT_CHECKOUT: "false"
  before_script:
    - git checkout -B $CI_COMMIT_BRANCH $CI_COMMIT_SHA
    - git submodule init
    - git submodule update
180
181
182
183
  script:
    - $env:WIX = "C:\wix"
    - sbcl --script scripts/build-release.lisp
    - sbcl --script scripts/build-msi.lisp
184
185
186
187
  artifacts:
    paths:
      - releases/
  rules:
188
    - if: '$CI_PROJECT_NAMESPACE == "clpm"'
Eric Timmons's avatar
Eric Timmons committed
189
  needs: []
Eric Timmons's avatar
Eric Timmons committed
190
191
  tags:
    - windows-amd64