This repository has been archived by the owner on May 31, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Travis CI configuration * Add arch-pacaur Docker image. * Add basic package tests.
- Loading branch information
Showing
3 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
sudo: required | ||
language: bash | ||
|
||
services: | ||
- docker | ||
|
||
before_install: docker build -t arch-pacaur tests/image | ||
|
||
env: | ||
- TEST="make && sudo make install" | ||
- TEST="tests/test_packages.sh" | ||
|
||
script: docker run -v $(pwd):/home/pacaur/pacaur arch-pacaur /bin/bash -lc "sudo chown -R pacaur .; $TEST" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
FROM base/devel | ||
# update the image and install pacaur dependencies | ||
RUN pacman -Syu --noconfirm | ||
RUN pacman -S --noconfirm git expac | ||
|
||
# prepare the pacaur environment | ||
RUN useradd -m pacaur | ||
RUN echo 'pacaur ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers | ||
|
||
# build cower | ||
USER pacaur | ||
WORKDIR /home/pacaur | ||
RUN git clone https://aur.archlinux.org/cower.git | ||
WORKDIR /home/pacaur/cower | ||
RUN gpg --recv-keys --keyserver hkp://pgp.mit.edu 1EB2638FF56C0C53 | ||
RUN makepkg -sri --noconfirm | ||
|
||
RUN mkdir -p /home/pacaur/pacaur | ||
WORKDIR /home/pacaur/pacaur |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
|
||
## | ||
# Test command given as argument. | ||
# | ||
# $1 = command | ||
## | ||
test_command() | ||
{ | ||
COMMAND="$1 &> /dev/null" | ||
if eval $COMMAND;then | ||
echo OK | ||
else | ||
echo FAILED | ||
ANY_FAILED=true | ||
fi | ||
} | ||
|
||
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )" | ||
# Use this repository pacaur script by default | ||
if [ -z ${PACAUR} ]; then PACAUR="${SCRIPTPATH::-5}pacaur"; fi | ||
# Track any error | ||
ANY_FAILED=false | ||
# Packages to be processed | ||
PACKAGES="shellcheck-static" | ||
|
||
echo "Testing operation with packages:" | ||
echo -n "Update system..." | ||
test_command "${PACAUR} -Syu --noconfirm" | ||
echo -n "Install packages..." | ||
test_command "${PACAUR} -S --noconfirm --noedit ${PACKAGES}" | ||
echo -n "Uninstall packages..." | ||
test_command "${PACAUR} -R --noconfirm ${PACKAGES}" | ||
|
||
if ${ANY_FAILED}; then exit 1; else exit 0; fi |