forked from particuleio/demo-concourse-flux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
55 lines (53 loc) · 1.2 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<html>
<head>
<title>Hello world!</title>
<link href='//fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'>
<style>
body {
background-color: #2989A4;
text-align: center;
padding: 50px;
font-family: "Open Sans","Helvetica Neue",Helvetica,Arial,sans-serif;
color: white;
}
#logo {
margin-bottom: 40px;
}
</style>
</head>
<body>
<img id="logo" src="logo.png" />
<h1><?php echo "Hello ".($_ENV["NAME"]?$_ENV["NAME"]:"world")."!"; ?></h1>
<?php if($_ENV["HOSTNAME"]) {?><h3>My hostname is <?php echo $_ENV["HOSTNAME"]; ?></h3><?php } ?>
<?php
$links = [];
foreach($_ENV as $key => $value) {
if(preg_match("/^(.*)_PORT_([0-9]*)_(TCP|UDP)$/", $key, $matches)) {
$links[] = [
"name" => $matches[1],
"port" => $matches[2],
"proto" => $matches[3],
"value" => $value
];
}
}
if($links) {
?>
<h3>Links found</h3>
<?php
foreach($links as $link) {
?>
<b><?php echo $link["name"]; ?></b> listening in <?php echo $link["port"]+"/"+$link["proto"]; ?> available at <?php echo $link["value"]; ?><br />
<?php
}
?>
<?php
}
if($_ENV["DOCKERCLOUD_AUTH"]) {
?>
<h3>I have Docker Cloud API powers!</h3>
<?php
}
?>
</body>
</html>