skip to Main Content

I created vs code extension and want to publish it to internal antifactory so that other teams can download and use it.

created .vsix file using vsce package command. When I tried vsce publish, it is asking for publisher name that is required only if I want to publish it to marketplace.I tried below command as well

vsce publish –baseImagesUrl <–My-company artifactory–>

I need to automate the publish part along with my other java releases.Please suggest better approach.

We can use curl, but that needs service account credentials in jenkins pipeline to deploy vsix.

2

Answers


  1. Support towards marketplace repositories in specific is not extended, with respect to Artifactory. However, Artifactory would allow storing such packages using repositories of GENERIC type. Downloads are accepted through direct cURL requests for the end users.

    Login or Signup to reply.
  2. If you want to publish your VS Code extension to an internal generic artifact repository in Artifactory, you’ll need to handle the publication process yourself. Here’s a general outline of the steps you might take:

    1. Set up your internal generic repository: Make sure you have an internal generic repository (in Artifactory) where you can store the VSIX file. You’ll need to have the appropriate permissions to upload files to this repository.

    2. Prepare your VSIX file: Generate the VSIX file using the vsce package command. This will package your extension into a .vsix file.

    3. Upload to Artifactory: Use a script or tool to upload the generated .vsix file to your internal repository (Artifactory). You can use tools like curl or language-specific libraries to perform the upload.

      curl -u username:password -T path/to/extension.vsix <internal_artifactory_url>
      

      Note that using a service account or some form of authentication is necessary to securely upload the file.

    4. Provide download instructions: Once the .vsix file is uploaded to your internal repository, provide the necessary instructions to your teams on how they can download and install the extension.

    5. Automation in Jenkins Pipeline: If you want to automate this process as part of your extenion releases in a Jenkins pipeline, you can integrate the upload step into your pipeline script. Jenkins pipelines support various plugins and tools that can help you manage these steps. Jenkins environment variables can be used to securely store credentials.

      For example, you might use Jenkins Credentials Plugin to manage sensitive information like Artifactory credentials. Then, in your pipeline script, you can access these credentials securely and use them in your curl command to upload the .vsix file.

    Remember that security is a crucial aspect, especially when dealing with credentials and authentication. Always follow best practices for handling sensitive information and use secure methods for automation.

    Please adapt these steps to your specific environment, repository, and tools. The exact commands and tools you use might vary depending on your company’s setup and preferences.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search