-
Notifications
You must be signed in to change notification settings - Fork 129
[CI] Review output in CI builds #2639
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 26 commits
38e398b
3c71322
5f91789
c774108
18e885f
2c8c36f
269a449
75831b4
a5ca34a
7bf29af
df812de
93e4ff1
a314998
569ca1c
5ba8b0f
dce92ea
2bfa9d8
823cc6f
2a241b5
c5d81fa
85a83ca
9a048e1
192ba69
91303e9
7174187
9b035ed
de15917
c990503
6e33bd7
80b23a6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| is_stack_created() { | ||
| local files=0 | ||
| files=$(find ~/.elastic-package -type f -name "docker-compose.yml" | wc -l) | ||
| if [ "${files}" -gt 0 ]; then | ||
| return 0 | ||
| fi | ||
| return 1 | ||
| } | ||
|
|
||
|
Comment on lines
+5
to
+13
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Helper function to know if There could be packages that fail in This is helpful to avoid running commands like |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,10 +3,16 @@ | |
| set -euxo pipefail | ||
|
|
||
| cleanup() { | ||
| r=$? | ||
| local r=$? | ||
| if [ "${r}" -ne 0 ]; then | ||
| # Ensure that the group where the failure happened is opened. | ||
| echo "^^^ +++" | ||
| fi | ||
| echo "~~~ elastic-package cleanup" | ||
|
|
||
| # Dump stack logs | ||
| elastic-package stack dump -v --output build/elastic-stack-dump/build-zip | ||
| # Required containers could not be running, so ignore the error | ||
| elastic-package stack dump -v --output build/elastic-stack-dump/build-zip || true | ||
|
Comment on lines
+14
to
+15
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Example of the error to try to avoid: This will help to continue running the other commands in the cleanup function. |
||
|
|
||
| # Take down the stack | ||
| elastic-package stack down -v | ||
|
|
@@ -36,16 +42,21 @@ export ELASTIC_PACKAGE_LINKS_FILE_PATH | |
| go run ./scripts/gpgkey | ||
|
|
||
| for d in test/packages/*/*/; do | ||
| # Added set +x in a sub-shell to avoid printing the testype command in the output | ||
| # This helps to keep the CI output cleaner | ||
| packageTestType=$(set +x ; testype "$d") | ||
| # Packages in false_positives can have issues. | ||
| if [ "$(testype $d)" == "false_positives" ]; then | ||
| if [ "${packageTestType}" == "false_positives" ]; then | ||
| continue | ||
| fi | ||
| echo "--- Building package: ${d}" | ||
| elastic-package build -C "$d" --zip --sign -v | ||
| done | ||
|
|
||
| # Remove unzipped built packages, leave .zip files | ||
| rm -r build/packages/*/ | ||
|
|
||
| echo "--- Prepare Elastic stack" | ||
| # Boot up the stack | ||
| elastic-package stack up -d -v | ||
|
|
||
|
|
@@ -54,12 +65,13 @@ eval "$(elastic-package stack shellinit)" | |
| # Install packages from working copy | ||
| for d in test/packages/*/*/; do | ||
| # Packages in false_positives can have issues. | ||
| if [ "$(testype $d)" == "false_positives" ]; then | ||
| if [ "$(testype "$d")" == "false_positives" ]; then | ||
| continue | ||
| fi | ||
| package_name=$(yq -r '.name' "${d}/manifest.yml") | ||
| package_version=$(yq -r '.version' "${d}/manifest.yml") | ||
|
|
||
| echo "--- Installing package: ${package_name} (${package_version})" | ||
| elastic-package install -C "$d" -v | ||
|
|
||
| # check that the package is installed | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to install
yqin other targets for now.