File: buildspec_unit_nix.yml

package info (click to toggle)
aws-crt-python 0.28.4%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 78,428 kB
  • sloc: ansic: 437,955; python: 27,657; makefile: 5,855; sh: 4,289; ruby: 208; java: 82; perl: 73; cpp: 25; xml: 11
file content (181 lines) | stat: -rw-r--r-- 5,887 bytes parent folder | download
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
119
120
121
122
123
124
125
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
#
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
#
---
version: 0.2
env:
  shell: bash
  variables:
    NIXDEV_ARGS: --max-jobs auto
    S2N_NO_HEADBUILD: "1"

batch:
  build-graph:
    # Cache job for x86
    - identifier: nixCache_x86_64
      comment: identifiers can not contain dashes
      env:
        compute-type: BUILD_GENERAL1_LARGE
        image: public.ecr.aws/l1b2r3y5/nix-aws-codebuild:latest
        variables:
          NIX_CACHE_BUCKET: s3://s2n-tls-nixcachebucket-x86-64?region=us-west-2

    # Cache job for aarch64
    - identifier: nixCache_aarch64
      env:
        compute-type: BUILD_GENERAL1_LARGE
        image: public.ecr.aws/l1b2r3y5/nix-aws-codebuild-aarch64:next
        type: ARM_CONTAINER
        variables:
          NIX_CACHE_BUCKET: s3://s2n-tls-nixcachebucket-aarch64?region=us-west-2

    # Openssl30 x86
    - identifier: UnitOpenssl30_x86_64
      depend-on:
        - nixCache_x86_64
      env:
        compute-type: BUILD_GENERAL1_LARGE
        image: public.ecr.aws/l1b2r3y5/nix-aws-codebuild:latest
        privileged-mode: true
        variables:
          NIXDEV_LIBCRYPTO: .#default
          NIX_CACHE_BUCKET: s3://s2n-tls-nixcachebucket-x86-64?region=us-west-2

    # Openssl30 aarch64
    - identifier: UnitOpenssl30_aarch64
      depend-on:
        - nixCache_aarch64
      env:
        compute-type: BUILD_GENERAL1_LARGE
        image: public.ecr.aws/l1b2r3y5/nix-aws-codebuild-aarch64:next
        privileged-mode: true
        type: ARM_CONTAINER
        variables:
          NIXDEV_LIBCRYPTO: .#default
          NIX_CACHE_BUCKET: s3://s2n-tls-nixcachebucket-aarch64?region=us-west-2

    # Openssl111 aarch64
    - identifier: UnitOpenssl111_aarch64
      depend-on:
        - nixCache_aarch64
      env:
        compute-type: BUILD_GENERAL1_LARGE
        image: public.ecr.aws/l1b2r3y5/nix-aws-codebuild-aarch64:next
        privileged-mode: true
        type: ARM_CONTAINER
        variables:
          NIXDEV_LIBCRYPTO: .#openssl111
          NIX_CACHE_BUCKET: s3://s2n-tls-nixcachebucket-aarch64?region=us-west-2

    # Openssl102 aarch64
    - identifier: UnitOpenssl102_aarch64
      depend-on:
        - nixCache_aarch64
      env:
        compute-type: BUILD_GENERAL1_LARGE
        image: public.ecr.aws/l1b2r3y5/nix-aws-codebuild-aarch64:next
        privileged-mode: true
        type: ARM_CONTAINER
        variables:
          NIXDEV_LIBCRYPTO: .#openssl102
          NIX_CACHE_BUCKET: s3://s2n-tls-nixcachebucket-aarch64?region=us-west-2

    # libressl x86
    - identifier: UnitLibressl_x86_64
      depend-on:
        - nixCache_x86_64
      env:
        compute-type: BUILD_GENERAL1_LARGE
        image: public.ecr.aws/l1b2r3y5/nix-aws-codebuild:latest
        privileged-mode: true
        variables:
          NIXDEV_LIBCRYPTO: .#libressl
          NIX_CACHE_BUCKET: s3://s2n-tls-nixcachebucket-x86-64?region=us-west-2

    # awslc x86
    - identifier: UnitAwslc_x86_64
      depend-on:
        - nixCache_x86_64
      env:
        compute-type: BUILD_GENERAL1_LARGE
        image: public.ecr.aws/l1b2r3y5/nix-aws-codebuild:latest
        privileged-mode: true
        variables:
          NIXDEV_LIBCRYPTO: .#awslc
          NIX_CACHE_BUCKET: s3://s2n-tls-nixcachebucket-x86-64?region=us-west-2

    # awslc aarch64
    - identifier: UnitAwslc_aarch64
      depend-on:
        - nixCache_aarch64
      env:
        compute-type: BUILD_GENERAL1_LARGE
        image: public.ecr.aws/l1b2r3y5/nix-aws-codebuild-aarch64:next
        privileged-mode: true
        type: ARM_CONTAINER
        variables:
          NIXDEV_LIBCRYPTO: .#awslc
          NIX_CACHE_BUCKET: s3://s2n-tls-nixcachebucket-aarch64?region=us-west-2

    # awslcfips 2022 aarch64
    - identifier: UnitAwslcFips2022_aarch64
      depend-on:
        - nixCache_aarch64
      env:
        compute-type: BUILD_GENERAL1_LARGE
        image: public.ecr.aws/l1b2r3y5/nix-aws-codebuild-aarch64:next
        privileged-mode: true
        type: ARM_CONTAINER
        variables:
          NIXDEV_LIBCRYPTO: .#awslcfips2022
          NIX_CACHE_BUCKET: s3://s2n-tls-nixcachebucket-aarch64?region=us-west-2

    # awslcfips 2024 aarch64
    - identifier: UnitAwslcFips2024_aarch64
      depend-on:
        - nixCache_aarch64
      env:
        compute-type: BUILD_GENERAL1_LARGE
        image: public.ecr.aws/l1b2r3y5/nix-aws-codebuild-aarch64:next
        privileged-mode: true
        type: ARM_CONTAINER
        variables:
          NIXDEV_LIBCRYPTO: .#awslcfips2024
          NIX_CACHE_BUCKET: s3://s2n-tls-nixcachebucket-aarch64?region=us-west-2

