Skip to content

Commit

Permalink
Modifications on top of #5 ❤️
Browse files Browse the repository at this point in the history
  • Loading branch information
meatballhat committed Jul 18, 2017
1 parent cb312ba commit 6543b48
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 29 deletions.
13 changes: 0 additions & 13 deletions add_sources.rb

This file was deleted.

27 changes: 13 additions & 14 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,22 @@
source `dirname $0`/common.sh

PKG=$1
: "${APT_SOURCE_WHITELIST_UBUNTU_JSON:=https://raw.githubusercontent.com/travis-ci/apt-source-whitelist/master/ubuntu.json}"

export DEBIAN_FRONTEND=noninteractive
fold_start apt_src "Add APT sources"
cd
wget https://raw.githubusercontent.com/travis-ci/apt-source-whitelist/master/ubuntu.json
old_IFS=$IFS
IFS=$'\t'
jq -r '.[]|[.alias,.sourceline,.key_url]|@tsv' ubuntu.json | \
while read -r Alias SourceLine KeyURL; do
echo "------------------------------"
echo "Adding ${Alias}"
if [[ "${KeyURL}" != "" ]]; then
curl -sSL ${KeyURL} | sudo -E env LANG=C.UTF-8 apt-key add - || continue;
fi
sudo -E env LANG=C.UTF-8 apt-add-repository -ys ${SourceLine}
done
IFS=${old_IFS}
cd "${HOME}"
curl -sSL "${APT_SOURCE_WHITELIST_UBUNTU_JSON}" \
| jq -r '.[] | [.alias, .sourceline, .key_url] | join(" ")' \
| while read -r alias sourceline key_url; do
echo "------------------------------"
echo "Adding ${alias}"
if [[ "${key_url}" ]]; then
curl -sSL "${key_url}" \
| sudo -E env LANG=C.UTF-8 apt-key add - || continue;
fi
sudo -E env LANG=C.UTF-8 apt-add-repository -ys "${sourceline}"
done
mkdir -p /var/tmp/deb-sources
cd /var/tmp/deb-sources
sudo apt-get update -qq &>/dev/null
Expand Down
4 changes: 2 additions & 2 deletions run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ ISSUE_REPO=${ISSUE_REPO:-"apt-package-whitelist"} # name of the repo that has is
GITHUB_ISSUES_URL="https://api.github.com/repos/travis-ci/${ISSUE_REPO}/issues/${ISSUE_NUMBER}"

echo "Copying build.sh"
cp build.sh common.sh add_sources.rb $HOME/build
docker exec -u travis $(< docker_id) mv $HOME/build/{build.sh,common.sh,add_sources.rb} $HOME
cp build.sh common.sh $HOME/build
docker exec -u travis $(< docker_id) mv $HOME/build/{build.sh,common.sh} $HOME

echo "Running build.sh"
docker exec -u travis $(< docker_id) bash ${HOME}/build.sh ${PACKAGE}
Expand Down

0 comments on commit 6543b48

Please sign in to comment.