Skip to content

Commit 0f0c511

Browse files
szedergitster
authored andcommitted
travis-ci: install packages in 'ci/install-dependencies.sh'
Ever since we started using Travis CI, we specified the list of packages to install in '.travis.yml' via the APT addon. While running our builds on Travis CI's container-based infrastructure we didn't have another choice, because that environment didn't support 'sudo', and thus we didn't have permission to install packages ourselves. With the switch to the VM-based infrastructure in the previous patch we do get a working 'sudo', so we can install packages by running 'sudo apt-get -y install ...' as well. Let's make use of this and install necessary packages in 'ci/install-dependencies.sh', so all the dependencies (i.e. both packages and "non-packages" (P4 and Git-LFS)) are handled in the same file. Install gcc-8 only in the 'linux-gcc' build job; so far it has been unnecessarily installed in the 'linux-clang' build job as well. Print the versions of P4 and Git-LFS conditionally, i.e. only when they have been installed; with this change even the static analysis and documentation build jobs start using 'ci/install-dependencies.sh' to install packages, and neither of these two build jobs depend on and thus install those. This change will presumably be beneficial for the upcoming Azure Pipelines integration [1]: preliminary versions of that patch series run a couple of 'apt-get' commands to install the necessary packages before running 'ci/install-dependencies.sh', but with this patch it will be sufficient to run only 'ci/install-dependencies.sh'. [1] https://public-inbox.org/git/1a22efe849d6da79f2c639c62a1483361a130238.1539598316.git.gitgitgadget@gmail.com/ Signed-off-by: SZEDER Gábor <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 32ee384 commit 0f0c511

File tree

2 files changed

+29
-27
lines changed

2 files changed

+29
-27
lines changed

.travis.yml

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,6 @@ compiler:
1212
- clang
1313
- gcc
1414

15-
addons:
16-
apt:
17-
sources:
18-
- ubuntu-toolchain-r-test
19-
packages:
20-
- language-pack-is
21-
- git-svn
22-
- apache2
23-
- gcc-8
24-
2515
matrix:
2616
include:
2717
- env: jobname=GETTEXT_POISON
@@ -50,22 +40,11 @@ matrix:
5040
- env: jobname=StaticAnalysis
5141
os: linux
5242
compiler:
53-
addons:
54-
apt:
55-
packages:
56-
- coccinelle
57-
before_install:
5843
script: ci/run-static-analysis.sh
5944
after_failure:
6045
- env: jobname=Documentation
6146
os: linux
6247
compiler:
63-
addons:
64-
apt:
65-
packages:
66-
- asciidoc
67-
- xmlto
68-
before_install:
6948
script: ci/test-documentation.sh
7049
after_failure:
7150

ci/install-dependencies.sh

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@ LFSWHENCE=https://github.com/github/git-lfs/releases/download/v$LINUX_GIT_LFS_VE
1010

1111
case "$jobname" in
1212
linux-clang|linux-gcc)
13+
sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
14+
sudo apt-get -q update
15+
sudo apt-get -q -y install language-pack-is git-svn apache2
16+
case "$jobname" in
17+
linux-gcc)
18+
sudo apt-get -q -y install gcc-8
19+
;;
20+
esac
21+
1322
mkdir --parents "$P4_PATH"
1423
pushd "$P4_PATH"
1524
wget --quiet "$P4WHENCE/bin.linux26x86_64/p4d"
@@ -32,11 +41,25 @@ osx-clang|osx-gcc)
3241
brew link --force gettext
3342
brew install caskroom/cask/perforce
3443
;;
44+
StaticAnalysis)
45+
sudo apt-get -q update
46+
sudo apt-get -q -y install coccinelle
47+
;;
48+
Documentation)
49+
sudo apt-get -q update
50+
sudo apt-get -q -y install asciidoc xmlto
51+
;;
3552
esac
3653

37-
echo "$(tput setaf 6)Perforce Server Version$(tput sgr0)"
38-
p4d -V | grep Rev.
39-
echo "$(tput setaf 6)Perforce Client Version$(tput sgr0)"
40-
p4 -V | grep Rev.
41-
echo "$(tput setaf 6)Git-LFS Version$(tput sgr0)"
42-
git-lfs version
54+
if type p4d >/dev/null && type p4 >/dev/null
55+
then
56+
echo "$(tput setaf 6)Perforce Server Version$(tput sgr0)"
57+
p4d -V | grep Rev.
58+
echo "$(tput setaf 6)Perforce Client Version$(tput sgr0)"
59+
p4 -V | grep Rev.
60+
fi
61+
if type git-lfs >/dev/null
62+
then
63+
echo "$(tput setaf 6)Git-LFS Version$(tput sgr0)"
64+
git-lfs version
65+
fi

0 commit comments

Comments
 (0)