Skip to content
This repository has been archived by the owner on Sep 17, 2024. It is now read-only.

chore: simplify release process on Jenkins #980

Merged
merged 7 commits into from
Apr 2, 2021

Conversation

mdelapenya
Copy link
Contributor

What does this PR do?

As a consequence of #977, this PR:

  • Extends goreleaser configuration with release info. This will allow the creation of a Github release for the current git tag, also uploading /dist contents to the new Github release.
  • Removes the parallel branch to build the binaries for multiple platforms when git tags are pushed to Github, and the custom metadata file used to branch the release process.
  • Instead of using the convenient-for-local-development make build command on Jenkins, it uses an inline script to execute goreleaser (See https://goreleaser.com/ci/jenkins/).
  • The Jenkins script is performed within a retry block to improve the reliability when downloading the script.
  • It will make sure the /dist directory is empty, passing --rm-dist flags to the inline script.
  • It will set the Github token, reading it from Jenkins credentials, so that the Github release can be pushed.

Why is it important?

This PR makes sure goreleaser is installed in the worker, and in an up-to-date version. Finally, it automates the creation of new releases on Github.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have run the Unit tests for the CLI, and they are passing locally
  • I have run the End-2-End tests for the suite I'm working on, and they are passing locally
  • I have noticed new Go dependencies (run make notice in the proper directory)

Related issues

@mdelapenya mdelapenya self-assigned this Apr 1, 2021
@mdelapenya mdelapenya requested a review from a team April 1, 2021 08:02
@elasticmachine
Copy link
Contributor

💔 Tests Failed

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: Pull request #980 opened

  • Start Time: 2021-04-01T08:04:41.000+0000

  • Duration: 81 min 58 sec

  • Commit: feef7ca

Test stats 🧪

Test Results
Failed 2
Passed 134
Skipped 0
Total 136

Trends 🧪

Image of Build Times

Image of Tests

Test errors 2

Expand to view the tests failures

Initializing / End-To-End Tests / ubuntu-18.04_fleet_stand_alone_agent / Deploying a default stand-alone agent with fleet server mode – Stand-alone Agent
    Expand to view the error details

     Step the agent is listed in Fleet as "online": The agent is not present in Fleet, but it should 
    

  • no stacktrace
Initializing / End-To-End Tests / ubuntu-18.04_fleet_fleet_mode_agent / Un-installing the installed centos agent – Fleet Mode Agent
    Expand to view the error details

     Step the agent is listed in Fleet as "offline": The Agent is not in the offline status yet 
    

  • no stacktrace

Steps errors 2

Expand to view the steps failures

Run functional tests for fleet:fleet_mode_agent && ~@nightly && ~debian
  • Took 19 min 45 sec . View more details on here
  • Description: .ci/scripts/functional-test.sh "fleet" "fleet_mode_agent && ~@nightly && ~debian" "8.0.0-SNAPSHOT" "8.0.0-SNAPSHOT"
Run functional tests for fleet:stand_alone_agent && ~@nightly && ~ubi8
  • Took 17 min 4 sec . View more details on here
  • Description: .ci/scripts/functional-test.sh "fleet" "stand_alone_agent && ~@nightly && ~ubi8" "8.0.0-SNAPSHOT" "8.0.0-SNAPSHOT"

Log output

Expand to view the last 100 lines of log output

[2021-04-01T09:18:09.244Z] + REPORT=/var/lib/jenkins/workspace/PR-980-1-e41d4525-4537-447f-93f7-e133e1915587/src/github.com/elastic/e2e-testing/outputs/TEST-metricbeat
[2021-04-01T09:18:09.244Z] + SUITE=metricbeat
[2021-04-01T09:18:09.244Z] + TAGS='integrations && redisenterprise && ~@nightly'
[2021-04-01T09:18:09.244Z] + FORMAT=junit:/var/lib/jenkins/workspace/PR-980-1-e41d4525-4537-447f-93f7-e133e1915587/src/github.com/elastic/e2e-testing/outputs/TEST-metricbeat.xml
[2021-04-01T09:18:09.244Z] + STACK_VERSION=8.0.0-SNAPSHOT
[2021-04-01T09:18:09.244Z] + BEAT_VERSION=8.0.0-SNAPSHOT
[2021-04-01T09:18:09.244Z] + make --no-print-directory -C e2e functional-test
[2021-04-01T09:18:09.244Z] go get -v github.com/cucumber/godog/cmd/[email protected]
[2021-04-01T09:18:09.244Z] go: downloading github.com/cucumber/godog v0.11.0
[2021-04-01T09:18:09.244Z] go: found github.com/cucumber/godog/cmd/godog in github.com/cucumber/godog v0.11.0
[2021-04-01T09:18:09.244Z] go: downloading github.com/inconshreveable/mousetrap v1.0.0
[2021-04-01T09:18:09.244Z] go: downloading github.com/cucumber/messages-go/v10 v10.0.3
[2021-04-01T09:18:09.244Z] go: downloading github.com/cucumber/gherkin-go/v11 v11.0.0
[2021-04-01T09:18:09.244Z] go: downloading github.com/hashicorp/go-memdb v1.3.0
[2021-04-01T09:18:09.244Z] go: downloading github.com/gofrs/uuid v3.3.0+incompatible
[2021-04-01T09:18:09.244Z] go: downloading github.com/hashicorp/go-immutable-radix v1.3.0
[2021-04-01T09:18:09.244Z] go: downloading github.com/hashicorp/golang-lru v0.5.4
[2021-04-01T09:18:09.244Z] github.com/hashicorp/golang-lru/simplelru
[2021-04-01T09:18:09.244Z] github.com/cucumber/godog/internal/utils
[2021-04-01T09:18:09.244Z] github.com/cucumber/godog/colors
[2021-04-01T09:18:09.244Z] github.com/gofrs/uuid
[2021-04-01T09:18:09.244Z] github.com/cucumber/godog/internal/builder
[2021-04-01T09:18:09.244Z] github.com/cucumber/godog/internal/flags
[2021-04-01T09:18:09.244Z] github.com/gogo/protobuf/io
[2021-04-01T09:18:09.244Z] github.com/hashicorp/go-immutable-radix
[2021-04-01T09:18:09.244Z] github.com/cucumber/messages-go/v10
[2021-04-01T09:18:09.244Z] github.com/hashicorp/go-memdb
[2021-04-01T09:18:09.244Z] github.com/cucumber/godog/formatters
[2021-04-01T09:18:09.244Z] github.com/cucumber/godog/internal/tags
[2021-04-01T09:18:09.244Z] github.com/cucumber/gherkin-go/v11
[2021-04-01T09:18:09.244Z] github.com/cucumber/godog/internal/models
[2021-04-01T09:18:09.244Z] github.com/cucumber/godog/internal/storage
[2021-04-01T09:18:09.244Z] github.com/cucumber/godog/internal/formatters
[2021-04-01T09:18:09.244Z] github.com/cucumber/godog/internal/parser
[2021-04-01T09:18:09.244Z] github.com/cucumber/godog
[2021-04-01T09:18:09.244Z] github.com/cucumber/godog/cmd/godog/internal
[2021-04-01T09:18:09.244Z] github.com/cucumber/godog/cmd/godog
[2021-04-01T09:18:09.507Z] cd _suites/metricbeat && \
[2021-04-01T09:18:09.507Z] OP_LOG_LEVEL=DEBUG \
[2021-04-01T09:18:09.507Z] OP_LOG_INCLUDE_TIMESTAMP=TRUE \
[2021-04-01T09:18:09.507Z] TIMEOUT_FACTOR=5 \
[2021-04-01T09:18:09.507Z] STACK_VERSION=8.0.0-SNAPSHOT \
[2021-04-01T09:18:09.507Z] DEVELOPER_MODE=false \
[2021-04-01T09:18:09.507Z] ELASTIC_APM_SERVICE_NAME="E2E Tests" \
[2021-04-01T09:18:09.507Z] ELASTIC_APM_CENTRAL_CONFIG="false" \
[2021-04-01T09:18:09.507Z] ELASTIC_APM_GLOBAL_LABELS=build_pr=true,build_id=1 \
[2021-04-01T09:18:09.507Z] ELASTIC_APM_SERVICE_VERSION="8.0.0-SNAPSHOT" \
[2021-04-01T09:18:09.507Z] ELASTIC_APM_ENVIRONMENT="ci" \
[2021-04-01T09:18:09.507Z] ELASTIC_APM_SECRET_TOKEN="********" \
[2021-04-01T09:18:09.507Z] ELASTIC_APM_SERVER_URL="********" \
[2021-04-01T09:18:09.507Z] godog --format=junit:/var/lib/jenkins/workspace/PR-980-1-e41d4525-4537-447f-93f7-e133e1915587/src/github.com/elastic/e2e-testing/outputs/TEST-metricbeat.xml --tags "integrations && redisenterprise && ~@nightly && ~skip"
[2021-04-01T09:18:24.449Z] time="2021-04-01T09:18:24Z" level=info msg="Current execution will be instrumented 🛠" apm-environment=ci
[2021-04-01T09:18:24.712Z] time="2021-04-01T09:18:24Z" level=debug msg="The Elastic artifacts API is available" elapsedTime=206.781489ms retries=1 statusEndpoint="https://artifacts-api.elastic.co/v1/versions/8.0.0-SNAPSHOT/?x-elastic-no-kpi=true"
[2021-04-01T09:18:24.712Z] time="2021-04-01T09:18:24Z" level=debug msg="Latest version for current version obtained" alias=8.0.0-SNAPSHOT version=8.0.0-SNAPSHOT
[2021-04-01T09:18:24.976Z] time="2021-04-01T09:18:24Z" level=debug msg="The Elastic artifacts API is available" elapsedTime=104.816006ms retries=1 statusEndpoint="https://artifacts-api.elastic.co/v1/versions/8.0.0-SNAPSHOT/?x-elastic-no-kpi=true"
[2021-04-01T09:18:24.976Z] time="2021-04-01T09:18:24Z" level=debug msg="Latest version for current version obtained" alias=8.0.0-SNAPSHOT version=8.0.0-SNAPSHOT
[2021-04-01T09:18:25.959Z] Creating network "metricbeat_default" with the default driver
[2021-04-01T09:18:26.240Z] Pulling elasticsearch (docker.elastic.co/elasticsearch/elasticsearch:8.0.0-SNAPSHOT)...
[2021-04-01T09:18:26.519Z] 8.0.0-SNAPSHOT: Pulling from elasticsearch/elasticsearch
[2021-04-01T09:18:34.683Z] Digest: sha256:9c79cd714d85b45581c7f6dc5050ff74d95e558b32155b19805335157509f909
[2021-04-01T09:18:34.683Z] Status: Downloaded newer image for docker.elastic.co/elasticsearch/elasticsearch:8.0.0-SNAPSHOT
[2021-04-01T09:18:34.683Z] Creating metricbeat_elasticsearch_1 ... 
[2021-04-01T09:18:39.987Z] 
Creating metricbeat_elasticsearch_1 ... done
time="2021-04-01T09:18:39Z" level=debug msg="Docker compose executed." cmd="[up -d]" composeFilePaths="[/var/lib/jenkins/workspace/PR-980-1-e41d4525-4537-447f-93f7-e133e1915587/.op/compose/profiles/metricbeat/docker-compose.yml]" env="map[stackVersion:8.0.0-SNAPSHOT]" profile=metricbeat
[2021-04-01T09:18:39.987Z] time="2021-04-01T09:18:39Z" level=warning msg="The Elasticsearch cluster is not healthy yet" elapsedTime=2.182526ms error="http: server closed idle connection" retry=1
[2021-04-01T09:18:39.987Z] time="2021-04-01T09:18:39Z" level=warning msg="The Elasticsearch cluster is not healthy yet" elapsedTime=560.647031ms error="read tcp 127.0.0.1:55570->127.0.0.1:9200: read: connection reset by peer" retry=2
[2021-04-01T09:18:41.378Z] time="2021-04-01T09:18:41Z" level=warning msg="The Elasticsearch cluster is not healthy yet" elapsedTime=2.006154488s error=EOF retry=3
[2021-04-01T09:18:43.932Z] time="2021-04-01T09:18:43Z" level=warning msg="The Elasticsearch cluster is not healthy yet" elapsedTime=4.339812174s error="read tcp 127.0.0.1:55602->127.0.0.1:9200: read: connection reset by peer" retry=4
[2021-04-01T09:18:47.243Z] time="2021-04-01T09:18:47Z" level=warning msg="The Elasticsearch cluster is not healthy yet" elapsedTime=8.095103799s error=EOF retry=5
[2021-04-01T09:18:49.167Z] {"level":"debug","time":"2021-04-01T09:18:49Z","message":"sent request with 0 transactions, 6 spans, 0 errors, 0 metricsets"}
[2021-04-01T09:18:52.479Z] time="2021-04-01T09:18:51Z" level=warning msg="The Elasticsearch cluster is not healthy yet" elapsedTime=12.7222029s error="read tcp 127.0.0.1:55634->127.0.0.1:9200: read: connection reset by peer" retry=6
[2021-04-01T09:18:54.399Z] {"level":"debug","time":"2021-04-01T09:18:54Z","message":"gathering metrics"}
[2021-04-01T09:18:58.616Z] time="2021-04-01T09:18:57Z" level=info msg="The Elasticsearch cluster is healthy" elapsedTime=18.771539341s retries=7
[2021-04-01T09:18:58.616Z] {"level":"debug","time":"2021-04-01T09:18:57Z","message":"sent request with 1 transaction, 3 spans, 0 errors, 1 metricset"}
[2021-04-01T09:18:58.880Z] Stopping metricbeat_elasticsearch_1 ... 
[2021-04-01T09:18:59.827Z] 
Stopping metricbeat_elasticsearch_1 ... done
Removing metricbeat_elasticsearch_1 ... 
[2021-04-01T09:18:59.827Z] 
Removing metricbeat_elasticsearch_1 ... done
Removing network metricbeat_default
[2021-04-01T09:19:00.089Z] time="2021-04-01T09:19:00Z" level=debug msg="Docker compose executed." cmd="[down --remove-orphans]" composeFilePaths="[/var/lib/jenkins/workspace/PR-980-1-e41d4525-4537-447f-93f7-e133e1915587/.op/compose/profiles/metricbeat/docker-compose.yml]" env="map[stackVersion:8.0.0-SNAPSHOT]" profile=metricbeat
[2021-04-01T09:19:00.351Z] {"level":"debug","time":"2021-04-01T09:19:00Z","message":"sent request with 1 transaction, 2 spans, 0 errors, 0 metricsets"}
[2021-04-01T09:19:00.698Z] [INFO] Stopping Filebeat Docker container
[2021-04-01T09:19:01.017Z] + docker exec -t b23e42eb6eff1c22b71d306b61f9eb5493cb40e5fcd58e7c71e6c7ea1fe36720 chmod -R ugo+rw /output
[2021-04-01T09:19:01.592Z] + docker stop --time 30 b23e42eb6eff1c22b71d306b61f9eb5493cb40e5fcd58e7c71e6c7ea1fe36720
[2021-04-01T09:19:01.853Z] b23e42eb6eff1c22b71d306b61f9eb5493cb40e5fcd58e7c71e6c7ea1fe36720
[2021-04-01T09:19:01.896Z] Archiving artifacts
[2021-04-01T09:19:02.730Z] Recording test results
[2021-04-01T09:19:03.033Z] None of the test reports contained any result
[2021-04-01T09:19:03.049Z] [Checks API] No suitable checks publisher found.
[2021-04-01T09:19:03.082Z] Archiving artifacts
[2021-04-01T09:19:03.185Z] Running in /var/lib/jenkins/workspace/PR-980-1-e41d4525-4537-447f-93f7-e133e1915587/src/github.com/elastic/e2e-testing
[2021-04-01T09:19:03.530Z] + go clean -modcache
[2021-04-01T09:25:12.659Z] Cancelling nested steps due to timeout
[2021-04-01T09:25:18.255Z] Failed in branch ubuntu-18.04_metricbeat_metricbeat
[2021-04-01T09:25:20.375Z] Stage "Release" skipped due to earlier failure(s)
[2021-04-01T09:25:37.415Z] Running on beats-ci-immutable-ubuntu-1804-1617265605406215777 in /var/lib/jenkins/workspace/e2e-tests_e2e-testing-mbp_PR-980
[2021-04-01T09:25:37.719Z] [INFO] getVaultSecret: Getting secrets
[2021-04-01T09:25:37.824Z] Masking supported pattern matches of $VAULT_ADDR or $VAULT_ROLE_ID or $VAULT_SECRET_ID
[2021-04-01T09:25:38.856Z] + chmod 755 generate-build-data.sh
[2021-04-01T09:25:38.856Z] + ./generate-build-data.sh https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/e2e-tests/e2e-testing-mbp/PR-980/ https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/e2e-tests/e2e-testing-mbp/PR-980/runs/1 FAILURE 4857538
[2021-04-01T09:25:38.856Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/e2e-tests/e2e-testing-mbp/PR-980/runs/1/steps/?limit=10000 -o steps-info.json
[2021-04-01T09:25:39.798Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/e2e-tests/e2e-testing-mbp/PR-980/runs/1/tests/?status=FAILED -o tests-errors.json
[2021-04-01T09:25:39.798Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/e2e-tests/e2e-testing-mbp/PR-980/runs/1/log/ -o pipeline-log.txt

🐛 Flaky test report

❕ There are test failures but not known flaky tests.

Expand to view the summary

Test stats 🧪

Test Results
Failed 2
Passed 134
Skipped 0
Total 136

Genuine test errors 2

💔 There are test failures but not known flaky tests, most likely a genuine test failure.

  • Name: Initializing / End-To-End Tests / ubuntu-18.04_fleet_stand_alone_agent / Deploying a default stand-alone agent with fleet server mode – Stand-alone Agent
  • Name: Initializing / End-To-End Tests / ubuntu-18.04_fleet_fleet_mode_agent / Un-installing the installed centos agent – Fleet Mode Agent

@adam-stokes
Copy link
Contributor

Super cool!

@mdelapenya mdelapenya marked this pull request as ready for review April 1, 2021 16:21
@adam-stokes adam-stokes merged commit 7899343 into elastic:master Apr 2, 2021
@mdelapenya mdelapenya deleted the 977-archive-builds branch April 6, 2021 05:32
mdelapenya added a commit to mdelapenya/e2e-testing that referenced this pull request Apr 22, 2021
* chore: archive releases in Jenkins UI

* chore: simplify release process on Jenkins

* chore: remove garbage

* chore: support retrying fetching the goreleaser script

It will also retry in the case the release command fails

* chore: set GITHUB_TOKEN

* chore: ensure workspace is clean in the worker

* chore: add release information for goreleaser
@mdelapenya mdelapenya mentioned this pull request Apr 22, 2021
9 tasks
mdelapenya added a commit that referenced this pull request Apr 22, 2021
* cli: enable loading default profiles turnkey (#943)

* cli: enable loading default profiles turnkey

Fixes #933
* update NOTICE
* Fix additional lint issues in ingest_manager_test
* Cleanup comment and trace log in GetComposeFile
* Provide better trace feedback if missing docker-compose
* Update cli/config/config.go
* chore: add back traces when extracting the files from the box (#946)
* fix: use a more comprehensive initialisation method for configs
   As go init() method is not deterministic, I found that the logger init was
   not called at the right time. With change we ensure that the Init is:
   1) called first
   2) existing it the config was already populated
* chore: add back traces when extracting the files from the box

Signed-off-by: Adam Stokes <[email protected]>
Co-authored-by: Manuel de la Peña <[email protected]>

* Add basic check on correct service is defined for profile runs (#957)

Fixes #944

This adds a length check on the string split for verifying that the
<service/image name>:<tag> is defined when adding additional services to a
profile deployment.

Signed-off-by: Adam Stokes <[email protected]>

* Update NOTICE (#969)

Adds additional overrides to pulling in the proper licenses

Signed-off-by: Adam Stokes <[email protected]>

* Build binaries via goreleaser (#977)

This handles building for all supported architectures including running packr
for embedding the binary files.

This allows us to easily extend our release process for tagging official cli
releases, building in various package formats and publishing to different
package registries

Signed-off-by: Adam Stokes <[email protected]>

* chore: simplify release process on Jenkins (#980)

* chore: archive releases in Jenkins UI

* chore: simplify release process on Jenkins

* chore: remove garbage

* chore: support retrying fetching the goreleaser script

It will also retry in the case the release command fails

* chore: set GITHUB_TOKEN

* chore: ensure workspace is clean in the worker

* chore: add release information for goreleaser

* Remove the agent config file parameters for stand alone (#983)

Signed-off-by: Adam Stokes <[email protected]>

Co-authored-by: Manuel de la Peña <[email protected]>

* fix: run unit tests after refactor (#1067)

* chore: remove unused files after refactor

* chore: run unit tests with new layout

* fix: run unit tests on CI

* chore: include unit tests for the e2e dir

* fix: move unit tests resources for installer tests

* fix: move more test resources for unit tests

* fix: abstract path calculation from OS

Co-authored-by: Adam Stokes <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants