File tree 2 files changed +36
-3
lines changed
Filter options
2 files changed +36
-3
lines changed
Original file line number Diff line number Diff line change
1
+ FROM gcr.io/gcp-runtimes/ubuntu_16_0_4:latest
2
+
3
+ # Install Bazel (https://docs.bazel.build/versions/master/install-ubuntu.html)
4
+ RUN apt-get update -y && apt-get install openjdk-8-jdk -y
5
+ RUN echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list
6
+ RUN curl https://bazel.build/bazel-release.pub.gpg | apt-key add -
7
+ RUN apt-get update -y && apt-get install bazel -y
8
+ RUN bazel help info >/dev/null 2>&1
9
+
10
+ # Install Python 2.7.12
11
+ RUN apt-get install python -y
12
+
13
+ # Build par files. We have a source and work directory to avoid
14
+ # stomping on other files as root.
15
+ CMD cp -r /opt/rules_python_source /opt/rules_python && \
16
+ cd /opt/rules_python && \
17
+ bazel clean && \
18
+ bazel build //rules_python:piptool.par //rules_python:whltool.par && \
19
+ cp bazel-bin/rules_python/piptool.par bazel-bin/rules_python/whltool.par /opt/rules_python_source/tools/ && \
20
+ chown --reference=/opt/rules_python_source/update_tools.sh /opt/rules_python_source/tools/piptool.par /opt/rules_python_source/tools/whltool.par
21
+
Original file line number Diff line number Diff line change 16
16
17
17
set -euo pipefail
18
18
19
- bazel build //rules_python:piptool.par //rules_python:whltool.par
20
- cp bazel-bin/rules_python/piptool.par tools/piptool.par
21
- cp bazel-bin/rules_python/whltool.par tools/whltool.par
19
+ usage () {
20
+ echo " Usage: $0 [--nodocker]" 1>&2
21
+ exit 1
22
+ }
23
+
24
+ if [ " $# " -eq 0 ] ; then
25
+ docker build -f tools/update_tools/Dockerfile --tag rules_python:update_tools .
26
+ docker run -v" $PWD " :/opt/rules_python_source rules_python:update_tools
27
+ elif [ " $# " -eq 1 -a " $1 " == " --nodocker" ] ; then
28
+ bazel build //rules_python:piptool.par //rules_python:whltool.par
29
+ cp bazel-bin/rules_python/piptool.par tools/piptool.par
30
+ cp bazel-bin/rules_python/whltool.par tools/whltool.par
31
+ else
32
+ usage
33
+ fi
You can’t perform that action at this time.
0 commit comments