Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
HongzheWang
slapos
Commits
937fcca5
Commit
937fcca5
authored
Aug 29, 2012
by
Cédric Le Ninivin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New promise to check page content for lamp
parent
4e632fb1
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
75 additions
and
1 deletion
+75
-1
setup.py
setup.py
+1
-0
slapos/recipe/check_page_content/__init__.py
slapos/recipe/check_page_content/__init__.py
+49
-0
slapos/recipe/check_page_content/template/check_page_content.in
.../recipe/check_page_content/template/check_page_content.in
+17
-0
stack/lamp/buildout.cfg
stack/lamp/buildout.cfg
+1
-1
stack/lamp/instance-apache-php.cfg
stack/lamp/instance-apache-php.cfg
+7
-0
No files found.
setup.py
View file @
937fcca5
...
...
@@ -49,6 +49,7 @@ setup(name=name,
'certificate_authority.request = slapos.recipe.certificate_authority:Request'
,
'check_port_listening = slapos.recipe.check_port_listening:Recipe'
,
'check_url_available = slapos.recipe.check_url_available:Recipe'
,
'check_page_content = slapos.recipe.check_page_content:Recipe'
,
'cloud9 = slapos.recipe.cloud9:Recipe'
,
'cron = slapos.recipe.dcron:Recipe'
,
'cron.d = slapos.recipe.dcron:Part'
,
...
...
slapos/recipe/check_page_content/__init__.py
0 → 100644
View file @
937fcca5
##############################################################################
#
# Copyright (c) 2011 Vifib SARL and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
from
slapos.recipe.librecipe
import
GenericBaseRecipe
import
sys
class
Recipe
(
GenericBaseRecipe
):
"""
Create script that will check if content at "url" is available
(e.g page has a link to itself).
"""
def
install
(
self
):
config
=
{
'url'
:
self
.
options
[
'url'
],
'shell_path'
:
self
.
options
[
'dash_path'
],
'curl_path'
:
self
.
options
[
'curl_path'
],
}
# XXX-Cedric in this script, curl won't check certificate
promise
=
self
.
createExecutable
(
self
.
options
[
'path'
],
self
.
substituteTemplate
(
self
.
getTemplateFilename
(
'check_page_content.in'
),
config
)
)
return
[
promise
]
slapos/recipe/check_page_content/template/check_page_content.in
0 → 100644
View file @
937fcca5
#!%(shell_path)s
# BEWARE: This file is operated by slapgrid
# BEWARE: It will be overwritten automatically
URL="%(url)s"
if [ -z $URL ]; then
echo "No URL specified." >&2
exit 3
fi
%(curl_path)s -k -sL $URL | grep "$URL" > /dev/null
if [ $? != 0 ]; then
echo "Content at $URL seems to be corrupted" >&2
exit 1
fi
stack/lamp/buildout.cfg
View file @
937fcca5
...
...
@@ -66,7 +66,7 @@ mode = 0644
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-apache-php.cfg
output = ${buildout:directory}/template-apache-php.cfg
md5sum =
8bb0b03689d2be9566ed1ef3e96b4403
md5sum =
159c5326e6faff2ba9c1f52b113c01fa
mode = 0644
[template-apache-backup]
...
...
stack/lamp/instance-apache-php.cfg
View file @
937fcca5
...
...
@@ -12,6 +12,7 @@ parts =
slapmonitor
slapreport
frontend-promise
content-promise
publish-connection-informations
eggs-directory = ${buildout:eggs-directory}
...
...
@@ -256,6 +257,12 @@ url = $${request-frontend:connection-site_url}
dash_path = ${dash:location}/bin/dash
curl_path = ${curl:location}/bin/curl
[content-promise]
recipe = slapos.cookbook:check_page_content
path = $${basedirectory:promises}/content
url = $${request-frontend:connection-site_url}
dash_path = ${dash:location}/bin/dash
curl_path = ${curl:location}/bin/curl
[slap-parameter]
# Default value if no domain is specified
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment