File tree Expand file tree Collapse file tree 2 files changed +51
-6
lines changed
swift-ci/master/ubuntu/18.04 Expand file tree Collapse file tree 2 files changed +51
-6
lines changed Original file line number Diff line number Diff line change 13
13
14
14
from __future__ import absolute_import , print_function , unicode_literals
15
15
16
+ import urllib2
17
+ import json
16
18
import subprocess
17
19
import sys
18
20
import os
19
21
22
+
20
23
def run_command (cmd , log_file = None ):
21
24
print ("Running: {}" .format (cmd ))
22
25
sys .stdout .flush ()
@@ -32,12 +35,18 @@ def run_command(cmd, log_file=None):
32
35
33
36
def get_dockerfiles ():
34
37
dockerfiles = []
35
- docker_dir = os .path .dirname (os .path .realpath (__file__ ))
36
- for root , dirs , files in os .walk (docker_dir ):
37
- for file in files :
38
- if file == "Dockerfile" :
39
- dockerfiles .append (root )
40
- dockerfiles .sort (reverse = True )
38
+ GITHUB_API_URL = "https://api.github.com"
39
+ response = urllib2 .urlopen ("{}/repos/{}/pulls/{}/files" .format (GITHUB_API_URL ,
40
+ os .environ ['ghprbGhRepository' ],
41
+ os .environ ['ghprbPullId' ]))
42
+ data = json .load (response )
43
+
44
+ for file_info in data :
45
+ filename = file_info ['filename' ]
46
+ print (filename )
47
+ if "Dockerfile" in filename :
48
+ file_dir = filename .replace ("Dockerfile" , "" )
49
+ dockerfiles .append (file_dir )
41
50
return dockerfiles
42
51
43
52
Original file line number Diff line number Diff line change
1
+ FROM ubuntu:18.04
2
+
3
+ RUN groupadd -g 998 build-user && \
4
+ useradd -m -r -u 998 -g build-user build-user
5
+
6
+ ENV DEBIAN_FRONTEND="noninteractive"
7
+
8
+ RUN apt -y update && apt -y install \
9
+ build-essential \
10
+ clang \
11
+ cmake \
12
+ git \
13
+ icu-devtools \
14
+ libcurl4-openssl-dev \
15
+ libedit-dev \
16
+ libicu-dev \
17
+ libncurses5-dev \
18
+ libpython3-dev \
19
+ libsqlite3-dev \
20
+ libxml2-dev \
21
+ ninja-build \
22
+ pkg-config \
23
+ python \
24
+ python-six \
25
+ python3-six \
26
+ python3-distutils \
27
+ rsync \
28
+ swig \
29
+ systemtap-sdt-dev \
30
+ tzdata \
31
+ unzip \
32
+ uuid-dev
33
+
34
+ USER build-user
35
+
36
+ WORKDIR /home/build-user
You can’t perform that action at this time.
0 commit comments