Skip to content

Commit 0943618

Browse files
authored
Merge pull request #243 from apple/ubuntu1804
Add ubuntu1804 Dockerfile
2 parents 1c1ec73 + 7b63c4b commit 0943618

File tree

2 files changed

+51
-6
lines changed

2 files changed

+51
-6
lines changed

ci_test.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,13 @@
1313

1414
from __future__ import absolute_import, print_function, unicode_literals
1515

16+
import urllib2
17+
import json
1618
import subprocess
1719
import sys
1820
import os
1921

22+
2023
def run_command(cmd, log_file=None):
2124
print("Running: {}".format(cmd))
2225
sys.stdout.flush()
@@ -32,12 +35,18 @@ def run_command(cmd, log_file=None):
3235

3336
def get_dockerfiles():
3437
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)
4150
return dockerfiles
4251

4352

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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

0 commit comments

Comments
 (0)