Skip to content
This repository was archived by the owner on Apr 21, 2023. It is now read-only.

Commit 247a821

Browse files
authored
install: add support for building psol from source and setting up for development (#1313)
* adds support for `--psol-from-source` so you don't need binary modules, and `--devel` so you can run our tests without going and getting all our dependencies * adds submodules for testing: mod_pagespeed, ngx_cache_purge etc * adds support for running as: ``` git clone [email protected]:pagespeed/ngx_pagespeed.git cd ngx_pagespeed/ git checkout <branch> scripts/build_ngx_pagespeed.sh [options] ``` * depends on the scripts @hillsp is working on so that we can just check out mod_pagespeed and ask it to build and rebuild itself * adds colors to output to make it easier to read
1 parent f7502b1 commit 247a821

12 files changed

+408
-151
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ test/tmp
22
psol/
33
psol-*.tar.gz
44
*.*.*.*.tar.gz
5+
nginx

.gitmodules

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[submodule "testing-dependencies/mod_pagespeed"]
2+
path = testing-dependencies/mod_pagespeed
3+
url = https://github.com/pagespeed/mod_pagespeed.git
4+
[submodule "testing-dependencies/ngx_cache_purge"]
5+
path = testing-dependencies/ngx_cache_purge
6+
url = https://github.com/FRiCKLE/ngx_cache_purge.git
7+
[submodule "testing-dependencies/nginx"]
8+
path = testing-dependencies/nginx
9+
url = https://github.com/nginx/nginx.git
10+
[submodule "testing-dependencies/set-misc-nginx-module"]
11+
path = testing-dependencies/set-misc-nginx-module
12+
url = https://github.com/openresty/set-misc-nginx-module
13+
[submodule "testing-dependencies/ngx_devel_kit"]
14+
path = testing-dependencies/ngx_devel_kit
15+
url = https://github.com/simpl/ngx_devel_kit
16+
[submodule "testing-dependencies/headers-more-nginx-module"]
17+
path = testing-dependencies/headers-more-nginx-module
18+
url = https://github.com/openresty/headers-more-nginx-module

.travis.yml

+20-41
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,29 @@
11
language: c++
2+
env:
3+
global:
4+
- MAKEFLAGS=-j3
5+
# By default travis loads submodules serially, but we can load them in parallel
6+
# if we install an updated git and use --jobs. Some timing numbers:
7+
# serial: 257s
8+
# jobs=4: 182s (29s to install new git, 153s to run the downloads)
9+
# jobs=8: 179s (29s to install new git, 150s to run the downloads)
10+
# We can't use --depth=1, though, because github doesn't have
11+
# allowReachableSHA1InWant set.
12+
git:
13+
submodules: false
14+
before_install:
15+
- sudo add-apt-repository --yes ppa:git-core/ppa
16+
- sudo apt-get update
17+
- sudo apt-get install git
18+
- git submodule update --init --recursive --jobs=8
219
install:
3-
- mv $TRAVIS_BUILD_DIR ~/ngxpagespeed
4-
- sudo apt-get install build-essential zlib1g-dev libpcre3 libpcre3-dev unzip g++ python gperf make devscripts fakeroot git curl netcat-traditional gcc-mozilla clang-3.4 2>&1 > /dev/null
5-
- export PATH=/usr/lib/gcc-mozilla/bin:$PATH
6-
- sudo ln -sf /usr/lib/gcc-mozilla/lib/libstdc++.so.6 /usr/lib/x86_64-linux-gnu/libstdc++.so.6
7-
# - sudo sh -c 'echo "image/webp webp" >> /etc/mime.types'
8-
# - mkdir -p ~/bin
9-
# - cd ~/bin
10-
# - git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
11-
- mkdir ~/mod_pagespeed
12-
- cd ~/mod_pagespeed
13-
- git clone --recursive https://github.com/pagespeed/mod_pagespeed.git src
14-
- cd src
15-
- python build/gyp_chromium --depth=.
16-
- cd ~/mod_pagespeed/src/pagespeed/automatic
17-
- make BUILDTYPE=Release -C ../../pagespeed/automatic all
18-
- cd ~
19-
- git clone https://github.com/FRiCKLE/ngx_cache_purge.git
20-
- NGX_CACHE_PURGE=$PWD/ngx_cache_purge
21-
- wget https://openresty.org/download/ngx_openresty-1.9.7.2.tar.gz
22-
- tar xzf ngx_openresty-*.tar.gz
23-
- cd ngx_openresty-*/
24-
- ./configure --with-luajit
25-
- make
26-
- NGX_DEVEL_KIT=$(echo $HOME/ngx_openresty-*/build/ngx_devel_kit-*/)
27-
- SET_MISC_MODULE=$(echo $HOME/ngx_openresty-*/build/set-misc-nginx-module-*/)
28-
- HEADERS_MORE_MODULE=$(echo $HOME/ngx_openresty-*/build/headers-more-nginx-module-*/)
29-
- cd ~
30-
- wget https://github.com/nginx/nginx/archive/branches/default.zip
31-
- unzip default.zip
32-
- cd nginx-branches-default
33-
- MOD_PAGESPEED_DIR="$HOME/mod_pagespeed/src" ./auto/configure --add-module=$HOME/ngxpagespeed --add-module="$NGX_CACHE_PURGE" --add-module="$NGX_DEVEL_KIT" --add-module="$SET_MISC_MODULE" --add-module="$HEADERS_MORE_MODULE" --with-ipv6
34-
- make
35-
- sudo make install
20+
scripts/build_ngx_pagespeed.sh --devel --assume-yes
3621
script:
37-
- echo "build successful"
38-
- echo "cd ~/ngxpagespeed"
39-
- echo "sudo ./test/run_tests.sh $HOME/mod_pagespeed $HOME/nginx-branches-default/objs/nginx"
22+
test/run_tests.sh $PWD/testing-dependencies/mod_pagespeed/ \
23+
$PWD/nginx/sbin/nginx
4024
sudo: required
4125
compiler:
4226
- gcc
4327
notifications:
4428
email:
45-
4629
47-
48-
49-
50-

0 commit comments

Comments
 (0)