Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Update Jenkinsfile to fix push to RubyGems #354

Merged
merged 1 commit into from
Jul 14, 2022
Merged

Conversation

john-odonnell
Copy link
Contributor

@john-odonnell john-odonnell commented Jul 12, 2022

Desired Outcome

Jenkins build fails when publishing the CLI to RubyGems.org.

Currently fails with:

[2022-05-31T18:38:28.294Z] fatal: unsafe repository ('/src' is owned by someone else)
[2022-05-31T18:38:28.294Z] To add an exception for this directory, call:
[2022-05-31T18:38:28.294Z]
[2022-05-31T18:38:28.294Z] git config --global --add safe.directory /src

when running:

sh 'docker run -i --rm -v $PWD:/src -w /src alpine/git clean -fxd' in the Jenkinsfile.

Implemented Changes

Instead of running git commands from an alpine/git container, I've moved the commands to run directly in the shell.

If we still want to use an alpine/git container, we can run something like this, but it probably isn't necessary:

sh '''
  docker run -i --rm \
    --entrypoint /bin/sh \
    -v $PWD:/src -w /src \
    alpine/git -c '
      git config --global --add safe.directory /src
      git clean -fxd
    '
'''

Connected Issue/Story

CyberArk internal issue link: ONYX-21426

Definition of Done

At least 1 todo must be completed in the sections below for the PR to be
merged.

Changelog

  • The CHANGELOG has been updated, or
  • This PR does not include user-facing changes and doesn't require a
    CHANGELOG update

Test coverage

  • This PR includes new unit and integration tests to go with the code
    changes, or
  • The changes in this PR do not require tests

Documentation

  • Docs (e.g. READMEs) were updated in this PR
  • A follow-up issue to update official docs has been filed here: insert issue ID
  • This PR does not require updating any documentation

Behavior

  • This PR changes product behavior and has been reviewed by a PO, or
  • These changes are part of a larger initiative that will be reviewed later, or
  • No behavior was changed with this PR

Security

  • Security architect has reviewed the changes in this PR,
  • These changes are part of a larger initiative with a separate security review, or
  • There are no security aspects to these changes

@john-odonnell john-odonnell force-pushed the rubygem-fix branch 2 times, most recently from ecbd0a7 to 681f24c Compare July 13, 2022 14:43
@john-odonnell john-odonnell changed the title Rubygem fix Update Jenkinsfile to fix push to RubyGems Jul 13, 2022
@john-odonnell john-odonnell marked this pull request as ready for review July 13, 2022 16:58
@john-odonnell john-odonnell requested a review from a team as a code owner July 13, 2022 16:58
Copy link
Contributor

@rpothier rpothier left a comment

Choose a reason for hiding this comment

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

LGTM!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants