Skip to content
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

Initial commit for Tag-Repos job #1263

Merged
merged 1 commit into from
Mar 6, 2018

Conversation

AdamBrousseau
Copy link
Contributor

  • Pipeline file to tag OpenJ9 and OpenJ9-OMR
  • Fail if Tag already exists
  • Fail if tag point does not exist
  • Inputs: Tag Name, Tag Annotation (Optional), OpenJ9 SHA, OMR SHA

[skip ci]

Signed-off-by: Adam Brousseau adam.brousseau88@gmail.com

@AdamBrousseau
Copy link
Contributor Author

Job


HTTP = 'https://'
OMR_REPO = 'github.com/AdamBrousseau/openj9-omr.git'
OPENJ9_REPO = 'github.com/AdamBrousseau/openj9.git'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will update this to eclipse once done testing

)
echo "SHA: ${SHA}"
// This 'if' condition is WIP
if ((TAG_POINT ==~ /.*SHA.*/) || (SHA ==~ /.*TAG_POINT.*/)) {
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 is the only WIP left for me

@AdamBrousseau AdamBrousseau force-pushed the jenkins_tag_job branch 2 times, most recently from 035b608 to 5ca1fe5 Compare February 26, 2018 20:20
@AdamBrousseau AdamBrousseau force-pushed the jenkins_tag_job branch 5 times, most recently from b22cd13 to 013f2e4 Compare March 2, 2018 21:50
@AdamBrousseau AdamBrousseau changed the title WIP: Initial commit for Tag-Repos job Initial commit for Tag-Repos job Mar 2, 2018
@AdamBrousseau
Copy link
Contributor Author

Test cases

Ready for review @pshipton

@AdamBrousseau
Copy link
Contributor Author

@DanHeidinga do we want to make the Tag Annotation mandatory? Do we have a set format for the annotation? The code would be slightly less complicated if it was mandatory. I'm not sure if the annotation makes a difference from a git checkout perspective.

@keithc-ca
Copy link
Contributor

The command we're using (git describe --exact-match) will only work with annotated tags (i.e those created by using git tag -a ...).

@DanHeidinga
Copy link
Member

@DanHeidinga do we want to make the Tag Annotation mandatory?

Yes, the release.md file says to use annotated tags as GITHUB treats them differently than simple tags. The format should be free form text.

See #1265 for examples of the annotation I've used for the 0.8.0 release.

@AdamBrousseau AdamBrousseau force-pushed the jenkins_tag_job branch 2 times, most recently from e2ccef9 to 823f665 Compare March 5, 2018 19:44
@AdamBrousseau
Copy link
Contributor Author

Updated to make ANNOTATION mandatory.
Tests

*******************************************************************************/

// Assumes OPENJ9_SHA, OMR_SHA, and TAG_NAME are passed in Jenkins parameters
// TAG_ANNOTATION is optional
Copy link
Contributor

Choose a reason for hiding this comment

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

This isn't true anymore.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated

def SHA = sh (
script: "git rev-parse --short ${POINT_TYPE_PREFIX}${TAG_POINT}",
returnStdout: true
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: can you adjust the indentation to be consistent with the rest of this file?

echo "REPO_NAME: ${REPO_NAME}"

if (STATUS == 128) {
echo "Good, tag does not exist yet"
Copy link
Contributor

Choose a reason for hiding this comment

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

Where is it documented that 128 is returned in this situation? Do we need to be specific here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can't find it but I see 128 is used for other failure types too. So maybe we should just remove it and take any failure as "tag does not exist"

@AdamBrousseau
Copy link
Contributor Author

updated

@AdamBrousseau
Copy link
Contributor Author

Simplified script. Removed the two checks for existing tag and tag_point since having additional checks does not add any value. The git tag command will fail and stderr will indicate what is wrong.

- Pipeline file to tag OpenJ9 and OpenJ9-OMR
- Git tag will fail if tag already exists
- Git tag will fail if tag point does not exist
- Inputs: Tag Name, Tag Annotation, OpenJ9 SHA, OMR SHA

[skip ci]

Signed-off-by: Adam Brousseau <adam.brousseau88@gmail.com>
@keithc-ca keithc-ca merged commit 021de86 into eclipse-openj9:master Mar 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants