🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

increase-version

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

increase-version

Automaticaly increase version in files (package.json, Dockerfile, yaml)

latest
Source
npmnpm
Version
1.0.4
Version published
Weekly downloads
39
-58.06%
Maintainers
1
Weekly downloads
 
Created
Source

increase-version

Automaticaly increase version in

  • package.json
  • Dockerfile
  • service.yaml

Script find in package.json property version.

params

  • --package-json=./package.json
  • --dockerfile=./Dockerfile
  • --template-yaml=./template.yaml
  • --yaml=./service-name.yaml
  • --version-up=major ... (2🔺).1.0
  • --version-up=minor ... 2.(1🔺).0
  • --version-up=build ... 2.1.(0🔺) default

example js

const increaseVersion = require('increase-version');

async function increase() {
    const pathOfPackageJson = './package.json';
    const oldVersion = await increaseVersion.getVersionOfPackageJson(pathOfPackageJson);
    const newVersion = increaseVersion.changeVersion(oldVersion, increaseVersion.constants.type.BUILD);
    const versions = { old: oldVersion, new: newVersion };

    increaseVersion.json(pathOfPackageJson, versions);

    // Optional ...
    const pathOfDockerfile = './Dockerfile';
    increaseVersion.dockerfile(pathOfDockerfile, versions);

    // Optional ...
    const pathOfTemplateYaml = './kubernetes/dev/template/prototyp-homepage-deployment.yaml';
    const pathOfGeneratedYaml = './kubernetes/dev/prototyp-homepage-deployment.yaml';
    const yamlProps = {
        name: 'my-service-name',
        containerPort: 80,
    };
    increaseVersion.yaml(pathOfTemplateYaml, pathOfGeneratedYaml, versions, yamlProps);
}

increase();


examples bash

# only package.json
increase-version --package-json=./package.json
# package.json with Dockerfile
increase-version \
    --package-json=./package.json \
    --dockerfile=./Dockerfile \
    --version-up=major

examples yaml template

apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{name}}
spec:
  selector:
    matchLabels:
      app: {{name}}
  template:
    metadata:
      labels:
        app: {{name}}
    spec:
      containers:
        - name: {{name}}
          image: my-domain.dev/{{name}}:{{version}}
          ports:
            - containerPort: {{containerPort}}
          env:
            - name: NODE_ENV
              value: "production"
            - name: DB_HOST
              value: "xxxx"
            - name: DB_NAME
              value: "xxxx"



Keywords

version

FAQs

Package last updated on 08 Aug 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts