blob: 9747c2b914d7652157ea79b8d65d748752e6bcdb [file] [log] [blame]
Arthur She3d89a912023-07-19 14:17:38 -07001- job:
2 concurrent: true
Gilles Peskine80f035d2024-11-18 16:51:35 +01003 description: Dockerfile building job
Darryl Green0dbe6612025-06-20 09:04:53 +01004 disabled: false
Arthur She3d89a912023-07-19 14:17:38 -07005 dsl: |-
6 timestamps {
7 stage('build-dockerfiles') {
Darryl Greene6a6ce82025-06-19 13:52:34 +01008 node('mbedtls-dockerfile-builder') {
Arthur She3d89a912023-07-19 14:17:38 -07009 dir('src') {
10 deleteDir()
11 checkout([
12 scm: [
13 $class: 'GitSCM',
Bence Szépkútid9231742024-09-12 14:22:51 +020014 userRemoteConfigs: [[
15 url: MBED_TLS_TEST_REPO,
16 credentialsId: mbedtls-github-ssh
17 ]],
Arthur She3d89a912023-07-19 14:17:38 -070018 branches: [[name: MBED_TLS_TEST_BRANCH]],
19 extensions: [
20 [$class: 'CloneOption', timeout: 60],
21 [$class: 'SubmoduleOption', recursiveSubmodules: true],
22 [$class: 'LocalBranch', localBranch: MBED_TLS_TEST_BRANCH],
23 ],
24 ]
25 ])
26 dir('resources') {
27 dir('docker_files') {
28 withCredentials([string(credentialsId: 'DOCKER_AUTH', variable: 'TOKEN')]) {
29 sh """\
30 mkdir -p ${env.HOME}/.docker
31 cat > ${env.HOME}/.docker/config.json << EOF
32 {
33 "auths": {
34 "https://index.docker.io/v1/": {
35 "auth": "\${TOKEN}"
36 }
37 }
38 }
39 EOF
40 chmod 0600 ${env.HOME}/.docker/config.json
41 """
42 }
43 if (BUILD_16_04_DOCKERFILE == "true") {
44 dir('ubuntu-16.04') {
45 sh """\
46 docker build --build-arg ARMLMD_LICENSE_FILE=27000@flexnet.trustedfirmware.org -t trustedfirmware/ci-amd64-mbed-tls-ubuntu:${TAG_FOR_16_04_DOCKERFILE} .
47 docker push trustedfirmware/ci-amd64-mbed-tls-ubuntu:${TAG_FOR_16_04_DOCKERFILE}
48 """
49 }
50 }
51 if (BUILD_18_04_DOCKERFILE == "true") {
52 dir('ubuntu-18.04') {
53 sh """\
54 docker build --build-arg ARMLMD_LICENSE_FILE=27000@flexnet.trustedfirmware.org -t trustedfirmware/ci-amd64-mbed-tls-ubuntu:${TAG_FOR_18_04_DOCKERFILE} .
55 docker push trustedfirmware/ci-amd64-mbed-tls-ubuntu:${TAG_FOR_18_04_DOCKERFILE}
56 """
57 }
58 }
59 if (BUILD_20_04_DOCKERFILE == "true") {
60 dir('ubuntu-20.04') {
61 sh """\
62 docker build --build-arg ARMLMD_LICENSE_FILE=27000@flexnet.trustedfirmware.org -t trustedfirmware/ci-amd64-mbed-tls-ubuntu:${TAG_FOR_20_04_DOCKERFILE} .
63 docker push trustedfirmware/ci-amd64-mbed-tls-ubuntu:${TAG_FOR_20_04_DOCKERFILE}
64 """
65 }
66 }
67 }
68 }
69 }
70 }
71 }
72 }
Bence Szépkúti7d74c252024-05-17 17:44:13 +020073 name: mbedtls-dockerfile-builder
Arthur She3d89a912023-07-19 14:17:38 -070074 parameters:
75 - string:
Bence Szépkútid9231742024-09-12 14:22:51 +020076 default: ssh://git@github.com/Mbed-TLS/mbedtls-test.git
Gilles Peskine80f035d2024-11-18 16:51:35 +010077 description: Mbed TLS test repo/fork
Arthur She3d89a912023-07-19 14:17:38 -070078 name: MBED_TLS_TEST_REPO
Gilles Peskinebe2a48f2024-11-18 19:41:24 +010079 trim: true
Arthur She3d89a912023-07-19 14:17:38 -070080 - string:
Bence Szépkútidbf2b892024-09-06 19:12:46 +020081 default: main
Gilles Peskine80f035d2024-11-18 16:51:35 +010082 description: Branch or commit to build Dockerfile from
Arthur She3d89a912023-07-19 14:17:38 -070083 name: MBED_TLS_TEST_BRANCH
Gilles Peskinebe2a48f2024-11-18 19:41:24 +010084 trim: true
Arthur She3d89a912023-07-19 14:17:38 -070085 - bool:
86 default: false
87 description: Build the Ubuntu 16.04 Docker image
88 name: BUILD_16_04_DOCKERFILE
89 - string:
90 default: ubuntu-16.04-testing
Gilles Peskine80f035d2024-11-18 16:51:35 +010091 description: Tag for the Ubuntu 16.04 Docker image being built
Arthur She3d89a912023-07-19 14:17:38 -070092 name: TAG_FOR_16_04_DOCKERFILE
Gilles Peskinebe2a48f2024-11-18 19:41:24 +010093 trim: true
Arthur She3d89a912023-07-19 14:17:38 -070094 - bool:
95 default: false
96 description: Build the Ubuntu 18.04 Docker image
97 name: BUILD_18_04_DOCKERFILE
98 - string:
99 default: ubuntu-18.04-testing
Gilles Peskine80f035d2024-11-18 16:51:35 +0100100 description: Tag for the Ubuntu 18.04 Docker image being built
Arthur She3d89a912023-07-19 14:17:38 -0700101 name: TAG_FOR_18_04_DOCKERFILE
Gilles Peskinebe2a48f2024-11-18 19:41:24 +0100102 trim: true
Arthur She3d89a912023-07-19 14:17:38 -0700103 - bool:
104 default: false
105 description: Build the Ubuntu 20.04 Docker image
106 name: BUILD_20_04_DOCKERFILE
107 - string:
108 default: ubuntu-20.04-testing
Gilles Peskine80f035d2024-11-18 16:51:35 +0100109 description: Tag for the Ubuntu 20.04 Docker image being built
Arthur She3d89a912023-07-19 14:17:38 -0700110 name: TAG_FOR_20_04_DOCKERFILE
Gilles Peskinebe2a48f2024-11-18 19:41:24 +0100111 trim: true
Arthur She3d89a912023-07-19 14:17:38 -0700112 project-type: pipeline
113 properties:
114 - speed-durability:
115 hint: performance-optimized
116 - build-blocker:
117 block-level: GLOBAL
118 blocking-jobs: []
119 queue-scanning: DISABLED
120 use-build-blocker: false
121 - build-discarder:
122 artifact-days-to-keep: -1
123 artifact-num-to-keep: -1
124 days-to-keep: 60
125 num-to-keep: 100
126 sandbox: true
127 triggers: []