.gitlab-ci.yml 4.39 KB
Newer Older
Eric Timmons's avatar
Eric Timmons committed
1
2
variables:
  GIT_SUBMODULE_STRATEGY: recursive
Eric Timmons's avatar
Fix CI    
Eric Timmons committed
3
  ALPINE_VERSION: "3.13"
Eric Timmons's avatar
Eric Timmons committed
4
5
6
7
8
9
10
11
  ASDF_VERSION: 3.3.4
  SBCL_VERSION: 2.1.1
  DOCKER_HUB_CI_REPO: daewok/clpm-ci

image: clfoundation/sbcl:$SBCL_VERSION-alpine$ALPINE_VERSION

stages:
  - prep
Eric Timmons's avatar
Eric Timmons committed
12
  - build
Eric Timmons's avatar
Eric Timmons committed
13
14
15
16

##############################################################################
# Build CI Images
##############################################################################
Eric Timmons's avatar
Eric Timmons committed
17

Eric Timmons's avatar
Eric Timmons committed
18
19
20
21
22
23
# Build the image used for making the executable.
ci-image:amd64:
  stage: prep
  image:
    name: gcr.io/kaniko-project/executor:debug
    entrypoint: [""]
24
  script:
Eric Timmons's avatar
Eric Timmons committed
25
    - mkdir -p /kaniko/.docker
Eric Timmons's avatar
Eric Timmons committed
26
    - echo "{\"auths\":{\"https://index.docker.io/v1/\":{\"username\":\"$DOCKER_HUB_USERNAME\",\"password\":\"$DOCKER_HUB_PASSWORD\"}}}" > /kaniko/.docker/config.json
Eric Timmons's avatar
Eric Timmons committed
27
    - /kaniko/executor --cache --cache-repo $DOCKER_HUB_CI_REPO --context $CI_PROJECT_DIR --build-arg asdf_version=$ASDF_VERSION --build-arg sbcl_version=$SBCL_VERSION --build-arg alpine_version=$ALPINE_VERSION --dockerfile $CI_PROJECT_DIR/Dockerfile.sbcl-ci --destination $DOCKER_HUB_CI_REPO:$SBCL_VERSION-alpine$ALPINE_VERSION-asdf$ASDF_VERSION-amd64
Eric Timmons's avatar
Eric Timmons committed
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
##############################################################################
# Build static executables
##############################################################################

.static-exec:
  stage: build
  image: $DOCKER_HUB_CI_REPO:$SBCL_VERSION-alpine$ALPINE_VERSION-asdf$ASDF_VERSION-$ARCH
  script:
    - apk add --no-cache openssl-dev openssl-libs-static
    - mkdir -p $BUILD_DIR
    - mkdir -p $RELEASE_DIR
    - sbcl --script scripts/build-core.lisp
    # Dump linkage info.
    - cd /usr/local/src/sbcl-$SBCL_VERSION
    - |
      sbcl --core $CI_PROJECT_DIR/$BUILD_DIR/$CI_PROJECT_NAME.core \
           --non-interactive \
           --load tools-for-build/dump-linkage-info.lisp \
           --eval "(sb-dump-linkage-info:dump-to-file \"$CI_PROJECT_DIR/$BUILD_DIR/linkage-info.sexp\")"
    # Create the linkage table override info.
    - sbcl --script tools-for-build/create-linkage-table-prefill-info-override.lisp "$CI_PROJECT_DIR/$BUILD_DIR/linkage-info.sexp"
    # Build the static runtime.
    - LDLIBS="-lssl" make -C src/runtime static-sbcl
    # Redump the core, this time as an executable.
    - |
      src/runtime/static-sbcl --core $CI_PROJECT_DIR/$BUILD_DIR/$CI_PROJECT_NAME.core \
                              --non-interactive \
                              --eval "(sb-ext:save-lisp-and-die \"$CI_PROJECT_DIR/$RELEASE_DIR/$CI_PROJECT_NAME\" :executable t :toplevel #'uiop:restore-image :compression t :save-runtime-options t)"
  artifacts:
    paths:
      - $BUILD_DIR
      - $RELEASE_DIR

static-exec:linux:amd64:
  extends: .static-exec
  variables:
    ARCH: amd64
    BUILD_DIR: build/linux-amd64
    RELEASE_DIR: build/release/linux-amd64
  needs:
    - ci-image:amd64

Eric Timmons's avatar
Eric Timmons committed
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
# build-glibc:
#   image:
#     name: daewok/sbcl:1.5.2-debian-build
#     entrypoint: [""]
#   stage: build
#   script:
#     - apt-get update
#     - apt-get install -y libssl1.0-dev libsqlite3-dev
#     - echo "(lambda (list) (pushnew :sb-core-compression list) (pushnew :sb-dynamic-core list) (pushnew :sb-linkable-runtime list) list)" > /usr/local/src/sbcl-${SBCL_VERSION}/customize-target-features.lisp
#     - rebuild-sbcl
#     - sbcl --script scripts/build-static.lisp
#     - sbcl --script scripts/build-dynamic.lisp
#     - rm -rf build/cl-cache
#     - mv build build-glibc

# build-musl:
#   image:
#     name: daewok/sbcl:1.5.2-alpine-build
#     entrypoint: [""]
#   stage: build
#   script:
#     - apk add openssl-dev sqlite-static sqlite-dev
#     - echo "(lambda (list) (pushnew :sb-core-compression list) (pushnew :sb-dynamic-core list) (pushnew :sb-linkable-runtime list) list)" > /usr/local/src/sbcl-${SBCL_VERSION}/customize-target-features.lisp
#     - rebuild-sbcl
#     - sbcl --script scripts/build-static.lisp
#     - sbcl --script scripts/build-dynamic.lisp
#     - rm -rf build/cl-cache
#     - mv build build-musl
Eric Timmons's avatar
Eric Timmons committed
99

Eric Timmons's avatar
Eric Timmons committed
100
101
102
103
104
105
106
107
108
109
110
111
# release-glibc:
#   stage: deploy
#   variables:
#     GIT_SUBMODULE_STRATEGY: none
#   script:
#     - mv build-glibc/bin/clpm clpm
#   artifacts:
#     name: clpm-${CI_COMMIT_TAG}-linux-gnu
#     paths:
#       - clpm
#   only:
#     - tags
Eric Timmons's avatar
Eric Timmons committed
112

Eric Timmons's avatar
Eric Timmons committed
113
114
115
116
117
118
119
120
121
122
123
124
# release-musl:
#   stage: deploy
#   variables:
#     GIT_SUBMODULE_STRATEGY: none
#   script:
#     - mv build-musl/bin/clpm clpm
#   artifacts:
#     name: clpm-${CI_COMMIT_TAG}-linux-musl
#     paths:
#       - clpm
#   only:
#     - tags