Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c232206
commit 7402632
Showing
25 changed files
with
235 additions
and
864 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,3 @@ | ||
[submodule "packaging/rpm"] | ||
path = packaging/rpm | ||
url = https://github.com/phusion/passenger_rpm_automation.git |
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 |
---|---|---|
@@ -1,15 +1,16 @@ | ||
language: ruby | ||
|
||
env: | ||
- TEST_CXX=1 TEST_NODE=1 | ||
- TEST_CXX=1 SUDO=1 | ||
- TEST_RUBY=1 TEST_RUBY_VERSION=1.8.7 TEST_CLASSIC_RAILS=0 TEST_RUBYGEMS_VERSION=1.8.25 | ||
- TEST_RUBY=1 TEST_RUBY_VERSION=1.9.3 TEST_CLASSIC_RAILS=0 | ||
- TEST_NGINX=1 TEST_STANDALONE=1 | ||
- TEST_APACHE2=1 | ||
- TEST_SOURCE_PACKAGING=1 TEST_DEBIAN_PACKAGING=1 | ||
# - TEST_CXX=1 TEST_NODE=1 | ||
# - TEST_CXX=1 SUDO=1 | ||
# - TEST_RUBY=1 TEST_RUBY_VERSION=1.8.7 TEST_CLASSIC_RAILS=0 TEST_RUBYGEMS_VERSION=1.8.25 | ||
# - TEST_RUBY=1 TEST_RUBY_VERSION=1.9.3 TEST_CLASSIC_RAILS=0 | ||
# - TEST_NGINX=1 TEST_STANDALONE=1 | ||
# - TEST_APACHE2=1 | ||
# - TEST_SOURCE_PACKAGING=1 TEST_DEBIAN_PACKAGING=1 | ||
- TEST_RPM_PACKAGING=1 | ||
|
||
script: ./dev/run_travis.sh | ||
script: ./dev/ci/run_travis.sh | ||
|
||
notifications: | ||
slack: phusionnl:PH5p7JYXyv2XLDpICHh8Nj6F |
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
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
This file was deleted.
Oops, something went wrong.
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,24 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
if grep -q docker_env /etc/group; then | ||
delgroup docker_env >/dev/null | ||
fi | ||
|
||
chown -R "$APP_UID:$APP_GID" /home/appa | ||
groupmod -g "$APP_GID" appa | ||
usermod -u "$APP_UID" -g "$APP_GID" appa | ||
|
||
groupmod -g "$DOCKER_GID" docker | ||
usermod -a -G docker appa | ||
|
||
# There's something strange with either Docker or the kernel, so that | ||
# the 'appa' user cannot access its home directory even after a proper | ||
# chown/chmod. We work around it like this. | ||
mv /home/appa /home/appa2 | ||
cp -dpR /home/appa2 /home/appa | ||
rm -rf /home/appa2 | ||
|
||
if [[ $# -gt 0 ]]; then | ||
exec "$@" | ||
fi |
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,53 @@ | ||
#!/bin/bash | ||
# This script is run by Jenkins, to execute tests in the CI environment. | ||
|
||
set -e | ||
|
||
PASSENGER_ROOT=`dirname "$0"` | ||
PASSENGER_ROOT=`cd "$PASSENGER_ROOT/../.." && pwd` | ||
WORKSPACE=${WORKSPACE:-/tmp} | ||
|
||
JENKINS_CACHE_DIR="$WORKSPACE/jenkins_cache" | ||
mkdir -p "$JENKINS_CACHE_DIR" | ||
if [[ "$TEST_RPM_BUILDING" != 0 ]]; then | ||
rm -rf "$JENKINS_CACHE_DIR/passenger_rpm/output" | ||
fi | ||
|
||
function run_exec() | ||
{ | ||
echo "$ $@" | ||
exec "$@" | ||
} | ||
|
||
# We do not use the my_init inside the image to work around | ||
# a bug in baseimage-docker 0.9.12: pressing Ctrl-C does | ||
# not properly result in a non-zero exit status. | ||
run_exec docker run --rm -t -i \ | ||
-v "$PASSENGER_ROOT:/passenger" \ | ||
-v /var/run/docker.sock:/docker.sock \ | ||
-v "$JENKINS_CACHE_DIR:/host_cache" \ | ||
-e "DOCKER_HOST=unix:///docker.sock" \ | ||
-e "DOCKER_GID=`getent group docker | cut -d: -f3`" \ | ||
-e "PASSENGER_ROOT_ON_DOCKER_HOST=$PASSENGER_ROOT" \ | ||
-e "CACHE_DIR_ON_DOCKER_HOST=$JENKINS_CACHE_DIR" \ | ||
-e "APP_UID=`id -u`" \ | ||
-e "APP_GID=`id -g`" \ | ||
-e "SUDO=$SUDO" \ | ||
-e "TEST_CXX=$TEST_CXX" \ | ||
-e "TEST_RUBY=$TEST_RUBY" \ | ||
-e "TEST_NODE=$TEST_NODE" \ | ||
-e "TEST_RUBY_VERSION=$TEST_RUBY_VERSION" \ | ||
-e "TEST_CLASSIC_RAILS=$TEST_CLASSIC_RAILS" \ | ||
-e "TEST_RUBYGEMS_VERSION=$TEST_RUBYGEMS_VERSION" \ | ||
-e "TEST_NGINX=$TEST_NGINX" \ | ||
-e "TEST_APACHE2=$TEST_APACHE2" \ | ||
-e "TEST_STANDALONE=$TEST_STANDALONE" \ | ||
-e "TEST_SOURCE_PACKAGING=$TEST_SOURCE_PACKAGING" \ | ||
-e "TEST_DEBIAN_PACKAGING=$TEST_DEBIAN_PACKAGING" \ | ||
-e "TEST_RPM_PACKAGING=$TEST_RPM_PACKAGING" \ | ||
-e "TEST_RPM_BUILDING=$TEST_RPM_BUILDING" \ | ||
phusion/apachai-hopachai-sandbox \ | ||
python /passenger/packaging/rpm/internal/my_init --skip-runit --skip-startup-files --quiet -- \ | ||
/passenger/dev/ci/inituidgid \ | ||
/sbin/setuser appa \ | ||
/bin/bash -lc "cd /passenger && exec ./dev/ci/run_travis.sh" |
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,59 @@ | ||
#!/bin/bash | ||
# This script is run by run_travis.sh, to execute RPM packaging tests in the CI environment. | ||
|
||
set -e | ||
|
||
function run() | ||
{ | ||
echo "$ $@" | ||
"$@" | ||
} | ||
|
||
function retry_run() | ||
{ | ||
local reset='\x1B[0m' | ||
local red='\x1B[31m' | ||
local yellow='\x1B[33m' | ||
|
||
local max_tries="$1" | ||
local number=2 | ||
shift | ||
|
||
echo "$ $@" | ||
while true; do | ||
if "$@"; then | ||
return 0 | ||
elif [[ $number -le $max_tries ]]; then | ||
echo -e "${yellow}The command \"$@\" failed. Retrying, $number of $max_tries:${reset}" | ||
(( number++ )) | ||
else | ||
echo -e "${red}The command \"$@\" failed after $max_tries attempts. Giving up.${reset}" | ||
return 1 | ||
fi | ||
done | ||
} | ||
|
||
function yum_install() | ||
{ | ||
run yum install -y --skip-broken --enablerepo centosplus "$@" | ||
} | ||
|
||
export CACHING=false | ||
export DEVDEPS_DEFAULT=no | ||
|
||
cd /passenger | ||
|
||
echo '%_excludedocs 0' > /etc/rpm/macros.imgcreate | ||
sed -i 's/nodocs//' /etc/yum.conf | ||
|
||
run yum_install /packages/*.x86_64.rpm /packages/*.noarch.rpm | ||
retry_run 3 rake test:install_deps BASE_DEPS=yes | ||
chown -R app: /var/log/nginx /var/lib/nginx | ||
|
||
run rake test:integration:native_packaging | ||
run /system/internal/setuser app \ | ||
env PASSENGER_LOCATION_CONFIGURATION_FILE=/usr/lib/ruby/site_ruby/1.8/phusion_passenger/locations.ini \ | ||
scl enable python27 nodejs010 'rake test:integration:apache2' | ||
run /system/internal/setuser app \ | ||
env PASSENGER_LOCATION_CONFIGURATION_FILE=/usr/lib/ruby/site_ruby/1.8/phusion_passenger/locations.ini \ | ||
scl enable python27 nodejs010 'rake test:integration:nginx' |
Oops, something went wrong.