VS Code Extensions Tarball Generator

This project aims to create a tarball of selected Visual Studio Code extensions based on a YAML file. This tarball can be used in air-gapped environments where direct access to the Visual Studio Code Marketplace is not possible.

GitLab: c2platform/phx/vs-code-extensions 

pipeline
status Latest
Release

This project aims to create a tarball of selected Visual Studio Code extensions based on a YAML file. This tarball can be used in air-gapped environments where direct access to the Visual Studio Code Marketplace is not possible.

Overview

The project consists of a Python script, download.py, that reads a YAML file containing extension details and downloads each specified extension. The extensions are then packaged into a tarball for easy distribution.

Features

  • Download VS Code extensions specified in a YAML file.
  • Package downloaded extensions into a .tar.gz archive.
  • Utilize GitLab CI/CD to automate the building and packaging process.

Project Structure

  • download.py: Python script to download extensions.
  • vs-code-extensions.yaml: Configuration file specifying the extensions to be downloaded.
  • .gitlab-ci.yml: GitLab CI/CD configuration file to automate the build, package, and release processes.

Configuration

YAML File

The YAML file (vs-code-extensions.yaml) should have the following structure to specify extensions:

extensions:
  - publisher: <publisher_name>
    id: <extension_id>
    version: <extension_version>
  # Add more extensions as needed

Usage

Running Locally

  1. Install Python dependencies (if any are specified).

  2. Set up a YAML configuration file with the necessary extension details.

  3. Run the script to download the extensions:

    python3 download.py
    
  4. Package the extensions using tar:

    tar -czvf vs-code-extensions.tar.gz vs-code-extensions
    

Using GitLab CI/CD

The CI/CD pipeline is structured in the following stages:

  • Build: Run the download.py script to download extensions.
  • Package: Create a tarball of the downloaded extensions, which is done manually and only on the master branch.
  • Publish: Upload the tarball as an artifact.
  • Release: On the master branch, create a new release with the tarball as an artifact.

Note:

  • The CI/CD pipeline includes a prepare stage that extracts the version number from a CHANGELOG.md file and sets it as an environment variable.
  • Ensure your CHANGELOG.md file is properly formatted with versioning for the pipeline to function correctly.
  • You can manually trigger the package stage, ensuring it only affects the master branch.



Laatst gewijzigd 2025.06.26: gitlab phx projects PHX-14 PHX-16 (687a73c)