forked from gitpod-io/optimus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitpod.yml
77 lines (65 loc) · 2.76 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
image:
file: .gitpod.Dockerfile
tasks:
- name: Project build (cache) and run instructions
init: cargo build
command: |
# Fully cleanup terminal
printf "\033[3J\033c\033[3J"
# Install clippy and rustfmt
rustup component add clippy --toolchain nightly-x86_64-unknown-linux-gnu
rustup component add rustfmt --toolchain nightly-x86_64-unknown-linux-gnu
# Restore ProdBotConfig.toml
if test -n "${PROD_DISCORD_BOT_CONFIG_ENCODED:-}"; then {
base64 -d <<<"${PROD_DISCORD_BOT_CONFIG_ENCODED}" > ProdBotConfig.toml
} fi
# Await for meilisearch to be fully up
#printf '\n\ninfo: %s\n' "Awaiting for meilisearch to be fully up ..."
#until curl --silent --show-error --fail http://localhost:7700/health >/dev/null 2>&1; do sleep 0.5; done
# 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}"
cargo run -- "${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
# - name: Meilisearch
# command: |
# # Fully cleanup terminal
# printf "\033[3J\033c\033[3J"
# # Start server
# meilisearch --no-analytics --master-key "${MEILISEARCH_API_KEY}" --env development --http-addr 0.0.0.0:7700 --db-path ./data.ms
vscode:
extensions:
- rust-lang.rust-analyzer
github:
prebuilds:
# enable for the default branch (defaults to true)
master: true
# enable for all branches in this repo (defaults to false)
branches: true
# enable for pull requests coming from this repo (defaults to true)
pullRequests: true
# enable for pull requests coming from forks (defaults to false)
# DANGER: do not enable!!
pullRequestsFromForks: false
# add a check to pull requests (defaults to true)
addCheck: true
# add a "Review in Gitpod" button as a comment to pull requests (defaults to false)
addComment: true
# add a "Review in Gitpod" button to the pull request's description (defaults to false)
addBadge: true