Skip to content
Snippets Groups Projects
Commit 77b6181c authored by Neil Drumm's avatar Neil Drumm :wave:
Browse files

Remove old API site

parent 7cc59b7e
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env bash
set -uex
cd /usr/local/api.drupal.org-src
for d in $(ls); do
cd $d
if [ "${shallow-}" = 'true' ]; then
git pull --depth 1 && git gc --prune=all
else
git pull
fi
cd ..
done
......@@ -9,39 +9,6 @@ pool = ThreadingGroup('btch1.drupal.bak', 'www8.drupal.bak', 'www9.drupal.bak',
clone_path = f"/var/www/{os.environ['uri']}/htdocs"
branch = os.environ['branch']
# Per site configurations
#if env.uri == "drupal.org":
# repo_url = "git@bitbucket.org:drupalorg-infrastructure/drupal.org-built.git"
# files_path = ("files")
#elif env.uri == "api.drupal.org":
# repo_url = "git@bitbucket.org:drupalorg-infrastructure/api.drupal.org-built.git"
# files_path = ("sites/default/files")
#elif env.uri == "association.drupal.org":
# repo_url = "git@bitbucket.org:drupalorg-infrastructure/assoc.drupal.org-built.git"
# files_path = ("files")
#elif env.uri == "events.drupal.org":
# repo_url = "git@bitbucket.org:drupalorg-infrastructure/events.drupal.org-built.git"
# files_path = ("sites/default/files")
#elif env.uri == "groups.drupal.org":
# repo_url = "git@bitbucket.org:drupalorg-infrastructure/groups.drupal.org-built.git"
# files_path = ("files")
#elif env.uri == "jobs.drupal.org":
# repo_url = "git@bitbucket.org:drupalorg-infrastructure/jobs.drupal.org-built.git"
# files_path = ("sites/default/files")
#elif env.uri == "localize.drupal.org":
# repo_url = "git@bitbucket.org:drupalorg-infrastructure/localize.drupal.org-built.git"
# files_path = ("sites/default/files")
#elif env.uri == "security.drupal.org":
# repo_url = "git@bitbucket.org:drupalorg-infrastructure/security.drupal.org-built.git"
# files_path = ("sites/default/files")
#elif env.uri == "updates.drupal.org":
# repo_url = "git@bitbucket.org:drupalorg-infrastructure/updates.drupal.org.git"
#elif env.uri == "ftp.drupal.org":
# repo_url = "git@bitbucket.org:drupalorg-infrastructure/ftp.drupal.org.git"
#else:
# quit(1)
@task
def deploy(c):
pool.run(f"git -C {clone_path!r} fetch --prune", echo=True)
......@@ -52,42 +19,3 @@ def deploy(c):
pool.run(f"git -C {clone_path!r} checkout {branch!r}", echo=True)
pool.run(f"git -C {clone_path!r} branch --set-upstream-to=origin/{branch!r} {branch!r}", echo=True)
pool.run(f"git -C {clone_path!r} pull", echo=True)
# @parallel
# def clone():
# run("mkdir -p %s" % clone_path)
# run("chown bender:bender %s" % clone_path)
# run("git clone %s %s" % (repo_url,clone_path))
#
# def symlink():
# if files_path:
# run("sudo /bin/ln -sfv /mnt/nfs/%s/files-tmp %s/../files-tmp" % (env.uri,clone_path))
# run("sudo /bin/ln -sfv /mnt/nfs/%s/htdocs/%s %s/%s" % (env.uri,files_path,clone_path,files_path))
# run("sudo /bin/ln -sfv /mnt/nfs/%s/htdocs/sites/default/settings.local.php %s/sites/default/settings.local.php" % (env.uri,clone_path))
# # private-files dirs
# if env.uri == "jobs.drupal.org":
# run("sudo /bin/ln -sfv /mnt/nfs/%s/files-private %s/../files-private" % (env.uri,clone_path))
# if env.uri == "security.drupal.org":
# run("sudo /bin/ln -sfv /mnt/nfs/%s/files %s/../files" % (env.uri,clone_path))
#
# def symlinkstatic():
# run("sudo /bin/ln -sfv /mnt/nfs/amsterdam2014.drupal.org /var/www/amsterdam2014.drupal.org")
# run("sudo /bin/ln -sfv /mnt/nfs/austin2014.drupal.org /var/www/austin2014.drupal.org")
# run("sudo /bin/ln -sfv /mnt/nfs/drupalcamp.org /var/www/drupalcamp.org")
# run("sudo /bin/ln -sfv /mnt/nfs/barcelona2007.drupalcon.org /var/www/barcelona2007.drupalcon.org")
# run("sudo /bin/ln -sfv /mnt/nfs/boston2008.drupalcon.org /var/www/boston2008.drupalcon.org")
# run("sudo /bin/ln -sfv /mnt/nfs/chicago2011.drupal.org /var/www/chicago2011.drupal.org")
# run("sudo /bin/ln -sfv /mnt/nfs/cph2010.drupal.org /var/www/cph2010.drupal.org")
# run("sudo /bin/ln -sfv /mnt/nfs/dc2009.drupalcon.org /var/www/dc2009.drupalcon.org")
# run("sudo /bin/ln -sfv /mnt/nfs/denver2012.drupal.org /var/www/denver2012.drupal.org")
# run("sudo /bin/ln -sfv /mnt/nfs/latinamerica2015.drupal.org /var/www/latinamerica2015.drupal.org")
# run("sudo /bin/ln -sfv /mnt/nfs/london2011.drupal.org /var/www/london2011.drupal.org")
# run("sudo /bin/ln -sfv /mnt/nfs/munich2012.drupal.org /var/www/munich2012.drupal.org")
# run("sudo /bin/ln -sfv /mnt/nfs/paris2009.drupalcon.org /var/www/paris2009.drupalcon.org")
# run("sudo /bin/ln -sfv /mnt/nfs/portland2013.drupal.org /var/www/portland2013.drupal.org")
# run("sudo /bin/ln -sfv /mnt/nfs/prague2013.drupal.org /var/www/prague2013.drupal.org")
# run("sudo /bin/ln -sfv /mnt/nfs/sf2010.drupal.org /var/www/sf2010.drupal.org")
# run("sudo /bin/ln -sfv /mnt/nfs/saopaulo2012.drupal.org /var/www/saopaulo2012.drupal.org")
# run("sudo /bin/ln -sfv /mnt/nfs/sydney2013.drupal.org /var/www/sydney2013.drupal.org")
# run("sudo /bin/ln -sfv /mnt/nfs/szeged2008.drupalcon.org /var/www/szeged2008.drupalcon.org")
# run("sudo /bin/ln -sfv /mnt/nfs/qa.drupal.org /var/www/qa.drupal.org")
......@@ -5,7 +5,7 @@ source snapshot/common.sh
# Exit immediately on uninitialized variable or error, and print each command.
set -uex
dblist="drupal_api drupal_association drupal_groups drupal_localize"
dblist="drupal_association drupal_groups drupal_localize"
# Generate a list of all databases and tables (except 'pift_ci_job_result'
# which is already compressed), and alter them to the compressed row_format.
......
UPDATE users SET access = 280299600;
DELETE FROM node WHERE status <> 1;
DELETE FROM comment WHERE status <> 1;
UPDATE comment SET hostname = '127.0.0.1';
DELETE node FROM node LEFT JOIN users ON node.uid = users.uid WHERE users.uid IS NULL;
DELETE node_access FROM node_access LEFT JOIN node ON node.nid = node_access.nid WHERE node.nid IS NULL;
DELETE node_revision FROM node_revision LEFT JOIN node ON node.nid = node_revision.nid WHERE node.nid IS NULL;
DELETE comment FROM comment LEFT JOIN node ON node.nid = comment.nid WHERE node.nid IS NULL;
DELETE comment FROM comment LEFT JOIN users ON comment.uid = users.uid WHERE users.uid IS NULL;
DELETE comment FROM comment LEFT JOIN comment c2 ON comment.pid = c2.cid WHERE c2.cid IS NULL AND comment.pid <> 0;
-- Get rid of unpublished/blocked nodes, users, comments and related data in other tables.
DELETE f FROM field_revision_comment_body AS f LEFT JOIN comment c ON f.entity_id = c.cid WHERE c.cid IS NULL;
DELETE f FROM field_data_comment_body AS f LEFT JOIN comment c ON f.entity_id = c.cid WHERE c.cid IS NULL;
DELETE f FROM field_revision_body AS f LEFT JOIN node n ON f.entity_id = n.nid WHERE f.entity_type = 'node' AND n.nid IS NULL;
DELETE f FROM field_data_body AS f LEFT JOIN node n ON f.entity_id = n.nid WHERE f.entity_type = 'node' AND n.nid IS NULL;
UPDATE comment SET mail = CONCAT(name, '@sanitized.invalid');
UPDATE contact SET recipients = 'noreply@sanitized.invalid';
......@@ -5,7 +5,7 @@ source snapshot/common.sh
# Exit immediately on uninitialized variable or error, and print each command.
set -uex
dblist="drupal drupal_api drupal_association drupal_groups drupal_jobs drupal_localize drupal_security"
dblist="drupal drupal_association drupal_groups drupal_jobs drupal_localize drupal_security"
# Generate a list of all databases to be sanitized
for db in ${dblist}; do
......
......@@ -9,35 +9,6 @@ pool = ThreadingGroup('btchstg1.drupal.bak', 'wwwstg1.drupal.bak', 'wwwstg2.drup
clone_path = f"/var/www/{os.environ['uri']}/htdocs"
branch = os.environ['branch']
# Per site configurations
# if env.uri == "staging.devdrupal.org":
# repo_url = "git@bitbucket.org:drupalorg-infrastructure/drupal.org-built.git"
# files_path = ("files")
# elif env.uri == "api.staging.devdrupal.org":
# repo_url = "git@bitbucket.org:drupalorg-infrastructure/api.drupal.org-built.git"
# files_path = ("sites/default/files")
# elif env.uri == "assoc.staging.devdrupal.org":
# repo_url = "git@bitbucket.org:drupalorg-infrastructure/assoc.drupal.org-built.git"
# files_path = ("files")
# elif env.uri == "events.staging.devdrupal.org":
# repo_url = "git@bitbucket.org:drupalorg-infrastructure/events.drupal.org-built.git"
# files_path = ("sites/default/files")
# elif env.uri == "groups.staging.devdrupal.org":
# repo_url = "git@bitbucket.org:drupalorg-infrastructure/groups.drupal.org-built.git"
# files_path = ("files")
# elif env.uri == "jobs.staging.devdrupal.org":
# repo_url = "git@bitbucket.org:drupalorg-infrastructure/jobs.drupal.org-built.git"
# files_path = ("sites/default/files")
# elif env.uri == "localize.staging.devdrupal.org":
# repo_url = "git@bitbucket.org:drupalorg-infrastructure/localize.drupal.org-built.git"
# files_path = ("sites/default/files")
# elif env.uri == "security.staging.devdrupal.org":
# repo_url = "git@bitbucket.org:drupalorg-infrastructure/security.drupal.org-built.git"
# files_path = ("sites/default/files")
# else:
# quit(1)
@task
def deploy(c):
pool.run(f"git -C {clone_path!r} fetch --prune", echo=True)
......@@ -48,18 +19,3 @@ def deploy(c):
pool.run(f"git -C {clone_path!r} checkout {branch!r}", echo=True)
pool.run(f"git -C {clone_path!r} branch --set-upstream-to=origin/{branch!r} {branch!r}", echo=True)
pool.run(f"git -C {clone_path!r} pull", echo=True)
# @parallel
# def clone():
# run("mkdir -p %s" % clone_path)
# run("chown bender:bender %s" % clone_path)
# run("git clone %s %s" % (repo_url,clone_path))
#
# def symlink():
# if files_path:
# run("sudo /bin/ln -sfv /mnt/nfs/%s/files-tmp/ %s/../files-tmp" % (env.uri,clone_path))
# run("sudo /bin/ln -sfv /mnt/nfs/%s/htdocs/%s %s/%s" % (env.uri,files_path,clone_path,files_path))
# run("sudo /bin/ln -sfv /mnt/nfs/%s/htdocs/sites/default/settings.local.php %s/sites/default/settings.local.php" % (env.uri,clone_path))
# # private-files dirs
# if env.uri == "jobs.staging.devdrupal.org":
# run("sudo /bin/ln -sfv /mnt/nfs/%s/files-private/ %s/../files-private" % (env.uri,clone_path))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment