Skip to content

Propose that github publish an "official" CircleCI Orb to install the gh-cli #3441

Closed

Description

@jasonkarns

CLI Feedback

What have you loved?

Love the ability to use the gh api subcommand for integrating CircleCI builds with github. I'm ecstatic that the gh cli is available out of the box on GH Actions. But I have clients that use CircleCI, and it is quite painful getting the gh cli installed and available.

What was confusing or gave you pause?

I'll document the pain of getting the cli installed on circle.

First attempt was essentially wget https://github.com/cli/cli/releases/download/v1.9.0/gh_1.9.0_linux_amd64.deb but it hardcodes the release 😢 .

Second attempt used curl against the Releases API to get the latest release. However, jq isn't available by default on most images, so hitting the REST api is painful from a vanilla ubuntu image.

Third attempt used the recommended installation method for linux. But running apt-get on circle's images is painful.(have to install software-properties-common; and lots of missing public keys that need added before that succeeds)

Are there features you'd like to see added?

I recognize that this is out of the realm of the cli itself. But I think it could increase adoption of the tool (and therefore also increase integration with github's platform by leveraging its api features), if it were easier to install the cli on circle. So I propose that github create a circleci orb that handles cli installation. (Perhaps even exposing a few circle commands for common integrations like deployments) It could be handled by the community, but I know most of my clients' circle configurations don't allow using third party circle orbs; so an orb by github itself could be certified by circle.

Anything else?

Keep on rocking!

Activity

  1. vilmibm commented on Apr 22, 2021

    @vilmibm
    Contributor

    Thanks for the suggestion!

    In general we try to severely limit the number of official packages we offer given how small our team is. I don't think this is an unreasonable request and I'd personally like to see it easier to use gh from CircleCI; however, given our bandwidth, an official orb is not something we're ready to jump into.

    I'm wondering if there is a stopgap solution here: if we came up with a blessed one-liner that would install gh to a debian environment with minimal dependencies would that suffice?

  2. added
    coreThis issue is not accepting PRs from outside contributors
    enhancementa request to improve CLI
    and removed on Apr 22, 2021
  3. jasonkarns commented on Apr 22, 2021

    @jasonkarns
    Author

    an official orb is not something we're ready to jump into

    Understood!

    if we came up with a blessed one-liner

    Yes, that would be amazing. Ideally, just apt-get gh would be sufficient. I was initially following the linux installation instructions as documented:

    sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key C99B11DEB97541F0
    sudo apt-add-repository https://cli.github.com/packages
    sudo apt update && sudo apt install gh

    I later discovered the reason those instructions didn't work is because the orb we were using was running an old image of linux. I went through that yak shave to upgrade the underlying machine image and then the 3-liner above worked as expected.

    So that's not to say that it wouldn't be desirable to still streamline the installation on linux; but it seems that anyone on a somewhat modern linux would be off to the races with the instructions you have already provided.

  4. vilmibm commented on Apr 23, 2021

    @vilmibm
    Contributor

    Thanks for the followup. There is also this form a user suggested recently which is a bit verbose but doesn't have any dependencies beyond a vanilla debian/ubuntu environment:

    sudo apt-key --keyring /usr/share/keyrings/githubcli-archive-keyring.gpg adv --keyserver keyserver.ubuntu.com --recv-key C99B11DEB97541F0
    echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/github-cli2.list > /dev/null
    sudo apt update
    sudo apt install gh

    I've got a growing laundry list of linux installation experience improvements kicking around in my head so I'll see if I can come up with a nice one liner...it may end up taking the form of one of those curl foo.bar > bash hacks though

  5. kostya313 commented on May 22, 2021

    @kostya313
  6. mislav commented on May 24, 2021

    @mislav
    Contributor

    @jasonkarns @vilmibm Could we close this in favor of #3672?

  7. vilmibm commented on May 24, 2021

    @vilmibm
    Contributor

    that makes sense to me.

  8. jasonkarns commented on May 25, 2021

    @jasonkarns
    Author

    👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    coreThis issue is not accepting PRs from outside contributorsenhancementa request to improve CLIpackaging

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions