passenger 4.0.48 → 4.0.49

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of passenger might be problematic. Click here for more details.

Files changed (218) hide show
  1. checksums.yaml +8 -8
  2. checksums.yaml.gz.asc +7 -7
  3. data.tar.gz.asc +7 -7
  4. data/.editorconfig +36 -2
  5. data/.travis.yml +1 -1
  6. data/CHANGELOG +16 -0
  7. data/Rakefile +0 -1
  8. data/build/apache2.rb +4 -4
  9. data/build/common_library.rb +18 -18
  10. data/build/cplusplus_support.rb +2 -2
  11. data/build/documentation.rb +1 -1
  12. data/build/integration_tests.rb +12 -4
  13. data/build/misc.rb +12 -7
  14. data/build/packaging.rb +14 -14
  15. data/build/preprocessor.rb +10 -10
  16. data/build/rake_extensions.rb +11 -11
  17. data/build/ruby_extension.rb +2 -2
  18. data/dev/ci/inituidgid +24 -0
  19. data/dev/ci/run_jenkins.sh +57 -0
  20. data/dev/ci/run_rpm_tests.sh +77 -0
  21. data/dev/{run_travis.sh → ci/run_travis.sh} +60 -4
  22. data/doc/Users guide Nginx.txt +2 -2
  23. data/doc/users_guide_snippets/environment_variables.txt +0 -2
  24. data/doc/users_guide_snippets/tips.txt +20 -1
  25. data/ext/apache2/Bucket.cpp +18 -18
  26. data/ext/apache2/Bucket.h +4 -4
  27. data/ext/apache2/Configuration.cpp +7 -7
  28. data/ext/apache2/Configuration.hpp +43 -43
  29. data/ext/apache2/DirectoryMapper.h +5 -5
  30. data/ext/apache2/Hooks.cpp +142 -142
  31. data/ext/apache2/MergeDirConfig.cpp +40 -40
  32. data/ext/common/Account.h +17 -17
  33. data/ext/common/AccountsDatabase.h +9 -9
  34. data/ext/common/AgentsStarter.cpp +2 -2
  35. data/ext/common/AgentsStarter.h +40 -40
  36. data/ext/common/ApplicationPool2/Common.h +10 -6
  37. data/ext/common/ApplicationPool2/ComponentInfo.h +2 -2
  38. data/ext/common/ApplicationPool2/DirectSpawner.h +17 -17
  39. data/ext/common/ApplicationPool2/DummySpawner.h +5 -5
  40. data/ext/common/ApplicationPool2/Group.h +54 -38
  41. data/ext/common/ApplicationPool2/Implementation.cpp +76 -49
  42. data/ext/common/ApplicationPool2/Options.h +98 -91
  43. data/ext/common/ApplicationPool2/Pool.h +70 -69
  44. data/ext/common/ApplicationPool2/Process.h +21 -21
  45. data/ext/common/ApplicationPool2/Session.h +11 -11
  46. data/ext/common/ApplicationPool2/SmartSpawner.h +60 -60
  47. data/ext/common/ApplicationPool2/Socket.h +19 -19
  48. data/ext/common/ApplicationPool2/Spawner.h +64 -72
  49. data/ext/common/ApplicationPool2/SpawnerFactory.h +4 -4
  50. data/ext/common/ApplicationPool2/SuperGroup.h +41 -41
  51. data/ext/common/BackgroundEventLoop.cpp +1 -1
  52. data/ext/common/BackgroundEventLoop.h +2 -2
  53. data/ext/common/Constants.h +1 -1
  54. data/ext/common/EventedBufferedInput.h +5 -5
  55. data/ext/common/EventedClient.h +51 -51
  56. data/ext/common/EventedMessageServer.h +39 -39
  57. data/ext/common/EventedServer.h +32 -32
  58. data/ext/common/Exceptions.h +23 -23
  59. data/ext/common/FileDescriptor.h +18 -18
  60. data/ext/common/Logging.cpp +1 -1
  61. data/ext/common/MessageClient.h +27 -27
  62. data/ext/common/MessageReadersWriters.h +79 -79
  63. data/ext/common/MessageServer.h +59 -59
  64. data/ext/common/RandomGenerator.h +12 -12
  65. data/ext/common/ResourceLocator.h +8 -8
  66. data/ext/common/SafeLibev.h +54 -25
  67. data/ext/common/ServerInstanceDir.h +31 -31
  68. data/ext/common/StaticString.h +50 -48
  69. data/ext/common/Utils.cpp +73 -78
  70. data/ext/common/Utils.h +6 -6
  71. data/ext/common/Utils/Base64.cpp +3 -3
  72. data/ext/common/Utils/Base64.h +7 -7
  73. data/ext/common/Utils/BlockingQueue.h +9 -9
  74. data/ext/common/Utils/BufferedIO.h +17 -17
  75. data/ext/common/Utils/CachedFileStat.hpp +16 -16
  76. data/ext/common/Utils/Dechunker.h +25 -25
  77. data/ext/common/Utils/FileChangeChecker.h +10 -10
  78. data/ext/common/Utils/MemZeroGuard.h +5 -5
  79. data/ext/common/Utils/MemoryBarrier.h +1 -1
  80. data/ext/common/Utils/MessageIO.h +61 -61
  81. data/ext/common/Utils/ProcessMetricsCollector.h +40 -40
  82. data/ext/common/Utils/ScopeGuard.h +7 -7
  83. data/ext/common/Utils/SpeedMeter.h +1 -1
  84. data/ext/common/Utils/StrIntUtils.cpp +13 -13
  85. data/ext/common/Utils/StrIntUtils.h +3 -3
  86. data/ext/common/Utils/StringScanning.h +5 -5
  87. data/ext/common/Utils/SystemMetricsCollector.h +2 -2
  88. data/ext/common/Utils/SystemTime.h +10 -10
  89. data/ext/common/Utils/Template.h +2 -2
  90. data/ext/common/Utils/Timer.h +6 -6
  91. data/ext/common/Utils/VariantMap.h +29 -29
  92. data/ext/common/agents/Base.cpp +19 -19
  93. data/ext/common/agents/HelperAgent/AgentOptions.h +1 -1
  94. data/ext/common/agents/HelperAgent/FileBackedPipe.h +6 -6
  95. data/ext/common/agents/HelperAgent/Main.cpp +44 -43
  96. data/ext/common/agents/HelperAgent/RequestHandler.cpp +4 -4
  97. data/ext/common/agents/HelperAgent/RequestHandler.h +29 -28
  98. data/ext/common/agents/HelperAgent/ScgiRequestParser.h +56 -50
  99. data/ext/common/agents/LoggingAgent/AdminController.h +8 -8
  100. data/ext/common/agents/LoggingAgent/DataStoreId.h +17 -17
  101. data/ext/common/agents/LoggingAgent/FilterSupport.h +167 -167
  102. data/ext/common/agents/LoggingAgent/LoggingServer.h +122 -122
  103. data/ext/common/agents/LoggingAgent/Main.cpp +7 -7
  104. data/ext/common/agents/LoggingAgent/RemoteSender.h +54 -54
  105. data/ext/common/agents/SpawnPreparer.cpp +4 -4
  106. data/ext/common/agents/TempDirToucher.c +2 -2
  107. data/ext/common/agents/Watchdog/AgentWatcher.cpp +47 -47
  108. data/ext/common/agents/Watchdog/HelperAgentWatcher.cpp +7 -7
  109. data/ext/common/agents/Watchdog/LoggingAgentWatcher.cpp +7 -7
  110. data/ext/common/agents/Watchdog/Main.cpp +22 -22
  111. data/ext/common/agents/Watchdog/ServerInstanceDirToucher.cpp +9 -9
  112. data/ext/libeio/eio.c +1 -1
  113. data/ext/nginx/Configuration.c +30 -30
  114. data/ext/nginx/Configuration.h +1 -1
  115. data/ext/nginx/ContentHandler.c +54 -54
  116. data/ext/nginx/ContentHandler.h +3 -3
  117. data/ext/nginx/StaticContentHandler.c +2 -2
  118. data/ext/nginx/ngx_http_passenger_module.c +21 -21
  119. data/ext/oxt/detail/backtrace_enabled.hpp +1 -1
  120. data/ext/oxt/detail/context.hpp +1 -1
  121. data/ext/oxt/detail/spin_lock_darwin.hpp +4 -4
  122. data/ext/oxt/detail/spin_lock_gcc_x86.hpp +3 -3
  123. data/ext/oxt/detail/spin_lock_pthreads.hpp +4 -4
  124. data/ext/oxt/detail/tracable_exception_disabled.hpp +1 -1
  125. data/ext/oxt/dynamic_thread_group.hpp +18 -18
  126. data/ext/oxt/implementation.cpp +9 -8
  127. data/ext/oxt/macros.hpp +2 -2
  128. data/ext/oxt/system_calls.cpp +11 -11
  129. data/ext/oxt/system_calls.hpp +13 -13
  130. data/ext/oxt/thread.hpp +22 -14
  131. data/ext/ruby/passenger_native_support.c +55 -55
  132. data/lib/phusion_passenger.rb +24 -24
  133. data/lib/phusion_passenger/common_library.rb +2 -0
  134. data/lib/phusion_passenger/loader_shared_helpers.rb +18 -18
  135. data/lib/phusion_passenger/packaging.rb +9 -4
  136. data/lib/phusion_passenger/platform_info/apache.rb +45 -31
  137. data/lib/phusion_passenger/platform_info/compiler.rb +11 -11
  138. data/lib/phusion_passenger/rack/thread_handler_extension.rb +1 -1
  139. data/lib/phusion_passenger/request_handler/thread_handler.rb +8 -8
  140. data/lib/phusion_passenger/standalone/app_finder.rb +16 -16
  141. data/lib/phusion_passenger/standalone/command.rb +22 -22
  142. data/packaging/rpm/LICENSE.txt +19 -0
  143. data/packaging/rpm/Makefile +13 -0
  144. data/packaging/rpm/README.md +41 -0
  145. data/packaging/rpm/Vagrantfile +38 -0
  146. data/{rpm/Vagrantfile → packaging/rpm/Vagrantfile.centos} +0 -0
  147. data/packaging/rpm/build +170 -0
  148. data/packaging/rpm/create_project +41 -0
  149. data/packaging/rpm/git_update +88 -0
  150. data/packaging/rpm/image/Dockerfile +37 -0
  151. data/packaging/rpm/image/Gemfile +3 -0
  152. data/packaging/rpm/image/Gemfile.lock +12 -0
  153. data/packaging/rpm/image/RPM-GPG-KEY-amazon-ga +19 -0
  154. data/packaging/rpm/image/amazon2014-i386.cfg +96 -0
  155. data/packaging/rpm/image/amazon2014-x86_64.cfg +96 -0
  156. data/packaging/rpm/image/site-defaults.cfg +168 -0
  157. data/packaging/rpm/internal/build_tasks.rb +238 -0
  158. data/packaging/rpm/internal/dummygpg +11 -0
  159. data/packaging/rpm/internal/exec_build +42 -0
  160. data/packaging/rpm/internal/get_distro_arch +14 -0
  161. data/packaging/rpm/internal/get_distro_id +10 -0
  162. data/packaging/rpm/internal/git_update +27 -0
  163. data/packaging/rpm/internal/inituidgid +17 -0
  164. data/packaging/rpm/internal/my_init +344 -0
  165. data/packaging/rpm/internal/python27 +3 -0
  166. data/packaging/rpm/internal/repo_update +46 -0
  167. data/packaging/rpm/internal/setuser +26 -0
  168. data/packaging/rpm/internal/tracking_helper +40 -0
  169. data/packaging/rpm/jenkins_release +99 -0
  170. data/packaging/rpm/lib/build_tasks_support.rb +402 -0
  171. data/packaging/rpm/lib/preprocessor.rb +341 -0
  172. data/packaging/rpm/nginx_spec/404.html +119 -0
  173. data/packaging/rpm/nginx_spec/50x.html +119 -0
  174. data/packaging/rpm/nginx_spec/index.html +116 -0
  175. data/packaging/rpm/nginx_spec/nginx-auto-cc-gcc.patch +13 -0
  176. data/packaging/rpm/nginx_spec/nginx-logo.png +0 -0
  177. data/packaging/rpm/nginx_spec/nginx-upgrade +13 -0
  178. data/packaging/rpm/nginx_spec/nginx-upgrade.8 +151 -0
  179. data/packaging/rpm/nginx_spec/nginx.conf +131 -0
  180. data/packaging/rpm/nginx_spec/nginx.init +144 -0
  181. data/packaging/rpm/nginx_spec/nginx.logrotate +13 -0
  182. data/packaging/rpm/nginx_spec/nginx.service +15 -0
  183. data/packaging/rpm/nginx_spec/nginx.spec.template +559 -0
  184. data/packaging/rpm/nginx_spec/nginx.sysconfig +4 -0
  185. data/packaging/rpm/nginx_spec/passenger.conf +9 -0
  186. data/packaging/rpm/nginx_spec/poweredby.png +0 -0
  187. data/{rpm → packaging/rpm/passenger_spec}/apache-passenger.conf.in +0 -0
  188. data/{rpm → packaging/rpm/passenger_spec}/config.json +0 -0
  189. data/{rpm → packaging/rpm/passenger_spec}/passenger.logrotate +0 -0
  190. data/{rpm → packaging/rpm/passenger_spec}/passenger.spec.template +58 -31
  191. data/{rpm → packaging/rpm/passenger_spec}/passenger_dynamic_thread_group.patch +0 -0
  192. data/{rpm → packaging/rpm/passenger_spec}/passenger_tests_default_config_example.patch +0 -0
  193. data/{rpm → packaging/rpm/passenger_spec}/rubygem-passenger-4.0.18-GLIBC_HAVE_LONG_LONG.patch +0 -0
  194. data/{rpm → packaging/rpm/passenger_spec}/rubygem-passenger-4.0.18-gcc47-include-sys_types.patch +0 -0
  195. data/packaging/rpm/repo_update +114 -0
  196. data/packaging/rpm/setup-system +60 -0
  197. data/packaging/rpm/shell +10 -0
  198. data/resources/templates/standalone/config.erb +3 -1
  199. data/test/config.json.rpm-automation +1 -1
  200. data/test/cxx/ApplicationPool2/DirectSpawnerTest.cpp +11 -11
  201. data/test/cxx/ApplicationPool2/OptionsTest.cpp +5 -5
  202. data/test/cxx/ApplicationPool2/PoolTest.cpp +129 -89
  203. data/test/cxx/ApplicationPool2/ProcessTest.cpp +15 -15
  204. data/test/cxx/ApplicationPool2/SmartSpawnerTest.cpp +22 -22
  205. data/test/cxx/ApplicationPool2/SpawnerTestCases.cpp +11 -11
  206. data/test/cxx/ScgiRequestParserTest.cpp +75 -61
  207. data/test/cxx/UtilsTest.cpp +86 -85
  208. data/test/gdbinit.example +3 -0
  209. data/test/integration_tests/nginx_tests.rb +3 -3
  210. data/test/integration_tests/source_packaging_test.rb +3 -1
  211. data/test/stub/nginx/nginx.conf.erb +8 -1
  212. data/test/support/nginx_controller.rb +7 -7
  213. metadata +62 -17
  214. metadata.gz.asc +7 -7
  215. data/build/rpm.rb +0 -128
  216. data/dev/rpmtool +0 -21
  217. data/dev/test_rpm_packaging.sh +0 -28
  218. data/rpm/get_distro_id.py +0 -4
@@ -0,0 +1,13 @@
1
+ NAME = phusion/passenger_rpm_automation
2
+
3
+ .PHONY: all image publish_image
4
+
5
+ all:
6
+ @echo "*** Please explicitly specify a target."
7
+ @false
8
+
9
+ image:
10
+ docker build -t $(NAME) -rm image
11
+
12
+ publish_image:
13
+ docker push $(NAME)
@@ -0,0 +1,41 @@
1
+ # Phusion Passenger RPM packaging automation
2
+
3
+ This repository contains tools for automating the building of RPM packages for Phusion Passenger. These tools require Ubuntu 12.04 x86_64, Docker and Jenkins. The main build environment is a CentOS 6 Docker container.
4
+
5
+ ## Installation
6
+
7
+ First, install Docker: http://www.docker.io/
8
+
9
+ Then install `passenger_rpm_automation`:
10
+
11
+ git clone https://github.com/phusion/passenger_rpm_automation.git /tmp/passenger_rpm_automation
12
+ /tmp/passenger_rpm_automation/setup-system
13
+ sudo mv /tmp/passenger_rpm_automation /srv/passenger_rpm_automation
14
+ sudo chown -R psg_rpm_automation: /srv/passenger_rpm_automation
15
+
16
+ Next, create a project for Phusion Passenger:
17
+
18
+ cd /srv/passenger_rpm_automation
19
+ sudo ./create_project passenger https://github.com/phusion/passenger.git
20
+
21
+ ## Usage
22
+
23
+ `passenger_rpm_automation` usage commands are supposed to be run as the `psg_rpm_automation` user, and from the `/srv/passenger_rpm_automation` directory.
24
+
25
+ ### Logging into the build environment
26
+
27
+ Run this to login to the build environment container. This allows you to inspect things. Any changes you make will not be saved.
28
+
29
+ ./shell
30
+
31
+ Any arguments you pass are passed to `docker run`.
32
+
33
+ ### Building RPMs
34
+
35
+ To build RPMs for all supported distributions and all supported architectures, run:
36
+
37
+ ./build -p PROJECT_DIR
38
+
39
+ The RPMs will be saved to `PROJECT_DIR/build`.
40
+
41
+ You can also build RPMs for just a single distribution/architecture. Use the `-d` and `-a` parameters to do that. Pass `-h` for help.
@@ -0,0 +1,38 @@
1
+ # -*- mode: ruby -*-
2
+ # vi: set ft=ruby :
3
+ ROOT = File.dirname(File.expand_path(__FILE__))
4
+
5
+ # Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
6
+ VAGRANTFILE_API_VERSION = "2"
7
+
8
+ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
9
+ config.vm.box = "phusion-open-ubuntu-12.04-amd64"
10
+ config.vm.box_url = "https://oss-binaries.phusionpassenger.com/vagrant/boxes/ubuntu-12.04.3-amd64-vbox.box"
11
+ config.ssh.forward_agent = true
12
+
13
+ passenger_path = File.absolute_path('../passenger', ROOT)
14
+ if File.directory?(passenger_path)
15
+ config.vm.synced_folder passenger_path, '/passenger'
16
+ end
17
+
18
+ passenger_enterprise_path = File.absolute_path('../commercial_passenger', ROOT)
19
+ if File.directory?(passenger_enterprise_path)
20
+ config.vm.synced_folder passenger_enterprise_path, '/passenger-enterprise'
21
+ end
22
+
23
+ config.vm.provider :vmware_fusion do |f, override|
24
+ override.vm.box_url = "https://oss-binaries.phusionpassenger.com/vagrant/boxes/ubuntu-12.04.3-amd64-vmwarefusion.box"
25
+ f.vmx["displayName"] = "passenger_rpm_automation"
26
+ end
27
+
28
+ # Add lxc-docker package
29
+ pkg_cmd = "if [[ -e /usr/bin/docker ]]; then exit; fi; " \
30
+ "wget -q -O - https://get.docker.io/gpg | apt-key add -;" \
31
+ "echo deb http://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list;" \
32
+ "apt-get update -qq; apt-get install -q -y --force-yes lxc-docker git; "
33
+ # Add vagrant user to the docker group
34
+ pkg_cmd << "usermod -a -G docker vagrant; "
35
+ pkg_cmd << "/vagrant/setup-system; "
36
+ pkg_cmd << "git clone https://github.com/phusion/phusion-server-tools.git /tools"
37
+ config.vm.provision :shell, :inline => pkg_cmd
38
+ end
@@ -0,0 +1,170 @@
1
+ #!/bin/bash
2
+ set -e
3
+
4
+ SELFROOT=`dirname "$0"`
5
+ SELFROOT=`cd "$SELFROOT" && pwd`
6
+ SELFROOT_ON_DOCKER_HOST="$SELFROOT"
7
+ TEMPDIR=
8
+
9
+ PASSENGER_DIR=
10
+ OUTPUT_DIR=
11
+ DISTROS='el6'
12
+ ARCHS='i386,x86_64'
13
+ LOCAL_BUILD=false
14
+ CONCURRENCY=1
15
+ TASK=rpm:all
16
+ CLEAN=false
17
+ CACHE_DIR=
18
+ VERBOSE=false
19
+
20
+ function usage()
21
+ {
22
+ echo "Usage: ./build [OPTIONS]"
23
+ echo "Build RPMs for multiple distributions and architectures."
24
+ echo
25
+ echo "Required options:"
26
+ echo " -p PATH Path to a project"
27
+ echo
28
+ echo " -P PATH Path to Phusion Passenger source directory"
29
+ echo " -o PATH Directory to save build output to"
30
+ echo " -c PATH Directory to store cache files to"
31
+ echo
32
+ echo "Optional options:"
33
+ echo " -d DISTROS Distributions to build for (default: $DISTROS)"
34
+ echo " -a ARCHS Architectures to build for (default: $ARCHS)"
35
+ echo " -L Build for local distribution and architecture"
36
+ echo " -j CONCURRENCY Build concurrency (default: $CONCURRENCY)"
37
+ echo
38
+ echo " -t TASK Build using specific Rake task (default: $TASK)"
39
+ echo " -T List all Rake tasks (note: list depends on other options)"
40
+ echo
41
+ echo " -l Clean output directory before building RPMs"
42
+ echo " -k VERSION Pretend as if the Passenger version number is the specified one"
43
+ echo " -S Directory to passenger_rpm_automation on the Docker host"
44
+ echo " -V Verbose output"
45
+ }
46
+
47
+ function parse_options()
48
+ {
49
+ local OPTIND=1
50
+ local opt
51
+ while getopts "p:P:o:d:a:Lj:t:Tlk:c:S:Vh" opt; do
52
+ case "$opt" in
53
+ p)
54
+ PASSENGER_DIR="$OPTARG/git"
55
+ CACHE_DIR="$OPTARG/cache"
56
+ OUTPUT_DIR="$OPTARG/build"
57
+ ;;
58
+ P)
59
+ PASSENGER_DIR="$OPTARG"
60
+ ;;
61
+ o)
62
+ OUTPUT_DIR="$OPTARG"
63
+ ;;
64
+ d)
65
+ DISTROS="$OPTARG"
66
+ ;;
67
+ a)
68
+ ARCHS="$OPTARG"
69
+ ;;
70
+ L)
71
+ LOCAL_BUILD=true
72
+ ;;
73
+ j)
74
+ CONCURRENCY="$OPTARG"
75
+ ;;
76
+ t)
77
+ TASK="$OPTARG"
78
+ ;;
79
+ T)
80
+ TASK="-T"
81
+ ;;
82
+ l)
83
+ CLEAN=true
84
+ ;;
85
+ k)
86
+ FORCE_PASSENGER_VERSION="$OPTARG"
87
+ ;;
88
+ c)
89
+ CACHE_DIR="$OPTARG"
90
+ ;;
91
+ S)
92
+ SELFROOT_ON_DOCKER_HOST="$OPTARG"
93
+ ;;
94
+ V)
95
+ VERBOSE=true
96
+ ;;
97
+ h)
98
+ usage
99
+ exit
100
+ ;;
101
+ *)
102
+ return 1
103
+ ;;
104
+ esac
105
+ done
106
+
107
+ if [[ "$PASSENGER_DIR" = "" ]]; then
108
+ echo "Please specify a project using -p, or a path to the Phusion Passenger source directory using -P."
109
+ exit 1
110
+ fi
111
+ if [[ "$TASK" != "-T" ]]; then
112
+ if [[ "$OUTPUT_DIR" = "" ]]; then
113
+ echo "Please specify a project using -p, or an output directory using -o."
114
+ exit 1
115
+ fi
116
+ if [[ "$CACHE_DIR" = "" ]]; then
117
+ echo "Please specify a project using -p, or a cache directory using -c."
118
+ exit 1
119
+ fi
120
+ fi
121
+ }
122
+
123
+ function verbose_run()
124
+ {
125
+ if $VERBOSE; then
126
+ echo "$ $@"
127
+ fi
128
+ "$@"
129
+ }
130
+
131
+ function cleanup()
132
+ {
133
+ local pids=`jobs -p`
134
+ set +e
135
+ if [[ "$pids" != "" ]]; then
136
+ kill $pids >/dev/null 2>/dev/null
137
+ fi
138
+ }
139
+
140
+ trap cleanup EXIT
141
+ parse_options "$@"
142
+ APP_UID=`id -u`
143
+ APP_GID=`id -g`
144
+
145
+ if $LOCAL_BUILD; then
146
+ DISTROS=`"$SELFROOT/internal/get_distro_id"`
147
+ ARCHS=`"$SELFROOT/internal/get_distro_arch"`
148
+ echo "Building for local system: $DISTROS-$ARCHS"
149
+ fi
150
+
151
+ if [[ "$SELFROOT_ON_DOCKER_HOST" = "$SELFROOT" ]]; then
152
+ verbose_run mkdir -p "$OUTPUT_DIR"
153
+ fi
154
+
155
+ verbose_run exec docker run --rm --privileged \
156
+ -v "$SELFROOT_ON_DOCKER_HOST:/system:ro" \
157
+ -v "$PASSENGER_DIR:/passenger" \
158
+ -v "$OUTPUT_DIR:/output" \
159
+ -v "$CACHE_DIR:/cache" \
160
+ -e "APP_UID=$APP_UID" \
161
+ -e "APP_GID=$APP_GID" \
162
+ -e "CONCURRENCY=$CONCURRENCY" \
163
+ -e "DISTROS=$DISTROS" \
164
+ -e "ARCHS=$ARCHS" \
165
+ -e "TASK=$TASK" \
166
+ -e "CLEAN=$CLEAN" \
167
+ -e "FORCE_PASSENGER_VERSION=$FORCE_PASSENGER_VERSION" \
168
+ -e "VERBOSE=$VERBOSE" \
169
+ phusion/passenger_rpm_automation \
170
+ /system/internal/exec_build
@@ -0,0 +1,41 @@
1
+ #!/bin/bash
2
+ PROJECT_DIR="$1"
3
+ GIT_URL="$2"
4
+
5
+ if [[ "$PROJECT_DIR" = "" || "$GIT_URL" = "" ]]; then
6
+ echo "Usage: ./create_project <DIR> <GIT_URL>"
7
+ exit 1
8
+ fi
9
+
10
+ set -e
11
+
12
+ project_dir_parent=`dirname "$PROJECT_DIR"`
13
+ fstype=`df -T "$project_dir_parent" | tail -n 1 | awk '{ print $2 }'`
14
+ if [[ "$fstype" == vmhgfs || "$fstype" == vboxfs ]]; then
15
+ echo "You cannot put the project dir in a VMWare or VirtualBox shared folder."
16
+ exit 1
17
+ fi
18
+
19
+ if [[ `id -u` != 0 ]]; then
20
+ echo "You must run this command with root privileges."
21
+ exit 1
22
+ fi
23
+
24
+ set -x
25
+
26
+ mkdir "$PROJECT_DIR"
27
+ mkdir "$PROJECT_DIR/git"
28
+ mkdir "$PROJECT_DIR/cache"
29
+ mkdir "$PROJECT_DIR/cache/root"
30
+ mkdir "$PROJECT_DIR/cache/mock_lib"
31
+ mkdir "$PROJECT_DIR/cache/mock_cache"
32
+ mkdir "$PROJECT_DIR/repo"
33
+ mkdir "$PROJECT_DIR/build"
34
+
35
+ echo "$GIT_URL" > "$PROJECT_DIR/git_url"
36
+ (cd "$PROJECT_DIR" && ln -s build/log/state.log state.log)
37
+
38
+ chown -R jenkins: "$PROJECT_DIR"
39
+ chmod u=rwx,g=x,o= "$PROJECT_DIR" "$PROJECT_DIR/cache"
40
+ setfacl -m u:www-data:rx "$PROJECT_DIR" "$PROJECT_DIR/repo"
41
+ setfacl -d -m u:www-data:rx "$PROJECT_DIR/repo"
@@ -0,0 +1,88 @@
1
+ #!/bin/bash
2
+ set -e
3
+
4
+ SELFROOT=`dirname "$0"`
5
+ SELFROOT=`cd "$SELFROOT" && pwd`
6
+
7
+ GIT_DIR=
8
+ GIT_URL=
9
+ GIT_REF=origin/master
10
+
11
+ function usage()
12
+ {
13
+ echo "Usage: ./git_update [OPTIONS]"
14
+ echo "Update git sources for a project."
15
+ echo
16
+ echo "Required options:"
17
+ echo " -p PATH Path to a project"
18
+ echo
19
+ echo " -P PATH Path to a Git repo directory"
20
+ echo " -u URL Git URL"
21
+ echo
22
+ echo "Optional options:"
23
+ echo " -r REF Use this specific Git commit or tag"
24
+ }
25
+
26
+ function parse_options()
27
+ {
28
+ local OPTIND=1
29
+ local opt
30
+ while getopts "p:P:u:r:h" opt; do
31
+ case "$opt" in
32
+ p)
33
+ GIT_DIR="$OPTARG/git"
34
+ GIT_URL=`cat "$OPTARG/git_url"`
35
+ ;;
36
+ P)
37
+ GIT_DIR="$OPTARG"
38
+ ;;
39
+ u)
40
+ GIT_URL="$OPTARG"
41
+ ;;
42
+ r)
43
+ GIT_REF="$OPTARG"
44
+ ;;
45
+ h)
46
+ usage
47
+ exit
48
+ ;;
49
+ *)
50
+ return 1
51
+ ;;
52
+ esac
53
+ done
54
+
55
+ if [[ "$GIT_DIR" = "" ]]; then
56
+ echo "Please specify a project using -p, or a Git repo using -P."
57
+ exit 1
58
+ fi
59
+ if [[ "$GIT_URL" = "" ]]; then
60
+ echo "Please specify a project using -p, or Git URL using -u."
61
+ exit 1
62
+ fi
63
+ }
64
+
65
+ function cleanup()
66
+ {
67
+ local pids=`jobs -p`
68
+ set +e
69
+ if [[ "$pids" != "" ]]; then
70
+ kill $pids >/dev/null 2>/dev/null
71
+ fi
72
+ }
73
+
74
+ trap cleanup EXIT
75
+ parse_options "$@"
76
+ APP_UID=`id -u`
77
+ APP_GID=`id -g`
78
+
79
+ exec docker run --rm \
80
+ -v "$SELFROOT:/system:ro" \
81
+ -v "$GIT_DIR:/git" \
82
+ -e "APP_UID=$APP_UID" \
83
+ -e "APP_GID=$APP_GID" \
84
+ -e "GIT_URL=$GIT_URL" \
85
+ -e "GIT_REF=$GIT_REF" \
86
+ phusion/passenger_rpm_automation \
87
+ /system/internal/my_init --skip-runit --skip-startup-files --quiet -- \
88
+ /system/internal/git_update
@@ -0,0 +1,37 @@
1
+ FROM centos:centos6
2
+ MAINTAINER Phusion <info@phusion.nl>
3
+
4
+ RUN rpm -Uvh http://mirror.overthewire.com.au/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm && \
5
+ yum update -y && \
6
+ yum install -y --skip-broken --enablerepo centosplus centos-release-SCL createrepo && \
7
+ yum install -y --skip-broken --enablerepo centosplus @development-tools fedora-packager git sudo gcc gcc-c++ ccache && \
8
+ yum install -y --skip-broken --enablerepo centosplus curl-devel openssl-devel python27-python && \
9
+ yum install -y --skip-broken --enablerepo centosplus ruby ruby-devel rubygems rubygems-devel rubygem-rake && \
10
+ yum install -y --skip-broken --enablerepo centosplus httpd httpd-devel zlib-devel && \
11
+ yum install -y --skip-broken --enablerepo centosplus libxml2-devel libxslt-devel sqlite-devel && \
12
+ yum install -y --skip-broken --enablerepo centosplus libev-devel pcre-devel rubygem-rack source-highlight && \
13
+ yum install -y --skip-broken --enablerepo centosplus apr-devel apr-util-devel which GeoIP-devel && \
14
+ yum install -y --skip-broken --enablerepo centosplus gd-devel gperftools-devel perl-devel perl-ExtUtils-Embed && \
15
+ yum install -y --skip-broken --enablerepo centosplus nodejs010-nodejs nodejs010-npm && \
16
+ gem install nokogiri --no-rdoc --no-ri -v 1.5.9 && \
17
+ gem install bundler mizuho bluecloth drake --no-rdoc --no-ri && \
18
+ git clone https://github.com/phusion/phusion-server-tools.git /tools && \
19
+ groupadd --gid 2467 app && \
20
+ adduser --uid 2467 --gid 2467 --password '#' app && \
21
+ usermod -a -G mock app && \
22
+ sed -i 's/Defaults requiretty//' /etc/sudoers && \
23
+ echo "%app ALL=NOPASSWD:ALL" >> /etc/sudoers.d/app && \
24
+ chmod 440 /etc/sudoers.d/app && \
25
+ sudo -u app -H rpmdev-setuptree && \
26
+ yum clean all && \
27
+ mkdir -p /etc/container_environment /etc/workaround-docker-2267 && \
28
+ ln -s /etc/workaround-docker-2267 /cte
29
+ ADD amazon2014-i386.cfg /etc/mock/amazon2014-i386.cfg
30
+ ADD amazon2014-x86_64.cfg /etc/mock/amazon2014-x86_64.cfg
31
+ ADD RPM-GPG-KEY-amazon-ga /etc/pki/rpm-gpg/RPM-GPG-KEY-amazon-ga
32
+ ADD site-defaults.cfg /etc/mock/site-defaults.cfg
33
+ ADD Gemfile /home/app/
34
+ ADD Gemfile.lock /home/app/
35
+ RUN mkdir /bundle && \
36
+ chown app: /bundle /home/app/Gemfile* && \
37
+ sudo -u app -H bash -c 'cd /home/app && bundle install --path /bundle'
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'drake'
@@ -0,0 +1,12 @@
1
+ GEM
2
+ remote: https://rubygems.org/
3
+ specs:
4
+ comp_tree (1.1.3)
5
+ drake (0.9.2.0.3.1)
6
+ comp_tree (>= 1.1.3)
7
+
8
+ PLATFORMS
9
+ ruby
10
+
11
+ DEPENDENCIES
12
+ drake