phases:
  install:
    commands:
      - |
        if [[ "$CODEBUILD_BATCH_BUILD_IDENTIFIER" =~ .*"nixCache".* ]]; then
          echo "Refreshing nix cache..."
          nix copy --from $NIX_CACHE_BUCKET --all --no-check-sigs
          nix build $NIXDEV_ARGS .#devShell
          nix copy --to $NIX_CACHE_BUCKET .#devShell;
        else
          echo "Downloading cache"
          nix copy --from $NIX_CACHE_BUCKET --all --no-check-sigs
        fi
  pre_build:
    commands:
      - |
        set -e
        if [[ ! $CODEBUILD_BATCH_BUILD_IDENTIFIER =~ .*"nixCache".* ]]; then
          nix copy --from  $NIX_CACHE_BUCKET --all  --no-check-sigs
          nix develop $NIXDEV_ARGS $NIXDEV_LIBCRYPTO --command bash -c "source ./nix/shell.sh; configure";
        fi
  build:
    commands:
      - |
        set -e
        if [[ ! $CODEBUILD_BATCH_BUILD_IDENTIFIER =~ .*"nixCache".* ]]; then
          nix develop $NIXDEV_ARGS $NIXDEV_LIBCRYPTO --command bash -c "source ./nix/shell.sh; build";
        fi
  post_build:
    commands:
      - |
        set -e
        if [[ ! $CODEBUILD_BATCH_BUILD_IDENTIFIER =~ .*"nixCache".* ]]; then
          nix develop $NIXDEV_ARGS $NIXDEV_LIBCRYPTO --command bash -c "source ./nix/shell.sh; unit"
        fi