Welcome to the new Box Support website. Check out all the details here on what’s changed.

(Getting started question) Want to write a file to Box from a CI/CD pipeline

Answered
New post

Comments

1 comment

  • jcleblanc

    Hi ,

     

    Let me approach this one in a few ways - I'll let you know how I would approach this without the CLI, and then cover a more direct answer on the CLI to your question, if you'd prefer that route:

     

    SDK Method (Recommended)

    The way that I would generally approach this is to have a JWT based application that can run from the command line. This would allow you to customize the API requests to Box Platform and that would take care of all of the setup work. If you're using one of the official SDKs then token refresh will be handled for you. The JWT application method will allow you to make API calls to Box behind the scenes without having to have the user log in to Box with their own credentials. You would then have the application run all commands needed

     

    Here's info on setting up an application using that method.

     

    CLI Method (Recommended)

    Now for the CLI method. We do have a number of install packages available for the CLI that you can take advantage of. To set up the CLI you can run the box configure:environments:add command and then add in a valid application configuration file. To get this you can create a JWT application, then when you're setting up your keys you can automatically generate it from the application. This will download a config .json file that you can use to import to the CLI. The CLI will also handle token refreshing for you, so you don't have to worry about that.

     

    Hope that helps,

    Jon

    0
    Comment actions Permalink

Please sign in to leave a comment.