-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy path.gitpod.yml
113 lines (100 loc) · 6.07 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
tasks:
- name: Gitpod Task
before: |
# Stores last segment of the Workspace Context URL in $path and trims spaces.
# `gp info` prints information about the current Gitpod workspace.
# `awk -F'/' '/Workspace Context URL/{print $NF}'` looks for the line containing 'Workspace Context URL' and prints the last field separated by "/".
# `tr -d '[:space:]'` removes any leading or trailing whitespace from the path.
echo "Retrieving the last part of the Workspace Context URL ..."
path=$(gp info | awk -F'/' '/Workspace Context URL/{print $NF}' | tr -d '[:space:]')
echo "Path '$path' is set."
# Install dotnet.
echo "Installing dotnet ..."
wget "https://dot.net/v1/dotnet-install.sh"
chmod +x dotnet-install.sh
./dotnet-install.sh --channel 6.0 --install-dir /workspace/dotnet
rm dotnet-install.sh
sudo ln -s /workspace/dotnet/dotnet /usr/bin/dotnet
echo "Installing dotnet done."
command: |
# Check if environment variables are set in https://gitpod.io/variables and run the application based on specified $path.
case "$path" in
"authorisation-adjustment-example")
if [ -z ${ADYEN_HMAC_KEY+x} ] || [[ -z ${ADYEN_API_KEY+x} ]] || [[ -z ${ADYEN_CLIENT_KEY+x} ]] || [[ -z ${ADYEN_MERCHANT_ACCOUNT+x} ]]; then
echo "Expected environment variables not found. Please set the ADYEN_HMAC_KEY, ADYEN_API_KEY, ADYEN_CLIENT_KEY, ADYEN_MERCHANT_ACCOUNT environment variables in https://gitpod.io/variables and restart."
exit 1
fi
dotnet run --project authorisation-adjustment-example
;;
"checkout-example")
if [ -z ${ADYEN_HMAC_KEY+x} ] || [[ -z ${ADYEN_API_KEY+x} ]] || [[ -z ${ADYEN_CLIENT_KEY+x} ]] || [[ -z ${ADYEN_MERCHANT_ACCOUNT+x} ]]; then
echo "Expected environment variables not found. Please set the ADYEN_HMAC_KEY, ADYEN_API_KEY, ADYEN_CLIENT_KEY, ADYEN_MERCHANT_ACCOUNT environment variables in https://gitpod.io/variables and restart."
exit 1
fi
dotnet run --project checkout-example
;;
"checkout-example-advanced")
if [ -z ${ADYEN_HMAC_KEY+x} ] || [[ -z ${ADYEN_API_KEY+x} ]] || [[ -z ${ADYEN_CLIENT_KEY+x} ]] || [[ -z ${ADYEN_MERCHANT_ACCOUNT+x} ]]; then
echo "Expected environment variables not found. Please set the ADYEN_HMAC_KEY, ADYEN_API_KEY, ADYEN_CLIENT_KEY, ADYEN_MERCHANT_ACCOUNT environment variables in https://gitpod.io/variables and restart."
exit 1
fi
dotnet run --project checkout-example-advanced
;;
"giftcard-example")
if [ -z ${ADYEN_HMAC_KEY+x} ] || [[ -z ${ADYEN_API_KEY+x} ]] || [[ -z ${ADYEN_CLIENT_KEY+x} ]] || [[ -z ${ADYEN_MERCHANT_ACCOUNT+x} ]]; then
echo "Expected environment variables not found. Please set the ADYEN_HMAC_KEY, ADYEN_API_KEY, ADYEN_CLIENT_KEY, ADYEN_MERCHANT_ACCOUNT environment variables in https://gitpod.io/variables and restart."
exit 1
fi
dotnet run --project giftcard-example
;;
"giving-example")
if [ -z ${ADYEN_HMAC_KEY+x} ] || [[ -z ${ADYEN_API_KEY+x} ]] || [[ -z ${ADYEN_CLIENT_KEY+x} ]] || [[ -z ${ADYEN_MERCHANT_ACCOUNT+x} ]]; then
echo "Expected environment variables not found. Please set the ADYEN_HMAC_KEY, ADYEN_API_KEY, ADYEN_CLIENT_KEY, ADYEN_MERCHANT_ACCOUNT environment variables in https://gitpod.io/variables and restart."
exit 1
fi
dotnet run --project giving-example
;;
"in-person-payments-example")
if [ -z ${ADYEN_HMAC_KEY+x} ] || [[ -z ${ADYEN_API_KEY+x} ]] || [[ -z ${ADYEN_POS_POI_ID+x} ]]; then
echo "Expected environment variables not found. Please set the ADYEN_HMAC_KEY, ADYEN_API_KEY, ADYEN_POS_POI_ID environment variables in https://gitpod.io/variables and restart."
exit 1
fi
dotnet run --project in-person-payments-example
;;
"in-person-payments-loyalty-example")
if [ -z ${ADYEN_HMAC_KEY+x} ] || [[ -z ${ADYEN_API_KEY+x} ]] || [[ -z ${ADYEN_POS_POI_ID+x} ]]; then
echo "Expected environment variables not found. Please set the ADYEN_HMAC_KEY, ADYEN_API_KEY, ADYEN_POS_POI_ID environment variables in https://gitpod.io/variables and restart."
exit 1
fi
dotnet run --project in-person-payments-loyalty-example
;;
"paybylink-example")
if [ -z ${ADYEN_HMAC_KEY+x} ] || [[ -z ${ADYEN_API_KEY+x} ]] || [[ -z ${ADYEN_MERCHANT_ACCOUNT+x} ]]; then
echo "Expected environment variables not found. Please set the ADYEN_HMAC_KEY, ADYEN_API_KEY, ADYEN_MERCHANT_ACCOUNT environment variables in https://gitpod.io/variables and restart."
exit 1
fi
dotnet run --project paybylink-example
;;
"subscription-example")
if [ -z ${ADYEN_HMAC_KEY+x} ] || [[ -z ${ADYEN_API_KEY+x} ]] || [[ -z ${ADYEN_CLIENT_KEY+x} ]] || [[ -z ${ADYEN_MERCHANT_ACCOUNT+x} ]]; then
echo "Expected environment variables not found. Please set the ADYEN_HMAC_KEY, ADYEN_API_KEY, ADYEN_CLIENT_KEY, ADYEN_MERCHANT_ACCOUNT environment variables in https://gitpod.io/variables and restart."
exit 1
fi
dotnet run --project subscription-example
;;
*)
if [ -z ${ADYEN_HMAC_KEY+x} ] || [[ -z ${ADYEN_API_KEY+x} ]] || [[ -z ${ADYEN_CLIENT_KEY+x} ]] || [[ -z ${ADYEN_MERCHANT_ACCOUNT+x} ]]; then
echo "Expected environment variables not found. Please set the ADYEN_HMAC_KEY, ADYEN_API_KEY, ADYEN_CLIENT_KEY, ADYEN_MERCHANT_ACCOUNT environment variables in https://gitpod.io/variables and restart."
exit 1
fi
echo "Starting the default checkout-example application instead because '$path' is not defined ..."
dotnet run --project checkout-example
;;
esac
ports:
- port: 8080
onOpen: open-preview
visibility: public
vscode:
extensions:
- ms-dotnettools.csharp