This repository was archived by the owner on Feb 26, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathgenerateDockerHubCommands.py
More file actions
64 lines (56 loc) · 3.52 KB
/
Copy pathgenerateDockerHubCommands.py
File metadata and controls
64 lines (56 loc) · 3.52 KB
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
56
57
58
59
60
61
62
63
64
import requests
import argparse
import json
import time
import threading
import sys
import datetime
def getConfig(config):
f = open(config, "r")
content = json.loads(f.read(), strict=False)
f.close()
return content
parser = argparse.ArgumentParser()
parser.add_argument('--newTag', "-t", help='new timestamp EG: 1906281234')
args = parser.parse_args()
if args.newTag == None:
tag = datetime.datetime.now().strftime("%y%m%d%H%M")
else:
tag = args.newTag
config = "blessedImageConfig-dev.json"
buildRequests = getConfig(config)
print("az login")
print("az acr login --name blimpacr")
for br in buildRequests:
prefix = "-apache"
print("docker pull blimpacr.azurecr.io/{}".format(br["outputImageName"]))
print("docker tag blimpacr.azurecr.io/{} appsvctest/{}:{}{}_{}".format(br["outputImageName"], br["stack"], br["version"], prefix, tag))
print("docker tag blimpacr.azurecr.io/{} appsvc/{}:{}{}_{}".format(br["outputImageName"], br["stack"], br["version"], prefix, tag))
print("docker push appsvctest/{}:{}{}_{}".format(br["stack"], br["version"], prefix, tag))
print("docker push appsvc/{}:{}{}_{}".format(br["stack"], br["version"], prefix, tag))
prefix = "-apache-xdebug"
print("docker pull blimpacr.azurecr.io/{}".format(br["xdebugOutputImageName"]))
print("docker tag blimpacr.azurecr.io/{} appsvctest/{}:{}{}_{}".format(br["xdebugOutputImageName"], br["stack"], br["version"], prefix, tag))
print("docker tag blimpacr.azurecr.io/{} appsvc/{}:{}{}_{}".format(br["xdebugOutputImageName"], br["stack"], br["version"], prefix, tag))
print("docker push appsvctest/{}:{}{}_{}".format(br["stack"], br["version"], prefix, tag))
print("docker push appsvc/{}:{}{}_{}".format(br["stack"], br["version"], prefix, tag))
### LATEST / LTS ###
if br["version"] == "7.3":
print("docker pull blimpacr.azurecr.io/{}".format(br["outputImageName"]))
print("docker tag blimpacr.azurecr.io/{} appsvctest/{}:latest_{}".format(br["outputImageName"], br["stack"], tag))
print("docker tag blimpacr.azurecr.io/{} appsvctest/{}:latest".format(br["outputImageName"], br["stack"]))
print("docker tag blimpacr.azurecr.io/{} appsvc/{}:latest_{}".format(br["outputImageName"], br["stack"], tag))
print("docker tag blimpacr.azurecr.io/{} appsvc/{}:latest".format(br["outputImageName"], br["stack"]))
print("docker push appsvctest/{}:latest_{}".format(br["stack"], tag))
print("docker push appsvctest/{}:latest".format(br["stack"]))
print("docker push appsvc/{}:latest_{}".format(br["stack"], tag))
print("docker push appsvc/{}:latest".format(br["stack"]))
print("docker pull blimpacr.azurecr.io/{}".format(br["outputImageName"]))
print("docker tag blimpacr.azurecr.io/{} appsvctest/{}:latest-xdebug_{}".format(br["xdebugOutputImageName"], br["stack"], tag))
print("docker tag blimpacr.azurecr.io/{} appsvctest/{}:latest-xdebug".format(br["xdebugOutputImageName"], br["stack"]))
print("docker tag blimpacr.azurecr.io/{} appsvc/{}:latest-xdebug_{}".format(br["xdebugOutputImageName"], br["stack"], tag))
print("docker tag blimpacr.azurecr.io/{} appsvc/{}:latest-xdebug".format(br["xdebugOutputImageName"], br["stack"]))
print("docker push appsvctest/{}:latest-xdebug_{}".format(br["stack"], tag))
print("docker push appsvctest/{}:latest-xdebug".format(br["stack"]))
print("docker push appsvc/{}:latest-xdebug_{}".format(br["stack"], tag))
print("docker push appsvc/{}:latest-xdebug".format(br["stack"]))