Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merging tusharpm's use-bash #6

Open
wants to merge 5 commits into
base: default
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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(" ")' \

This comment was marked as spam.

This comment was marked as spam.

| 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