-
Notifications
You must be signed in to change notification settings - Fork 53
/
Copy path.gitpod.yml
80 lines (73 loc) · 2.84 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
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."
echo "npm build in $(pwd)"
case "$path" in
"checkout-example")
echo "Build checkout-example application"
cd checkout-example && npm install
;;
"checkout-example-advanced")
echo "Build checkout-example-advanced application"
cd checkout-example-advanced && npm install
;;
"authorisation-adjustment-example")
echo "Build authorisation-adjustment-example application"
cd authorisation-adjustment-example && npm install
;;
"giftcard-example")
echo "Build giftcard-example application"
cd giftcard-example && npm install
;;
"paybylink-example")
echo "Build paybylink-example application"
cd paybylink-example && npm install
;;
"subscription-example")
echo "Build subscription-example application"
cd subscription-example && npm install
;;
"in-person-payments-example")
echo "Build in-person-payments-example application"
cd in-person-payments-example && npm install
;;
"3ds2-example")
echo "Build 3DS2 application"
cd 3ds2-example/frontend && npm install
cd ../backend && npm install
cd ../ && npm install && npm run fullstack
;;
*)
echo "Build default checkout-example application instead because '$path' is not defined ..."
cd checkout-example && npm install
;;
esac
echo "npm install done."
command: |
# Check if environment variables are set in https://gitpod.io/variables.
echo "Checking if environment variables are set ..."
if [ [[ -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 and rerun session https://gitpod.io/variables."
exit 1
fi
# Run the application based on specified $path.
echo "Starting application for '$path' in $(pwd)"
npm run dev
# exposed ports
ports:
- port: 8080
onOpen: open-preview
visibility: public
- port: 3000
visibility: public
vscode:
extensions:
- esbenp.prettier-vscode
- dbaeumer.vscode-eslint