From 0e82b9fbd769a236489c227e6e7e2b62462ba33e Mon Sep 17 00:00:00 2001 From: Wakaba Date: Tue, 3 Nov 2015 21:47:55 +0900 Subject: [PATCH] deps for server --- .gitignore | 9 ++++- .gitmodules | 35 ++++++++++++++++-- Makefile | 64 +++++++++++++++++++++++++++++++-- Procfile | 1 + app.json | 7 ++++ circle.yml | 29 +++++++++++++++ config/perl/pmb-install.txt | 18 ++++++++++ config/perl/pmbp-exclusions.txt | 20 +++++++++++ modules/charclass | 1 + modules/manakai | 1 - modules/ooutils | 1 + modules/promise | 1 + modules/promised-command | 1 + modules/twiggy-packed | 1 + modules/wanage | 1 + modules/web-encodings | 1 + modules/web-url | 1 + 17 files changed, 185 insertions(+), 7 deletions(-) create mode 100644 Procfile create mode 100644 app.json create mode 100644 circle.yml create mode 100644 config/perl/pmb-install.txt create mode 100644 config/perl/pmbp-exclusions.txt create mode 160000 modules/charclass delete mode 160000 modules/manakai create mode 160000 modules/ooutils create mode 160000 modules/promise create mode 160000 modules/promised-command create mode 160000 modules/twiggy-packed create mode 160000 modules/wanage create mode 160000 modules/web-encodings create mode 160000 modules/web-url diff --git a/.gitignore b/.gitignore index daad09e7..488abb1f 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,11 @@ .*.BAK pod2htmi.tmp pod2htmd.tmp -/html/parsing/html5lib/tmp \ No newline at end of file +/html/parsing/html5lib/tmp +/local/ +/perl +/prove +/plackup +/Makefile.setupenv +/cin +/config/perl/libs.txt diff --git a/.gitmodules b/.gitmodules index cda3c59d..7db6b08d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,32 @@ -[submodule "modules/manakai"] - path = modules/manakai - url = git://github.com/wakaba/manakai.git +[submodule "modules/wanage"] + path = modules/wanage + url = git://github.com/wakaba/wanage + track = master +[submodule "modules/charclass"] + path = modules/charclass + url = git://github.com/wakaba/perl-charclass + track = master +[submodule "modules/ooutils"] + path = modules/ooutils + url = git://github.com/wakaba/perl-ooutils + track = master +[submodule "modules/web-encodings"] + path = modules/web-encodings + url = git://github.com/manakai/perl-web-encodings + track = master +[submodule "modules/web-url"] + path = modules/web-url + url = git://github.com/manakai/perl-web-url + track = master +[submodule "modules/promised-command"] + path = modules/promised-command + url = git://github.com/wakaba/perl-promised-command + track = master +[submodule "modules/promise"] + path = modules/promise + url = git://github.com/wakaba/perl-promise + track = master +[submodule "modules/twiggy-packed"] + path = modules/twiggy-packed + url = git://github.com/wakaba/perl-twiggy-packed + track = master diff --git a/Makefile b/Makefile index c202ff05..47cdd60c 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,65 @@ - all: - cd html && $(MAKE) all + +WGET = wget +CURL = curl +GIT = git + +updatenightly: local/bin/pmbp.pl + $(CURL) -s -S -L https://gist.githubusercontent.com/wakaba/34a71d3137a52abb562d/raw/gistfile1.txt | sh + $(GIT) add modules + perl local/bin/pmbp.pl --update + $(GIT) add config + +## ------ Setup ------ + +deps: always + true # dummy for make -q +ifdef PMBP_HEROKU_BUILDPACK +else + $(MAKE) git-submodules +endif + $(MAKE) pmbp-install + +git-submodules: + $(GIT) submodule update --init + +PMBP_OPTIONS= + +local/bin/pmbp.pl: + mkdir -p local/bin + $(CURL) -s -S -L https://raw.githubusercontent.com/wakaba/perl-setupenv/master/bin/pmbp.pl > $@ +pmbp-upgrade: local/bin/pmbp.pl + perl local/bin/pmbp.pl $(PMBP_OPTIONS) --update-pmbp-pl +pmbp-update: git-submodules pmbp-upgrade + perl local/bin/pmbp.pl $(PMBP_OPTIONS) --update +pmbp-install: pmbp-upgrade + perl local/bin/pmbp.pl $(PMBP_OPTIONS) --install \ + --create-perl-command-shortcut @perl \ + --create-perl-command-shortcut @prove \ + --create-perl-command-shortcut @plackup=perl\ modules/twiggy-packed/script/plackup + +create-commit-for-heroku: + git remote rm origin + rm -fr deps/pmtar/.git deps/pmpp/.git modules/*/.git + git add -f deps/pmtar/* #deps/pmpp/* + #rm -fr ./t_deps/modules + #git rm -r t_deps/modules + git rm .gitmodules + git rm modules/* --cached + git add -f modules/*/* + git commit -m "for heroku" + +## ------ Tests ------ + +PROVE = ./prove + +test: test-deps test-main + +test-deps: deps + +test-main: + #$(PROVE) t/*.t + +always: ## License: Public Domain. diff --git a/Procfile b/Procfile new file mode 100644 index 00000000..cfdd4f22 --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +web: ./plackup -p $PORT -s Twiggy::Prefork support/server.psgi \ No newline at end of file diff --git a/app.json b/app.json new file mode 100644 index 00000000..b6ed0b07 --- /dev/null +++ b/app.json @@ -0,0 +1,7 @@ +{ + "name": "tests-web", + "website": "https://github.com/wakaba/tests-web", + "buildpacks": [ + {"url": "https://github.com/wakaba/heroku-buildpack-perl-pmbp"} + ] +} diff --git a/circle.yml b/circle.yml new file mode 100644 index 00000000..f4b68c8a --- /dev/null +++ b/circle.yml @@ -0,0 +1,29 @@ +dependencies: + override: + - git config --global user.email "temp@circleci.test" + - git config --global user.name "CircleCI" + - make deps +test: + override: + - make test + - ./plackup -p 5114 -t Twiggy::Prefork bin/server.psgi : + background: true + - sleep 10 + - curl http://localhost:5114 +deployment: + staging: + branch: staging + commands: + - git rev-parse HEAD > head.txt + - curl -f -s -S --request POST --header "Authorization:token $GITHUB_ACCESS_TOKEN" --header "Content-Type:application/json" --data-binary "{\"base\":\"master\",\"head\":\"`cat head.txt`\",\"commit_message\":\"auto-merge staging into master\"}" "https://api.github.com/repos/wakaba/tests-web/merges" + nightly: + branch: nightly + commands: + - git rev-parse HEAD > head.txt + - curl -f -s -S --request POST --header "Authorization:token $GITHUB_ACCESS_TOKEN" --header "Content-Type:application/json" --data-binary "{\"base\":\"master\",\"head\":\"`cat head.txt`\",\"commit_message\":\"auto-merge nightly into master\"}" "https://api.github.com/repos/wakaba/tests-web/merges" + heroku: + branch: master + commands: + - "[[ ! -s \"$(git rev-parse --git-dir)/shallow\" ]] || git fetch --unshallow" + - make create-commit-for-heroku + - git push git@heroku.com:web-tests.git +`git rev-parse HEAD`:refs/heads/master diff --git a/config/perl/pmb-install.txt b/config/perl/pmb-install.txt new file mode 100644 index 00000000..851644b6 --- /dev/null +++ b/config/perl/pmb-install.txt @@ -0,0 +1,18 @@ +Scalar::Util~1.42 +Pod::Usage~1.67 +IO::Handle~1.28 +Test::NoWarnings~1.04 +Unicode::Normalize~1.23 +Encode~2.78 +AnyEvent::Util +Time::Local~1.2300 +parent~0.234 +Exporter::Lite~0.06 +Time::HiRes~1.9726 +Exporter~5.72 +Carp~1.36 +Proc::Wait3~0.04 +MIME::Base64~3.15 +File::Temp~0.2304 +Path::Class~0.35 +Unicode::Stringprep~1.105 diff --git a/config/perl/pmbp-exclusions.txt b/config/perl/pmbp-exclusions.txt new file mode 100644 index 00000000..fad32050 --- /dev/null +++ b/config/perl/pmbp-exclusions.txt @@ -0,0 +1,20 @@ +- "../../modules/json-functions-xs" tests +- "../../modules/json-ps" tests +- "../../modules/web-encodings" tests build +- "../../modules/web-url" tests build +- "../../modules/web-dom" tests build +- "../../modules/web-css" tests build +- "../../modules/web-markup" tests build +- "../../modules/web-useragent-functions" tests lwp anyeventsocks oauth wsse cli testws curl +- "../../modules/wanage" tests build datetime mp +- "../../modules/temma" tests +- "../../modules/ooutils" tests classdiamondgenerator classregistry objectcachesmethod operationresponse test +- "../../modules/charclass" tests build +- "../../modules/web-utils" tests +- "../../modules/mediawiki-parser" tests web +- "../../modules/promise" tests +- "../../modules/promised-file" tests +- "../../modules/promised-command" tests +- "../../modules/twiggy-packed" tests +- "../../t_deps/modules/test-x1" tests +- "../../modules/promised-plackup" tests diff --git a/modules/charclass b/modules/charclass new file mode 160000 index 00000000..8d9dd50c --- /dev/null +++ b/modules/charclass @@ -0,0 +1 @@ +Subproject commit 8d9dd50c4ed4c008a15859603b5ba9773c9b89a4 diff --git a/modules/manakai b/modules/manakai deleted file mode 160000 index 8487d3a6..00000000 --- a/modules/manakai +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 8487d3a6c8afd913c44bdb6a2db4c4735829e519 diff --git a/modules/ooutils b/modules/ooutils new file mode 160000 index 00000000..de37e791 --- /dev/null +++ b/modules/ooutils @@ -0,0 +1 @@ +Subproject commit de37e791b41fdfdf9f680d4a951005fc31bd27d3 diff --git a/modules/promise b/modules/promise new file mode 160000 index 00000000..536eb801 --- /dev/null +++ b/modules/promise @@ -0,0 +1 @@ +Subproject commit 536eb8014bba0f0261c9ca92f60af7ceb1d2e8ea diff --git a/modules/promised-command b/modules/promised-command new file mode 160000 index 00000000..6c3fee9b --- /dev/null +++ b/modules/promised-command @@ -0,0 +1 @@ +Subproject commit 6c3fee9b77d55c33c915a111654ba7da27e42b47 diff --git a/modules/twiggy-packed b/modules/twiggy-packed new file mode 160000 index 00000000..55868752 --- /dev/null +++ b/modules/twiggy-packed @@ -0,0 +1 @@ +Subproject commit 55868752f962b7a05083533bfea9f392f340e3ba diff --git a/modules/wanage b/modules/wanage new file mode 160000 index 00000000..9b8c65e4 --- /dev/null +++ b/modules/wanage @@ -0,0 +1 @@ +Subproject commit 9b8c65e4a63d09833114f2f2673edbe86c8fb67e diff --git a/modules/web-encodings b/modules/web-encodings new file mode 160000 index 00000000..a5a3544b --- /dev/null +++ b/modules/web-encodings @@ -0,0 +1 @@ +Subproject commit a5a3544be00d6d83b6b43f4f80a0f4a9354823ef diff --git a/modules/web-url b/modules/web-url new file mode 160000 index 00000000..ab05cd05 --- /dev/null +++ b/modules/web-url @@ -0,0 +1 @@ +Subproject commit ab05cd051e502ed64e4a10374122fffbbf248859