Skip to content

Support for build number outside of the vss-extension.json #258

@nschonni

Description

@nschonni

Support for non-SemVer versioning was discussed here #232 although AFAIK a 4 number version number is not supported https://docs.microsoft.com/en-us/vsts/extend/develop/manifest

Our current workaround for this has been to create a temporary version file with the following

// script/build.js
const fs = require('fs');
const path = require('path');

// Get the original/core extension JSON file so we can read the version number
const vssJson = require("../vss-extension.json");

// Create an override JSON file that uses the current time in milliseconds as the SemVer PATCH number
const tmpVss = "{\"version\": \"" + vssJson.version.replace("x", Date.now()) + "\"}";

// Write the JSON as a .tmp file so it doesn't get tracked by Git
fs.writeFileSync(path.join(__dirname, '../vss-extension.tmp'), tmpVss);

This produces an override json that can then be fed into the commandline like
tfx extension create --service-url http://MYSERVER:8080/tfs --overrides-file vss-extension.tmp

vss-extension.tmp

{"version": "1.0.1519867829920"}

Is this a common enough use case that it should be integrated into the CLI in some manner to better support CI/CD of extensions? Or is it better to try to do this in something like https://github.com/Microsoft/vso-extension-tools

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions