Skip to content
This repository was archived by the owner on Nov 24, 2025. It is now read-only.

Commit 4cf9529

Browse files
dangoghPSUdaemon
authored andcommitted
builds tarball when all rpms being built
1 parent 1be9566 commit 4cf9529

4 files changed

Lines changed: 55 additions & 10 deletions

File tree

build/build.sh

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,30 +27,34 @@ export TC_DIR=$(dirname $(dirname "$topscript"))
2727

2828
checkEnvironment
2929

30-
# Create tarball first
31-
if isInGitTree; then
32-
echo "----- Building tarball ..."
33-
tarball=$(createTarball "$TC_DIR")
34-
ls -l $tarball
35-
else
36-
echo "---- Skipping tarball creation"
37-
fi
3830

3931
if [[ $# -gt 0 ]]; then
4032
projects=( "$*" )
4133
else
4234
# get all subdirs containing build/build_rpm.sh
4335
projects_to_build=( */build/build_rpm.sh )
44-
projects=()
36+
# Always build tarball when building everything..
37+
projects=(tarball)
4538
for p in "${projects_to_build[@]}"; do
4639
p=${p%%/*}
4740
projects+=($p)
4841
done
4942
fi
5043

44+
5145
declare -a badproj
5246
declare -a goodproj
5347
for p in "${projects[@]}"; do
48+
if [[ $p == tarball ]]; then
49+
if isInGitTree; then
50+
echo "----- Building tarball ..."
51+
tarball=$(createTarball "$TC_DIR")
52+
ls -l $tarball
53+
else
54+
echo "---- Skipping tarball creation"
55+
fi
56+
continue
57+
fi
5458
# strip trailing /
5559
p=${p%/}
5660
bldscript="$p/build/build_rpm.sh"

build/functions.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ function checkEnvironment {
103103

104104
# verify required tools available in path -- extra tools required by subsystem are passed in
105105
for pgm in git rpmbuild "$@"; do
106-
type $pgm 2>/dev/null || { echo "$pgm not found in PATH"; exit 1; }
106+
type $pgm 2>/dev/null || { echo "$pgm not found in PATH"; }
107107
done
108108
# verify git version
109109
requiredGitVersion=1.7.12
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
FROM centos:7
18+
19+
MAINTAINER Dan Kirkwood
20+
21+
###
22+
# top level of trafficcontrol directory must be mounted as a volume:
23+
# docker run --volume /trafficcontrol:$(pwd) ...
24+
VOLUME /trafficcontrol
25+
26+
RUN yum -y install \
27+
git && \
28+
yum -y clean all
29+
30+
WORKDIR /trafficcontrol
31+
CMD ./build/build.sh tarball
32+
33+
# vi:syntax=Dockerfile

infrastructure/docker/build/docker-compose.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@
1818
version: '2'
1919

2020
services:
21+
source:
22+
image: trafficcontrol_tarball
23+
build:
24+
dockerfile: infrastructure/docker/build/Dockerfile-source
25+
context: ../../..
26+
volumes:
27+
- ../../..:/trafficcontrol
28+
2129
traffic_monitor_build:
2230
image: traffic_monitor_builder
2331
build:

0 commit comments

Comments
 (0)