-
Notifications
You must be signed in to change notification settings - Fork 11
/
.gitpod.yml
58 lines (48 loc) · 1.95 KB
/
.gitpod.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
image:
file: .gitpod.Dockerfile
tasks:
- name: Project build (cache) and run instructions
init: |
cargo build
# workaround for https://github.com/gitpod-io/gitpod/issues/524
find target -exec stat --format='%.Y %n' {} + > /workspace/.ts
command: |
# workaround for https://github.com/gitpod-io/gitpod/issues/524
while read -r ts file; do touch -d "@${ts}" "${file}"; done < /workspace/.ts
- name: Setup BotConfig and run program
before: |
# Fully cleanup terminal
printf "\033[3J\033c\033[3J"
# Restore ProdBotConfig.toml
if test -n "${PROD_DISCORD_BOT_CONFIG_ENCODED:-}"; then {
base64 -d <<<"${PROD_DISCORD_BOT_CONFIG_ENCODED}" > ProdBotConfig.toml
} fi
# Restore config if exists and run bot
config_name="BotConfig.toml"
if test -n "${DISCORD_BOT_CONFIG_ENCODED:-}"; then {
base64 -d <<< "${DISCORD_BOT_CONFIG_ENCODED}" > "${config_name}"
} else {
# Create "BotConfig.toml"
cp ExampleBotConfig.toml "${config_name}"
RC=$'\033[0m'
BGREEN=$'\033[1;32m'
YELLOW=$'\033[1;33m'
BRED=$'\033[1;31m'
printf '\n';
printf '%s\n' \
">>> Created ${BGREEN}./${config_name}${RC} by copying ./ExampleBotConfig.toml" \
">>> Please update/fill-up ${BGREEN}./${config_name}${RC} with the necessary information and run:" \
"# To persist the config change" \
" ${BRED}gp env DISCORD_BOT_CONFIG_ENCODED=\"\$(base64 -w0 ${config_name})\"${RC}" \
"# To execute the bot from cargo in debug variant" \
" ${YELLOW}cargo run -- ${config_name}${RC}"
} fi
command: |
config_name="BotConfig.toml"
if test -e "${config_name}"; then {
cargo run -- "${config_name}"
} fi
vscode:
extensions:
- https://github.com/rust-lang/rust-analyzer/releases/download/2023-10-09/rust-analyzer-linux-x64.vsix
- tamasfe.even-better-toml