Skip to content

Conversation

@mrodm
Copy link
Contributor

@mrodm mrodm commented Feb 13, 2023

This PR introduces the scripts to trigger Jenkins jobs from buildkite:

  • Signing job
  • Publishing job

Added the credentials for Jenkins in the pre-command hook.
Missing credentials to upload packages to the corresponding Google Storage Buckets.

Example to trigger the publishing job:

cd .buildkite/scripts/triggerJenkinsJob
go run main.go \
  --jenkins-job publish \
  --package gs://<bucket>/<path>/package_storage_candidate-0.0.1.zip \
  --signature gs://<bucket>/<path>/package_storage_candidate-0.0.1.zip.sig

@mrodm mrodm force-pushed the add_first_step_second_pipeline branch from 0ccc768 to eea1bf7 Compare February 13, 2023 16:14
@elasticmachine
Copy link
Collaborator

elasticmachine commented Feb 13, 2023

💚 Build Succeeded

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

Expand to view the summary

Build stats

  • Start Time: 2023-03-01T17:34:10.947+0000

  • Duration: 2 min 13 sec

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

@elasticmachine
Copy link
Collaborator

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 100.0% (35/35) 💚
Files 65.909% (87/132) 👍
Classes 61.376% (116/189) 👍
Methods 49.091% (405/825) 👍
Lines 31.725% (3576/11272) 👍
Conditionals 100.0% (0/0) 💚

@mrodm mrodm force-pushed the add_first_step_second_pipeline branch 4 times, most recently from 3c3d561 to 614e9cf Compare February 14, 2023 15:54
@mrodm mrodm force-pushed the add_first_step_second_pipeline branch from 4b89db4 to 366ae25 Compare February 24, 2023 15:17
@mrodm mrodm force-pushed the add_first_step_second_pipeline branch from 366ae25 to 4bbda42 Compare February 24, 2023 15:20
@mrodm mrodm changed the title Add step to build package Add script to trigger Jenkins jobs Feb 28, 2023
@mrodm mrodm self-assigned this Feb 28, 2023
@mrodm mrodm requested review from a team and alexsapran February 28, 2023 14:54
@mrodm mrodm marked this pull request as ready for review February 28, 2023 14:54
echo "✅ gsutil is installed"
fi

gsutil help
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a script a placeholder for another one that will come later? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This script should replace the logic to signing a package and publishing it.
Currently, it is here just a placeholder as you mention and it allowed me to check that gsutil command is available.

if err != nil {
return nil, err
}
// Jenkins queue API has about 4.7second quiet period
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit. What is this comment about? 🙂

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code is based on https://github.com/bndr/gojenkins/blob/master/jenkins.go#L282

Latest version published of this module does not have the latest changes of this method. With the method GetBuildFromQueueID from version 1.1.0 it didn't work.

// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.

package main
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit. Move this common logic to a separate package so it is later easier to reuse it in other projects. It may be also nice to have this as a buildkite plugin ;)

@mrodm mrodm merged commit d6feba4 into elastic:main Mar 6, 2023
@mrodm mrodm deleted the add_first_step_second_pipeline branch March 6, 2023 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants