@suffolklitlab/alkiln 5.13.0-logs2 ā 5.13.0-logs4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -1
- package/README.md +26 -5
- package/action.yml +32 -30
- package/action_for_github_server/action.yml +29 -31
- package/docs/4_environments.md +243 -0
- package/docs/artifacts_folder_name.md +135 -0
- package/docs/constrained_random_tests.md +347 -0
- package/docs/decisions/006_which_log_level_to_pick_2024_09_5.md +53 -29
- package/docs/decisions/007_getting_and_storing_logs.md +179 -0
- package/docs/decisions/move_runtime_config_to_sources_folder.md +3 -0
- package/docs/decisions/reports_and_logs_2024_08_11.md +116 -96
- package/docs/kinds_of_errors.md +26 -0
- package/docs/prioritize_constrained_random_tests.md +101 -0
- package/docs/seprate_file_generation_GitHub_action.md +11 -0
- package/lib/docassemble/docassemble_api_interface.js +39 -42
- package/lib/docassemble/server_install.js +16 -7
- package/lib/docassemble/setup.js +12 -10
- package/lib/docassemble/takedown.js +11 -8
- package/lib/run_cucumber.js +57 -26
- package/lib/scope.js +59 -14
- package/lib/steps.js +5 -5
- package/lib/utils/Log.js +982 -0
- package/lib/utils/files.js +11 -6
- package/lib/utils/reports.js +51 -13
- package/lib/utils/session_vars.js +9 -3
- package/npm-shrinkwrap.json +19 -15
- package/package.json +2 -2
- package/tests/log_codes/check_codes.sh +1 -1
- package/tests/log_codes/log_code_expected_instances.txt +23 -3
- package/tests/unit_tests/getAllFields.test.js +2 -2
- package/tests/unit_tests/getMatchingRows.test.js +2 -2
- package/tests/unit_tests/log.test.js +569 -8
- package/tests/unit_tests/normalizeTable.test.js +2 -2
- package/lib/utils/log.js +0 -489
package/CHANGELOG.md
CHANGED
|
@@ -43,7 +43,21 @@ Format:
|
|
|
43
43
|
-
|
|
44
44
|
-->
|
|
45
45
|
|
|
46
|
-
## [Unreleased]
|
|
46
|
+
<!-- ## [Unreleased] -->
|
|
47
|
+
|
|
48
|
+
## [5.13.3] - 2025-01-05
|
|
49
|
+
|
|
50
|
+
### Fixed
|
|
51
|
+
|
|
52
|
+
- Updates to latest docassemble HTML. See [#960](https://github.com/SuffolkLITLab/ALKiln/issues/960). Changes all appearances of `fieldset` to keep the code consistent.
|
|
53
|
+
|
|
54
|
+
## [5.13.2] - 2024-11-23
|
|
55
|
+
|
|
56
|
+
### Fixed
|
|
57
|
+
|
|
58
|
+
- Fixes download Step unable to use a partial filename match. The Step needed the whole name, including the extension. See [#725](https://github.com/SuffolkLITLab/ALKiln/issues/725).
|
|
59
|
+
|
|
60
|
+
## [5.13.1] - 2024-10-23
|
|
47
61
|
|
|
48
62
|
### Changed
|
|
49
63
|
|
|
@@ -52,6 +66,8 @@ Format:
|
|
|
52
66
|
### Fixed
|
|
53
67
|
|
|
54
68
|
- Detects failed sign in. Closes [#918](https://github.com/SuffolkLITLab/ALKiln/issues/918).
|
|
69
|
+
- Fixes undefined `errors` var in `After()`
|
|
70
|
+
- Closes [#924](https://github.com/SuffolkLITLab/ALKiln/issues/924), remove extra interview url print
|
|
55
71
|
|
|
56
72
|
### Internal
|
|
57
73
|
|
|
@@ -62,6 +78,11 @@ Format:
|
|
|
62
78
|
- Adds decision docs
|
|
63
79
|
- Updated CONTRIBUTING.md
|
|
64
80
|
- Added example.env, closes [#374](https://github.com/SuffolkLITLab/ALKiln/issues/374)
|
|
81
|
+
- Closes [#805](https://github.com/SuffolkLITLab/ALKiln/issues/805), create verbose-type log
|
|
82
|
+
- Closes [#659](https://github.com/SuffolkLITLab/ALKiln/issues/659), abstract adding to debug_log
|
|
83
|
+
- Closes [#925](https://github.com/SuffolkLITLab/ALKiln/issues/925), allow a `Log` to throw an error
|
|
84
|
+
- Addresses [#461](https://github.com/SuffolkLITLab/ALKiln/issues/461), setup and takedown reports
|
|
85
|
+
- Updates pdfjs-dist for node v20 and v22. See [#952](https://github.com/SuffolkLITLab/ALKiln/issues/952).
|
|
65
86
|
|
|
66
87
|
## [5.13.0] - 2024-07-11
|
|
67
88
|
|
package/README.md
CHANGED
|
@@ -41,25 +41,46 @@ Read about contributing in our [CONTRIBUTING.md document](CONTRIBUTING.md). Here
|
|
|
41
41
|
## Cheat sheet
|
|
42
42
|
|
|
43
43
|
*Once you've already read the contributing documentation, you can use these as quick reminders for running our internal tests.*
|
|
44
|
-
|
|
44
|
+
|
|
45
|
+
### `setup` before starting development of a feature/fix
|
|
46
|
+
|
|
47
|
+
Set up for the cucumber integration tests.
|
|
48
|
+
|
|
49
|
+
Add the feature branch name to your `.env` file:
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
BRANCH=42_feat_life_the_univers_and_everything
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Then create the project on the server:
|
|
45
56
|
|
|
46
57
|
```bash
|
|
47
58
|
npm run setup
|
|
48
59
|
```
|
|
49
60
|
|
|
50
|
-
|
|
61
|
+
### Run tests repeatedly
|
|
62
|
+
|
|
63
|
+
Run all cucumber tests that are not currently blocked by upstream changes:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
npm run pass
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Trigger cucumber tests with specific tags:
|
|
51
70
|
|
|
52
71
|
```bash
|
|
53
|
-
npm run cucumber
|
|
72
|
+
npm run cucumber "@tagname"
|
|
54
73
|
```
|
|
55
74
|
|
|
56
|
-
|
|
75
|
+
Run the unit tests:
|
|
57
76
|
|
|
58
77
|
```bash
|
|
59
78
|
npm run unit
|
|
60
79
|
```
|
|
61
80
|
|
|
62
|
-
|
|
81
|
+
### Always run `takedown` before running `setup` again
|
|
82
|
+
|
|
83
|
+
If you or someone else changes the interview code in our `./docassemble` directory, you have to delete the code currently on the testing server before running `setup` again. Also do this when you're done with the feature/fix or starting a new feature/fix.
|
|
63
84
|
|
|
64
85
|
```bash
|
|
65
86
|
npm run takedown
|
package/action.yml
CHANGED
|
@@ -70,18 +70,20 @@ runs:
|
|
|
70
70
|
DOCASSEMBLECLI_VERSION: ${{ inputs.DOCASSEMBLECLI_VERSION }}
|
|
71
71
|
shell: bash
|
|
72
72
|
run: |
|
|
73
|
-
log="š” ALK0023 INFO: Set environment variables"
|
|
73
|
+
log="š” ALK0023 INFO: Set environment variables and create artifacts folder"
|
|
74
74
|
|
|
75
75
|
# Human-readable date/time: https://www.shell-tips.com/linux/how-to-format-date-and-time-in-linux-macos-and-bash/#how-to-format-a-date-in-bash
|
|
76
76
|
timestamp="$(date +'%Y-%m-%d at %Hh%Mm%Ss' -u)"
|
|
77
77
|
artifact_folder="alkiln-${timestamp}UTC"
|
|
78
|
-
echo "ARTIFACT_FOLDER=$artifact_folder" >> $GITHUB_ENV
|
|
79
78
|
debug_path="${artifact_folder}/debug_log.txt"
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
mkdir -p "$artifact_path"
|
|
79
|
+
mkdir -p "$artifact_folder"
|
|
83
80
|
echo "$log" >> "$debug_path"
|
|
84
81
|
|
|
82
|
+
# Action-specific vars
|
|
83
|
+
echo "ARTIFACT_FOLDER=$artifact_folder" >> $GITHUB_ENV
|
|
84
|
+
echo "DEBUG_PATH=$debug_path" >> $GITHUB_ENV
|
|
85
|
+
|
|
86
|
+
# Required for all tests
|
|
85
87
|
echo "REPO_URL=${{ github.server_url }}/${{ github.repository }}" >> $GITHUB_ENV
|
|
86
88
|
echo "BRANCH_PATH=$BRANCH_PATH" >> $GITHUB_ENV
|
|
87
89
|
# Workflow inputs
|
|
@@ -97,9 +99,9 @@ runs:
|
|
|
97
99
|
shell: bash
|
|
98
100
|
run: |
|
|
99
101
|
log="š” ALK0024 INFO: Confirm environment variables"
|
|
100
|
-
echo -e "\n$log" >> "$DEBUG_PATH"
|
|
102
|
+
echo -e "\n$log" >> "${{ env.DEBUG_PATH }}"
|
|
101
103
|
vars_log="\nALKiln version is $ALKILN_VERSION\nRepo is $REPO_URL\nBranch ref is $BRANCH_PATH\nMAX_SECONDS_FOR_SETUP is $MAX_SECONDS_FOR_SETUP\nSERVER_RELOAD_TIMEOUT_SECONDS is $SERVER_RELOAD_TIMEOUT_SECONDS\n"
|
|
102
|
-
echo -e "$vars_log" >> "$DEBUG_PATH" && echo -e "$vars_log"
|
|
104
|
+
echo -e "$vars_log" >> "${{ env.DEBUG_PATH }}" && echo -e "$vars_log"
|
|
103
105
|
|
|
104
106
|
# Install
|
|
105
107
|
- name: "š” ALK0025 INFO: Set up node"
|
|
@@ -110,7 +112,7 @@ runs:
|
|
|
110
112
|
shell: bash
|
|
111
113
|
run: |
|
|
112
114
|
log="š” ALK0026 INFO: Install ALKiln directly from npm"
|
|
113
|
-
echo -e "\n$log" >> "$DEBUG_PATH"
|
|
115
|
+
echo -e "\n$log" >> "${{ env.DEBUG_PATH }}"
|
|
114
116
|
npm install -g "@suffolklitlab/alkiln@$ALKILN_VERSION"
|
|
115
117
|
|
|
116
118
|
# Install on playground
|
|
@@ -125,16 +127,16 @@ runs:
|
|
|
125
127
|
shell: bash
|
|
126
128
|
run: |
|
|
127
129
|
log="š” ALK0027 INFO: Create a Project and install the package from GitHub"
|
|
128
|
-
echo -e "\n$log" >> "$DEBUG_PATH"
|
|
130
|
+
echo -e "\n$log" >> "${{ env.DEBUG_PATH }}"
|
|
129
131
|
pip install "docassemblecli==$DOCASSEMBLECLI_VERSION"
|
|
130
|
-
alkiln-setup --path="$ARTIFACT_FOLDER"
|
|
132
|
+
alkiln-setup --path="${{ env.ARTIFACT_FOLDER }}"
|
|
131
133
|
- name: "š¤ ALK0028 ERROR: Unable to create a Project"
|
|
132
134
|
if: ${{ inputs.INSTALL_METHOD == 'playground' && failure() }}
|
|
133
135
|
shell: bash
|
|
134
136
|
run: |
|
|
135
137
|
# "š¤ ALK0028 ERROR: Unable to create a Project"
|
|
136
138
|
long_log="\n\nāāā\nš¤ ALK0028 ERROR: Unable to create a Project on your server's testing account or pull your package into it. Check the messages above this line.\n\n"
|
|
137
|
-
echo -e "$long_log" >> "$DEBUG_PATH" && echo -e "$long_log"
|
|
139
|
+
echo -e "$long_log" >> "${{ env.DEBUG_PATH }}" && echo -e "$long_log"
|
|
138
140
|
|
|
139
141
|
# Server installations - find folders and save session vars
|
|
140
142
|
- name: "š” ALK0029 INFO: Install the GitHub package onto the server"
|
|
@@ -142,14 +144,14 @@ runs:
|
|
|
142
144
|
shell: bash
|
|
143
145
|
run: |
|
|
144
146
|
log="š” ALK0029 INFO: Install the GitHub package onto the server"
|
|
145
|
-
echo -e "\n$log" >> "$DEBUG_PATH"
|
|
146
|
-
alkiln-server-install --path="$ARTIFACT_FOLDER"
|
|
147
|
+
echo -e "\n$log" >> "${{ env.DEBUG_PATH }}"
|
|
148
|
+
alkiln-server-install --path="${{ env.ARTIFACT_FOLDER }}"
|
|
147
149
|
- name: "š¤ ALK0030 ERROR: Unable to install the package"
|
|
148
150
|
if: ${{ inputs.INSTALL_METHOD == 'server' && failure() }}
|
|
149
151
|
shell: bash
|
|
150
152
|
run: |
|
|
151
153
|
log="\n\nāāā\nš¤ ALK0030 ERROR: Unable to install the package on the temporary GitHub docassemble server. Check the steps above this line.\n\n"
|
|
152
|
-
echo -e "$log" >> "$DEBUG_PATH" && echo -e "$log"
|
|
154
|
+
echo -e "$log" >> "${{ env.DEBUG_PATH }}" && echo -e "$log"
|
|
153
155
|
|
|
154
156
|
# run tests
|
|
155
157
|
- name: "š” ALK0031 INFO: Run tests"
|
|
@@ -159,8 +161,8 @@ runs:
|
|
|
159
161
|
shell: bash
|
|
160
162
|
run: |
|
|
161
163
|
log="š” ALK0031 INFO: Run tests"
|
|
162
|
-
echo -e "\n$log" >> "$DEBUG_PATH"
|
|
163
|
-
alkiln-run "$ALKILN_TAG_EXPRESSION" --path="$ARTIFACT_FOLDER"
|
|
164
|
+
echo -e "\n$log" >> "${{ env.DEBUG_PATH }}"
|
|
165
|
+
alkiln-run "$ALKILN_TAG_EXPRESSION" --path="${{ env.ARTIFACT_FOLDER }}"
|
|
164
166
|
|
|
165
167
|
# on playground, delete project
|
|
166
168
|
- name: "š” ALK0032 INFO: Delete the Project from the Playground"
|
|
@@ -168,8 +170,8 @@ runs:
|
|
|
168
170
|
shell: bash
|
|
169
171
|
run: |
|
|
170
172
|
log="š” ALK0032 INFO: Delete the Project from the Playground"
|
|
171
|
-
echo -e "\n$log" >> "$DEBUG_PATH"
|
|
172
|
-
alkiln-takedown --path="$ARTIFACT_FOLDER"
|
|
173
|
+
echo -e "\n$log" >> "${{ env.DEBUG_PATH }}"
|
|
174
|
+
alkiln-takedown --path="${{ env.ARTIFACT_FOLDER }}"
|
|
173
175
|
|
|
174
176
|
# Upload artifacts that subscribers can download on the Actions summary page
|
|
175
177
|
- name: "š” ALK0033 INFO: Upload artifacts folder"
|
|
@@ -192,16 +194,16 @@ runs:
|
|
|
192
194
|
shell: bash
|
|
193
195
|
run: |
|
|
194
196
|
log="š” ALK0184 INFO: Prepare ALKiln output file paths"
|
|
195
|
-
echo -e "\n$log" >> "$DEBUG_PATH" && echo "$log"
|
|
197
|
+
echo -e "\n$log" >> "${{ env.DEBUG_PATH }}" && echo "$log"
|
|
196
198
|
|
|
197
199
|
FOLDER=$(ls -d */ | grep -E '^alkiln-*' || true)
|
|
198
200
|
|
|
199
201
|
log_folder="Test results artifacts folder is $FOLDER"
|
|
200
|
-
echo -e "\n$log_folder" >> "$DEBUG_PATH" && echo "$log_folder"
|
|
202
|
+
echo -e "\n$log_folder" >> "${{ env.DEBUG_PATH }}" && echo "$log_folder"
|
|
201
203
|
|
|
202
204
|
if [[ "$FOLDER" = "" ]]; then
|
|
203
205
|
log_missing="Artifacts folder is missing. The path is an empty string: '$FOLDER'"
|
|
204
|
-
echo -e "\n$log_missing" >> "$DEBUG_PATH" && echo "$log_missing"
|
|
206
|
+
echo -e "\n$log_missing" >> "${{ env.DEBUG_PATH }}" && echo "$log_missing"
|
|
205
207
|
|
|
206
208
|
else
|
|
207
209
|
REPORT_PATH="${FOLDER}report.txt"
|
|
@@ -210,30 +212,30 @@ runs:
|
|
|
210
212
|
DEBUG_LOG_PATH="${FOLDER}debug_log.txt"
|
|
211
213
|
|
|
212
214
|
if [ -f "$REPORT_PATH" ]; then
|
|
213
|
-
echo -e "\n$REPORT_PATH exists" >> "$DEBUG_PATH" && echo "$REPORT_PATH exists"
|
|
215
|
+
echo -e "\n$REPORT_PATH exists" >> "${{ env.DEBUG_PATH }}" && echo "$REPORT_PATH exists"
|
|
214
216
|
else
|
|
215
|
-
echo -e "\n$REPORT_PATH is missing" >> "$DEBUG_PATH" && echo "$REPORT_PATH is missing"
|
|
217
|
+
echo -e "\n$REPORT_PATH is missing" >> "${{ env.DEBUG_PATH }}" && echo "$REPORT_PATH is missing"
|
|
216
218
|
REPORT_PATH=""
|
|
217
219
|
fi
|
|
218
220
|
|
|
219
221
|
if [ -f "$REPORT_LOG_PATH" ]; then
|
|
220
|
-
echo -e "\n$REPORT_LOG_PATH exists" >> "$DEBUG_PATH" && echo "$REPORT_LOG_PATH exists"
|
|
222
|
+
echo -e "\n$REPORT_LOG_PATH exists" >> "${{ env.DEBUG_PATH }}" && echo "$REPORT_LOG_PATH exists"
|
|
221
223
|
else
|
|
222
|
-
echo -e "\n$REPORT_LOG_PATH is missing" >> "$DEBUG_PATH" && echo "$REPORT_LOG_PATH is missing"
|
|
224
|
+
echo -e "\n$REPORT_LOG_PATH is missing" >> "${{ env.DEBUG_PATH }}" && echo "$REPORT_LOG_PATH is missing"
|
|
223
225
|
REPORT_LOG_PATH=""
|
|
224
226
|
fi
|
|
225
227
|
|
|
226
228
|
if [ -f "$UNEXPECTED_RESULTS_PATH" ]; then
|
|
227
|
-
echo -e "\n$UNEXPECTED_RESULTS_PATH exists" >> "$DEBUG_PATH" && echo "$UNEXPECTED_RESULTS_PATH exists"
|
|
229
|
+
echo -e "\n$UNEXPECTED_RESULTS_PATH exists" >> "${{ env.DEBUG_PATH }}" && echo "$UNEXPECTED_RESULTS_PATH exists"
|
|
228
230
|
else
|
|
229
|
-
echo -e "\n$UNEXPECTED_RESULTS_PATH is missing" >> "$DEBUG_PATH" && echo "$UNEXPECTED_RESULTS_PATH is missing"
|
|
231
|
+
echo -e "\n$UNEXPECTED_RESULTS_PATH is missing" >> "${{ env.DEBUG_PATH }}" && echo "$UNEXPECTED_RESULTS_PATH is missing"
|
|
230
232
|
UNEXPECTED_RESULTS_PATH=""
|
|
231
233
|
fi
|
|
232
234
|
|
|
233
235
|
if [ -f "$DEBUG_LOG_PATH" ]; then
|
|
234
|
-
echo -e "\n$DEBUG_LOG_PATH exists" >> "$DEBUG_PATH" && echo "$DEBUG_LOG_PATH exists"
|
|
236
|
+
echo -e "\n$DEBUG_LOG_PATH exists" >> "${{ env.DEBUG_PATH }}" && echo "$DEBUG_LOG_PATH exists"
|
|
235
237
|
else
|
|
236
|
-
echo -e "\n$DEBUG_LOG_PATH is missing" >> "$DEBUG_PATH" && echo "$DEBUG_LOG_PATH is missing"
|
|
238
|
+
echo -e "\n$DEBUG_LOG_PATH is missing" >> "${{ env.DEBUG_PATH }}" && echo "$DEBUG_LOG_PATH is missing"
|
|
237
239
|
DEBUG_LOG_PATH=""
|
|
238
240
|
fi
|
|
239
241
|
|
|
@@ -252,4 +254,4 @@ runs:
|
|
|
252
254
|
if: ${{ always() }}
|
|
253
255
|
run: |
|
|
254
256
|
log="š” ALK0034 INFO: ALkiln finished running tests. See above for more details."
|
|
255
|
-
echo -e "\n$log" >> "$DEBUG_PATH" && echo "$log"
|
|
257
|
+
echo -e "\n$log" >> "${{ env.DEBUG_PATH }}" && echo "$log"
|
|
@@ -48,29 +48,27 @@ runs:
|
|
|
48
48
|
- uses: actions/checkout@v4
|
|
49
49
|
|
|
50
50
|
- shell: bash
|
|
51
|
-
if: ${{ always() && env.OUTPUT_DOCKER == 'true' }}
|
|
52
|
-
name: "š” ALK0018 INFO: Create artifact paths with date and time"
|
|
53
51
|
run: |
|
|
54
52
|
log="š” ALK0018 INFO: Get path names with date and time"
|
|
55
53
|
timestamp="$(date +'%Y-%m-%d at %Hh%Mm%Ss' -u)"
|
|
56
54
|
debug_dir="/tmp"
|
|
57
55
|
debug_path="$debug_dir/alkiln_docker_logs-${timestamp}UTC.txt"
|
|
58
|
-
|
|
56
|
+
artifact_folder="alkiln_github_server-${timestamp}UTC"
|
|
59
57
|
|
|
60
58
|
mkdir -p "$debug_dir"
|
|
61
|
-
mkdir -p "$
|
|
59
|
+
mkdir -p "$artifact_folder"
|
|
62
60
|
echo -e "$log" >> "$debug_path"
|
|
63
61
|
|
|
64
|
-
echo "DEBUG_PATH=$debug_path" >>
|
|
65
|
-
echo "GITHUB_SERVER_ARTIFACT_NAME=$
|
|
62
|
+
echo "DEBUG_PATH=$debug_path" >> $GITHUB_ENV
|
|
63
|
+
echo "GITHUB_SERVER_ARTIFACT_NAME=$artifact_folder" >> $GITHUB_ENV
|
|
66
64
|
|
|
67
65
|
- shell: bash
|
|
68
66
|
env:
|
|
69
67
|
MAX_SECONDS_FOR_DOCKER: ${{ inputs.MAX_SECONDS_FOR_DOCKER }}
|
|
70
68
|
DOCASSEMBLECLI_VERSION: ${{ inputs.DOCASSEMBLECLI_VERSION }}
|
|
71
69
|
run: |
|
|
72
|
-
log="š”ALK0001 INFO: Set environment variables"
|
|
73
|
-
echo -e "\n$log" >> "$DEBUG_PATH
|
|
70
|
+
log="š” ALK0001 INFO: Set environment variables"
|
|
71
|
+
echo -e "\n$log" >> "${{ env.DEBUG_PATH }}"
|
|
74
72
|
|
|
75
73
|
echo "MAX_SECONDS_FOR_DOCKER=$MAX_SECONDS_FOR_DOCKER" >> $GITHUB_ENV
|
|
76
74
|
echo "DOCASSEMBLECLI_VERSION=$DOCASSEMBLECLI_VERSION" >> $GITHUB_ENV
|
|
@@ -83,7 +81,7 @@ runs:
|
|
|
83
81
|
shell: bash
|
|
84
82
|
run: |
|
|
85
83
|
log="š” ALK0002 INFO: Create GitHub step output variables"
|
|
86
|
-
echo -e "\n$log" >> "$DEBUG_PATH"
|
|
84
|
+
echo -e "\n$log" >> "${{ env.DEBUG_PATH }}"
|
|
87
85
|
echo "DOCASSEMBLE_DEVELOPER_API_KEY=$DA_ADMIN_API_KEY" >> "$GITHUB_OUTPUT"
|
|
88
86
|
echo "DA_ADMIN_EMAIL=$DA_ADMIN_EMAIL" >> "$GITHUB_OUTPUT"
|
|
89
87
|
echo "DA_ADMIN_PASSWORD=$DA_ADMIN_PASSWORD" >> "$GITHUB_OUTPUT"
|
|
@@ -94,19 +92,19 @@ runs:
|
|
|
94
92
|
shell: bash
|
|
95
93
|
run: |
|
|
96
94
|
log="š” ALK0003 INFO: Get config"
|
|
97
|
-
echo -e "\n$log" >> "$DEBUG_PATH"
|
|
95
|
+
echo -e "\n$log" >> "${{ env.DEBUG_PATH }}"
|
|
98
96
|
|
|
99
97
|
mkdir /tmp/config
|
|
100
98
|
# Worth making this silent by defining a variable with > /dev/null...?
|
|
101
99
|
if [ -n "$CONFIG" ]
|
|
102
100
|
then
|
|
103
101
|
log2="š” ALK0004 INFO: The developer did provide a custom docassemble config file as an input into this action."
|
|
104
|
-
echo -e "\n$log2" >> "$DEBUG_PATH" echo "$log2"
|
|
102
|
+
echo -e "\n$log2" >> "${{ env.DEBUG_PATH }}" echo "$log2"
|
|
105
103
|
echo "$CONFIG" > /tmp/config/myconfig.yml
|
|
106
104
|
echo "CONFIG_ARGS=--env DA_CONFIG=/tmp/config/myconfig.yml --volume /tmp/config:/tmp/config " >> $GITHUB_ENV
|
|
107
105
|
else
|
|
108
106
|
log3="š” ALK0005 INFO: The developer did NOT provide a custom docassemble config file as an input into this action. Docassemble will use its default config."
|
|
109
|
-
echo -e "\n$log3" >> "$DEBUG_PATH" echo "$log3"
|
|
107
|
+
echo -e "\n$log3" >> "${{ env.DEBUG_PATH }}" echo "$log3"
|
|
110
108
|
echo "CONFIG_ARGS=" >> $GITHUB_ENV
|
|
111
109
|
fi
|
|
112
110
|
|
|
@@ -122,13 +120,13 @@ runs:
|
|
|
122
120
|
shell: bash
|
|
123
121
|
run: |
|
|
124
122
|
log="š” ALK0006 INFO: Determine docker logs visibility"
|
|
125
|
-
echo -e "\n$log" >> "$DEBUG_PATH"
|
|
123
|
+
echo -e "\n$log" >> "${{ env.DEBUG_PATH }}"
|
|
126
124
|
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
|
|
127
125
|
echo "OUTPUT_DOCKER=$SHOW_DOCKER_OUTPUT" >> $GITHUB_ENV
|
|
128
|
-
echo -e "\n$SHOW_DOCKER_OUTPUT" >> "$DEBUG_PATH"
|
|
126
|
+
echo -e "\n$SHOW_DOCKER_OUTPUT" >> "${{ env.DEBUG_PATH }}"
|
|
129
127
|
else
|
|
130
128
|
echo "OUTPUT_DOCKER=false" >> $GITHUB_ENV
|
|
131
|
-
echo -e "\nfalse" >> "$DEBUG_PATH"
|
|
129
|
+
echo -e "\nfalse" >> "${{ env.DEBUG_PATH }}"
|
|
132
130
|
fi
|
|
133
131
|
|
|
134
132
|
# Messages about output
|
|
@@ -138,14 +136,14 @@ runs:
|
|
|
138
136
|
run: |
|
|
139
137
|
# š” ALK0007 INFO: ALKiln will now hide docker output
|
|
140
138
|
log="===\nš” ALK0007 INFO: ALKiln will now hide docker output to avoid possibly showing details about your config. If you want to get output to see more of what is going on, use \"with:\" and set the input \"SHOW_DOCKER_OUTPUT\" to \"true\". This output will only be visible to those who can already see the action output, like people with admin or write permissions.\n==="
|
|
141
|
-
echo -e "\n$log" >> "$DEBUG_PATH" && echo -e "$log"
|
|
139
|
+
echo -e "\n$log" >> "${{ env.DEBUG_PATH }}" && echo -e "$log"
|
|
142
140
|
- name: "š” ALK0008 INFO: ALKiln will show docker output"
|
|
143
141
|
if: ${{ env.OUTPUT_DOCKER == 'true' }}
|
|
144
142
|
shell: bash
|
|
145
143
|
run: |
|
|
146
144
|
# š” ALK0008 INFO: ALKiln will show docker output
|
|
147
145
|
log="===\nš” ALK0008 INFO: ALKiln will show docker output. ALKiln cannot control this output. If you want to prevent output, use \"with:\" and set the input \"SHOW_DOCKER_OUTPUT\" to \"false\". This output will only be visible to those who can already see the action output, like people with admin or write permissions.\n==="
|
|
148
|
-
echo -e "\n$log" >> "$DEBUG_PATH" && echo -e "$log"
|
|
146
|
+
echo -e "\n$log" >> "${{ env.DEBUG_PATH }}" && echo -e "$log"
|
|
149
147
|
|
|
150
148
|
# TODO: Reduce these to 1 block by putting ` > /dev/null 2>&1` into an env var
|
|
151
149
|
# No docker output
|
|
@@ -156,13 +154,13 @@ runs:
|
|
|
156
154
|
shell: bash
|
|
157
155
|
run: |
|
|
158
156
|
log="š” ALK0009 INFO: Download and start docker silently"
|
|
159
|
-
echo -e "\n$log" >> "$DEBUG_PATH"
|
|
157
|
+
echo -e "\n$log" >> "${{ env.DEBUG_PATH }}"
|
|
160
158
|
docker pull jhpyle/docassemble > /dev/null 2>&1
|
|
161
159
|
docker run --name docassemble_container \
|
|
162
160
|
--env DA_ADMIN_EMAIL="$DA_ADMIN_EMAIL" \
|
|
163
161
|
--env DA_ADMIN_PASSWORD="$DA_ADMIN_PASSWORD" \
|
|
164
162
|
--env DA_ADMIN_API_KEY="$DA_ADMIN_API_KEY" \
|
|
165
|
-
|
|
163
|
+
$CONFIG_ARGS \
|
|
166
164
|
--cap-add SYS_PTRACE \
|
|
167
165
|
--memory="4gb" -d -p 80:80 jhpyle/docassemble > /dev/null 2>&1
|
|
168
166
|
# With output
|
|
@@ -173,13 +171,13 @@ runs:
|
|
|
173
171
|
shell: bash
|
|
174
172
|
run: |
|
|
175
173
|
log="š” ALK0010 INFO: Download and start docker"
|
|
176
|
-
echo -e "\n$log" >> "$DEBUG_PATH"
|
|
174
|
+
echo -e "\n$log" >> "${{ env.DEBUG_PATH }}"
|
|
177
175
|
docker pull jhpyle/docassemble
|
|
178
176
|
docker run --name docassemble_container \
|
|
179
177
|
--env DA_ADMIN_EMAIL="$DA_ADMIN_EMAIL" \
|
|
180
178
|
--env DA_ADMIN_PASSWORD="$DA_ADMIN_PASSWORD" \
|
|
181
179
|
--env DA_ADMIN_API_KEY="$DA_ADMIN_API_KEY" \
|
|
182
|
-
|
|
180
|
+
$CONFIG_ARGS \
|
|
183
181
|
--cap-add SYS_PTRACE \
|
|
184
182
|
--memory="4gb" -d -p 80:80 jhpyle/docassemble
|
|
185
183
|
|
|
@@ -191,13 +189,13 @@ runs:
|
|
|
191
189
|
run: |
|
|
192
190
|
# š” ALK0011 INFO: The following messages are not docker output
|
|
193
191
|
log="š” ALK0011 INFO: The following messages are NOT docker output, just ALKiln waiting for the server to start"
|
|
194
|
-
echo -e "\n$log" >> "$DEBUG_PATH" && echo -e "$log"
|
|
192
|
+
echo -e "\n$log" >> "${{ env.DEBUG_PATH }}" && echo -e "$log"
|
|
195
193
|
|
|
196
194
|
- name: "š” ALK0012 INFO: Waiting for server to start"
|
|
197
195
|
shell: bash
|
|
198
196
|
run: |
|
|
199
197
|
log="š” ALK0012 INFO: Waiting for server to start"
|
|
200
|
-
echo -e "\n$log" >> "$DEBUG_PATH"
|
|
198
|
+
echo -e "\n$log" >> "${{ env.DEBUG_PATH }}"
|
|
201
199
|
|
|
202
200
|
# Reset the SECONDS variable
|
|
203
201
|
SECONDS=0
|
|
@@ -207,27 +205,27 @@ runs:
|
|
|
207
205
|
response="start"
|
|
208
206
|
while [[ $response != *"200"* ]]; do
|
|
209
207
|
log2="š” ALK0013 INFO: Time elapsed: $SECONDS seconds"
|
|
210
|
-
echo -e "\n$log2" >> "$DEBUG_PATH" && echo -e "$log2"
|
|
208
|
+
echo -e "\n$log2" >> "${{ env.DEBUG_PATH }}" && echo -e "$log2"
|
|
211
209
|
|
|
212
210
|
# Check if max seconds till loading has passed
|
|
213
211
|
if [[ $SECONDS -ge $MAX_SECONDS_FOR_DOCKER ]]; then
|
|
214
212
|
log3="š¤ ALK0014 ERROR: Timed out waiting for docker container to serve the site. If you want to give your docker container more timem to install, set the MAX_SECONDS_FOR_DOCKER input for this action."
|
|
215
|
-
echo -e "\n$log3" >> "$DEBUG_PATH" && echo -e "$log3"
|
|
213
|
+
echo -e "\n$log3" >> "${{ env.DEBUG_PATH }}" && echo -e "$log3"
|
|
216
214
|
exit 1
|
|
217
215
|
fi
|
|
218
216
|
|
|
219
217
|
# Set the variable to a new string value in each iteration
|
|
220
218
|
response=$(curl -o /dev/null -s -w "%{http_code}\n" http://localhost:80/health_check?ready=1)
|
|
221
219
|
log4="š” ALK0015 INFO: Response is $response"
|
|
222
|
-
echo -e "\n$log4" >> "$DEBUG_PATH" && echo -e "$log4"
|
|
220
|
+
echo -e "\n$log4" >> "${{ env.DEBUG_PATH }}" && echo -e "$log4"
|
|
223
221
|
|
|
224
222
|
# Check if the string includes the desired text
|
|
225
223
|
if [[ $response == *"200"* ]]; then
|
|
226
224
|
log5="š” ALK0016 SUCCESS: Success! The docker container is ready!"
|
|
227
|
-
echo -e "\n$log5" >> "$DEBUG_PATH" && echo -e "$log5"
|
|
225
|
+
echo -e "\n$log5" >> "${{ env.DEBUG_PATH }}" && echo -e "$log5"
|
|
228
226
|
else
|
|
229
227
|
log6="š” ALK0017 INFO: The docker container is not ready yet. Will check again in 30 seconds."
|
|
230
|
-
echo -e "\n$log6" >> "$DEBUG_PATH" && echo -e "$log6"
|
|
228
|
+
echo -e "\n$log6" >> "${{ env.DEBUG_PATH }}" && echo -e "$log6"
|
|
231
229
|
sleep 30
|
|
232
230
|
fi
|
|
233
231
|
|
|
@@ -262,7 +260,7 @@ runs:
|
|
|
262
260
|
shell: bash
|
|
263
261
|
run: |
|
|
264
262
|
log="š” ALK0019 INFO: Create docker artifact data"
|
|
265
|
-
echo -e "\n$log" >> "$DEBUG_PATH"
|
|
263
|
+
echo -e "\n$log" >> "${{ env.DEBUG_PATH }}"
|
|
266
264
|
echo "$(docker output docassemble_container)" >> "${{ env.DEBUG_PATH }}"
|
|
267
265
|
- name: "š” ALK0020 INFO: Upload artifacts folder"
|
|
268
266
|
if: ${{ always() && env.OUTPUT_DOCKER == 'true' }}
|
|
@@ -275,10 +273,10 @@ runs:
|
|
|
275
273
|
if: ${{ success() }}
|
|
276
274
|
run: |
|
|
277
275
|
log="š” ALK0021 SUCCESS: ALKiln created the docker container and started the server!"
|
|
278
|
-
echo -e "\n$log" >> "$DEBUG_PATH" && echo -e "$log"
|
|
276
|
+
echo -e "\n$log" >> "${{ env.DEBUG_PATH }}" && echo -e "$log"
|
|
279
277
|
|
|
280
278
|
- shell: bash
|
|
281
279
|
if: ${{ failure() }}
|
|
282
280
|
run: |
|
|
283
281
|
log="š¤ ALK0022 ERROR: Something went wrong. See above for more details."
|
|
284
|
-
echo -e "\n$log" >> "$DEBUG_PATH" && echo -e "$log"
|
|
282
|
+
echo -e "\n$log" >> "${{ env.DEBUG_PATH }}" && echo -e "$log"
|