-
Notifications
You must be signed in to change notification settings - Fork 46
/
Copy path.gitpod.yml
79 lines (72 loc) · 3.05 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
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 JDK
echo "Installing JDK ..."
sdk install java 17.0.4.1-tem < /dev/null
echo "Build gradle for '$path' ..."
case "$path" in
"checkout-example")
echo "Build checkout-example application"
cd checkout-example && ./gradlew bootJar
;;
"checkout-example-advanced")
echo "Build checkout-example-advanced application"
cd checkout-example-advanced && ./gradlew bootJar
;;
"giftcard-example")
echo "Build giftcard-example application"
cd giftcard-example && ./gradlew bootJar
;;
"in-person-payments-example")
echo "Build in-person-payments-example application"
cd in-person-payments-example && ./gradlew bootJar
;;
"subscription-example")
echo "Build subscription-example application"
cd subscription-example && ./gradlew bootJar
;;
"giving-example")
echo "Build giving-example application"
cd giving-example && ./gradlew bootJar
;;
"paybylink-example")
echo "Build paybylink-example application"
cd paybylink-example && ./gradlew bootJar
;;
"authorisation-adjustment-example")
echo "Build authorisation-adjustment-example application"
cd authorisation-adjustment-example && ./gradlew bootJar
;;
*)
echo "Build default checkout-example application instead because '$path' is not defined ..."
cd checkout-example && ./gradlew bootJar
;;
esac
command: |
# Check if environment variables are set in https://gitpod.io/variables.
echo "Checking if environment variables are set ..."
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 and rerun session https://gitpod.io/variables."
exit 1
fi
# Run the application based on specified $path.
echo "Starting application for '$path' in $(pwd)"
./gradlew bootRun
ports:
- port: 8080
onOpen: open-preview
visibility: public
vscode:
extensions:
- redhat.java
- vscjava.vscode-java-debug
- vscjava.vscode-java-test
- pivotal.vscode-spring-boot