-
Notifications
You must be signed in to change notification settings - Fork 214
Expand file tree
/
Copy pathaction.yml
More file actions
118 lines (112 loc) · 3.73 KB
/
action.yml
File metadata and controls
118 lines (112 loc) · 3.73 KB
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
114
115
116
117
118
name: generate_app
description: Generate Application
inputs:
use_extensibility:
description: Use Extensibility?
project_id:
description: Project ID
instance_url:
description: Instance Url
org_id:
description: Org Id
short_code:
description: Short Code
client_id:
description: Client Id
site_id:
description: Site Id
is_private_client:
description: Is Private Client?
setup_hybrid:
description: Setup Phased Headless rollout?
project_dir:
description: Project Directory
runs:
using: composite
steps:
- name: Parse input values
id: parse_input
shell: bash
run: |
use_extensibility_input="${{ inputs.use_extensibility }}"
if [ "use_extensibility_input" = "true" ]; then
use_extensibility_value=2
else
use_extensibility_value=1
fi
echo "USE_EXTENSIBILITY_VALUE=$use_extensibility_value" >> $GITHUB_ENV
is_private_client_input="${{ inputs.is_private_client }}"
if [ "$is_private_client_input" = "true" ]; then
is_private_client_value=1
else
is_private_client_value=2
fi
echo "IS_PRIVATE_CLIENT_VALUE=$is_private_client_value" >> $GITHUB_ENV
setup_hybrid_input="${{ inputs.setup_hybrid }}"
if [ "$setup_hybrid_input" = "true" ]; then
setup_hybrid_value=2
else
setup_hybrid_value=1
fi
echo "SETUP_HYBRID_VALUE=$setup_hybrid_value" >> $GITHUB_ENV
- name: Build project generator inputs
id: build_generator_inputs
shell: bash
run: |
echo '{
"projectDir":"${{ inputs.project_dir }}",
"responses": [
{
"expectedPrompt": "Choose a project preset to get started:",
"response": "1\n"
},
{
"expectedPrompt": "Do you wish to use template extensibility?",
"response": "${{ env.USE_EXTENSIBILITY_VALUE }}\n"
},
{
"expectedPrompt": "What is the name of your Project?",
"response": "${{ inputs.project_id }}\n"
},
{
"expectedPrompt": "What is the URL for your Commerce Cloud instance?",
"response": "${{ inputs.instance_url }}\n"
},
{
"expectedPrompt": "What is your SLAS Client ID?",
"response": "${{ inputs.client_id }}\n"
},
{
"expectedPrompt": "Is your SLAS client private?",
"response":"${{ env.IS_PRIVATE_CLIENT_VALUE }}\n"
},
{
"expectedPrompt": "What is your Site ID in Business Manager?",
"response": "${{ inputs.site_id }}\n"
},
{
"expectedPrompt": "What is your Commerce API organization ID in Business Manager?",
"response": "${{ inputs.org_id }}\n"
},
{
"expectedPrompt": "What is your Commerce API short code in Business Manager?",
"response": "${{ inputs.short_code }}\n"
},
{
"expectedPrompt": "Do you wish to set up a phased headless rollout?",
"response": "${{ env.SETUP_HYBRID_VALUE }}\n"
}
] }' > generator-responses.json
- name: Generate project
id: generate_project
run: |
cat generator-responses.json
node e2e/scripts/generate-project.js --project-config "$(jq -c . generator-responses.json)"
shell: bash
- name: Build generated project
id: build_generated_project
working-directory: ../generated-projects/${{ inputs.project_dir }}
run: |-
npm ci
npm run build
shell: bash