This repository has been archived by the owner on Mar 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.setup-project.create-dotenv-file.toml
73 lines (62 loc) · 2.42 KB
/
.setup-project.create-dotenv-file.toml
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
[tasks.create-dotenv-file.linux]
condition.env_true = ['CARGO_MAKE_TASK_ENABLE_SETUP_PROJECT_CREATE_DOTENV_FILE']
condition.files_not_exist = ["${CARGO_MAKE_WORKING_DIRECTORY}/.env"]
dependencies = [
"prepare"
]
script_runner = "@duckscript"
script = [
'''
out = set ""
ret_uid = exec id -u
ret_gid = exec id -g
uid = set ${ret_uid.stdout}
gid = set ${ret_gid.stdout}
out = set "${out}UID=${uid}"
out = set "${out}GID=${gid}"
if ${CARGO_MAKE_TASK_ENABLE_SETUP_PROJECT_CREATE_DOTENV_FILE_USER_GITHUB_ACCOUNT_NAME}
!include_files ./tasks/.create-dotenv-file.user-github-account-name.ds
out = set "${out}USER_GITHUB_ACCOUNT_NAME=${user_github_account_name}\n"
out = set "${out}TF_VAR_user_github_account_name=${user_github_account_name}\n"
end
if ${CARGO_MAKE_TASK_ENABLE_SETUP_PROJECT_CREATE_DOTENV_FILE_CLOUDSDK_CORE_PROJECT}
!include_files ./tasks/.create-dotenv-file.cloudsdk-core-project.ds
out = set "${out}CLOUDSDK_CORE_PROJECT=${gcp_project_id}\n"
out = set "${out}TF_VAR_gcp_project_id=${gcp_project_id}\n"
end
if ${CARGO_MAKE_TASK_ENABLE_SETUP_PROJECT_CREATE_DOTENV_FILE_IP_ADDRS}
!include_files ./tasks/.create-dotenv-file.ip_addrs.ds
out = set "${out}BIND_IP_ADDR=${bind_ip_addr}\n"
out = set "${out}PUBLIC_IP_ADDR_OR_FQDN=${public_ip_addr_or_fqdn}\n"
end
writefile .env ${out}
'''
]
[tasks.create-dotenv-file.mac]
condition.env_true = ['CARGO_MAKE_TASK_ENABLE_SETUP_PROJECT_CREATE_DOTENV_FILE']
condition.files_not_exist = ["${CARGO_MAKE_WORKING_DIRECTORY}/.env"]
dependencies = [
"prepare"
]
script_runner = "@duckscript"
script = [
'''
out = set ""
if ${CARGO_MAKE_TASK_ENABLE_SETUP_PROJECT_CREATE_DOTENV_FILE_USER_GITHUB_ACCOUNT_NAME}
!include_files ./tasks/.create-dotenv-file.user-github-account-name.ds
out = set "${out}USER_GITHUB_ACCOUNT_NAME=${user_github_account_name}\n"
out = set "${out}TF_VAR_user_github_account_name=${user_github_account_name}\n"
end
if ${CARGO_MAKE_TASK_ENABLE_SETUP_PROJECT_CREATE_DOTENV_FILE_CLOUDSDK_CORE_PROJECT}
!include_files ./tasks/.create-dotenv-file.cloudsdk-core-project.ds
out = set "${out}CLOUDSDK_CORE_PROJECT=${gcp_project_id}\n"
out = set "${out}TF_VAR_gcp_project_id=${gcp_project_id}\n"
end
if ${CARGO_MAKE_TASK_ENABLE_SETUP_PROJECT_CREATE_DOTENV_FILE_IP_ADDRS}
!include_files ./tasks/.create-dotenv-file.ip_addrs.ds
out = set "${out}BIND_IP_ADDR=${bind_ip_addr}\n"
out = set "${out}PUBLIC_IP_ADDR_OR_FQDN=${public_ip_addr_or_fqdn}\n"
end
writefile .env ${out}
'''
]