forked from jobtome-labs/ci-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless-multiregion.yml
83 lines (80 loc) · 2.51 KB
/
serverless-multiregion.yml
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
include:
- remote: 'https://raw.githubusercontent.com/jobtome-labs/ci-templates/v3.0.1/serverless-quality.yml'
# EUROPE
deploy:production:europe:
extends: .serverless:deploy
variables:
GOOGLE_KEY: ${GOOGLE_KEY_PRODUCTION_EUROPE}
FUNCTION_NAME: ${FUNCTION_NAME_PRODUCTION_EUROPE}
SERVICE_ACCOUNT: ${SERVICE_ACCOUNT_PRODUCTION_EUROPE}
REGION: ${REGION_PRODUCTION_EUROPE}
DOMAIN: ${DOMAIN_PRODUCTION_EUROPE}
ENVIRONMENT: production-europe
TRIGGER_TOPIC: ${TRIGGER_TOPIC_PRODUCTION_EUROPE}
SECRET_YAML: ${SECRET_YAML_PRODUCTION_EUROPE}
SECRET_ENV_LIST: ${SECRET_ENV_LIST_PRODUCTION_EUROPE}
before_script:
- |
# CHECK VARIABLES PHASE
for var in "GOOGLE_KEY_PRODUCTION_EUROPE" "REGION_PRODUCTION_EUROPE"; do
if [ -z "${!var}" ]; then
echo "Missing '${var}' variable!"
exit 1
fi
done
only:
- /^v.+$/i
except:
- branches
# AMERICA
deploy:production:america:
extends: .serverless:deploy
variables:
GOOGLE_KEY: ${GOOGLE_KEY_PRODUCTION_AMERICA}
FUNCTION_NAME: ${FUNCTION_NAME_PRODUCTION_AMERICA}
SERVICE_ACCOUNT: ${SERVICE_ACCOUNT_PRODUCTION_AMERICA}
REGION: ${REGION_PRODUCTION_AMERICA}
DOMAIN: ${DOMAIN_PRODUCTION_AMERICA}
ENVIRONMENT: production-america
TRIGGER_TOPIC: ${TRIGGER_TOPIC_PRODUCTION_AMERICA}
SECRET_YAML: ${SECRET_YAML_PRODUCTION_AMERICA}
SECRET_ENV_LIST: ${SECRET_ENV_LIST_PRODUCTION_AMERICA}
before_script:
- |
# CHECK VARIABLES PHASE
for var in "GOOGLE_KEY_PRODUCTION_AMERICA" "REGION_PRODUCTION_AMERICA"; do
if [ -z "${!var}" ]; then
echo "Missing '${var}' variable!"
exit 1
fi
done
only:
- /^v.+$/i
except:
- branches
# ASIA
deploy:production:asia:
extends: .serverless:deploy
variables:
GOOGLE_KEY: ${GOOGLE_KEY_PRODUCTION_ASIA}
FUNCTION_NAME: ${FUNCTION_NAME_PRODUCTION_ASIA}
SERVICE_ACCOUNT: ${SERVICE_ACCOUNT_PRODUCTION_ASIA}
REGION: ${REGION_PRODUCTION_ASIA}
DOMAIN: ${DOMAIN_PRODUCTION_ASIA}
ENVIRONMENT: production-asia
TRIGGER_TOPIC: ${TRIGGER_TOPIC_PRODUCTION_ASIA}
SECRET_YAML: ${SECRET_YAML_PRODUCTION_ASIA}
SECRET_ENV_LIST: ${SECRET_ENV_LIST_PRODUCTION_ASIA}
before_script:
- |
# CHECK VARIABLES PHASE
for var in "GOOGLE_KEY_PRODUCTION_ASIA" "REGION_PRODUCTION_ASIA"; do
if [ -z "${!var}" ]; then
echo "Missing '${var}' variable!"
exit 1
fi
done
only:
- /^v.+$/i
except:
- branches