Skip to content

Commit e116893

Browse files
committed
Merge pull request alphagov#187 from alphagov/add_integration
[#108209890] Add new Integration environment
2 parents 7a992bb + 3313427 commit e116893

File tree

5 files changed

+23
-15
lines changed

5 files changed

+23
-15
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ You can view a list of the available tasks:
3232

3333
And execute against an environment and set of hosts like so:
3434

35-
$ fab preview all hosts
35+
$ fab integration all hosts
3636
...
37-
$ fab preview class:frontend do:'uname -a'
38-
$ fab preview class:cache,bouncer do:uptime
37+
$ fab integration class:frontend do:'uname -a'
38+
$ fab integration class:cache,bouncer do:uptime
3939
...
4040

4141
### Targetting groups of machines
@@ -45,17 +45,17 @@ Fabric tasks can be run on groups of machines in a variety of different ways.
4545
by puppet class
4646

4747
# target all machines that have the 'govuk::safe_to_reboot::yes' class
48-
$ fab preview puppet_class:govuk::safe_to_reboot::yes do:'uname -a'
48+
$ fab integration puppet_class:govuk::safe_to_reboot::yes do:'uname -a'
4949

5050
by numeric machine suffix
5151

5252
# target all machines that end in '2'
53-
$ fab preview numbered:2 do:'uname -a'
53+
$ fab integration numbered:2 do:'uname -a'
5454

5555
by node type (as defined in puppet)
5656

5757
# target all 'frontend' machines
58-
$ fab preview node_type:frontend do:'uname -a'
58+
$ fab integration node_type:frontend do:'uname -a'
5959

6060
by the node name
6161

fabfile.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ def fetch(self):
104104
continue
105105

106106
# Don't refer to foo.bar.production, as it's confusing when doing
107-
# things in preview or staging. Refer to the machines exclusively by
108-
# short name.
107+
# things in integration or staging. Refer to the machines
108+
# exclusively by short name.
109109
short_host = '{0}.{1}'.format(name, vdc)
110110

111111
cls = name.rstrip('-1234567890').replace('-', '_')
@@ -249,6 +249,14 @@ def staging():
249249
_set_gateway('staging.publishing.service.gov.uk')
250250

251251

252+
@task
253+
def integration():
254+
"""Select integration environment"""
255+
env['environment'] = 'integration'
256+
_set_gateway('integration.publishing.service.gov.uk')
257+
258+
259+
# FIXME: Remove once Preview environment is deleted
252260
@task
253261
def preview():
254262
"""Select preview environment"""

mainstream_slugs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
@task
66
def change(old_url, new_url):
7-
"""Change a mainstream slug. Usage: fab preview mainstream_slugs.change:old_slug=/old-slug,new_slug=/new-slug"""
7+
"""Change a mainstream slug. Usage: fab integration mainstream_slugs.change:old_slug=/old-slug,new_slug=/new-slug"""
88
util.use_random_host('class-backend')
99
util.rake('panopticon', 'delete_mainstream_slug_from_search', old_url)
1010
util.rake('publisher', 'update_mainstream_slug', old_url, new_url)

nagios.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ def submit_nagios_cmd(command):
1414

1515
def _monitoring_hostname(host):
1616
"""Returns the canonical name (according to our monitoring) for a host"""
17-
if env['environment'] == 'preview':
17+
if env['environment'] == 'production':
18+
return "{0}.publishing.service.gov.uk".format(host)
19+
elif env['environment'] == 'preview': # FIXME: Remove once Preview is deleted
1820
return "%s.production" % host
19-
elif env['environment'] == 'staging':
20-
return "{0}.staging.publishing.service.gov.uk".format(host)
2121
else:
22-
return "{0}.publishing.service.gov.uk".format(host)
22+
return "{0}.{1}.publishing.service.gov.uk".format(host, env['environment'])
2323

2424

2525
@task

vm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ def bodge_unicorn(name):
6262
6363
e.g. To kill off and restart contentapi on backend-1 in Preview:
6464
65-
fab preview -H backend-1.backend vm.bodge_unicorn:contentapi
65+
fab integration -H backend-1.backend vm.bodge_unicorn:contentapi
6666
6767
...or on all backend hosts in Preview:
6868
69-
fab preview class:backend vm.bodge_unicorn:contentapi
69+
fab integration class:backend vm.bodge_unicorn:contentapi
7070
7171
Yes. This is a bodge. Sorry.
7272
"""

0 commit comments

Comments
 (0)