New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@baitic/semantic-release-ssh

Package Overview
Dependencies
Maintainers
2
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@baitic/semantic-release-ssh

semantic-release plugin to deploy app

  • 1.0.0
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

@baitic/semantic-release-ssh

This is a fork from @eclass/semantic-release-ssh-commands@1.0.3 with updates on semantic-release peer dependency version and .npmignore file.

npm Node.js CI downloads dependencies devDependency Status Coverage Status Maintainability semantic-release

semantic-release plugin to deploy app with ssh commands

StepDescription
verifyConditionsVerify the presence of the SSH_USER, SSH_HOST environment variables.
publishDeploy app over ssh.

Install

npm i -D @eclass/semantic-release-ssh-commands

Usage

The plugin can be configured in the semantic-release configuration file:

{
  "plugins": [
    "@semantic-release/changelog",
    "@semantic-release/npm",
    "@semantic-release/git",
    "@semantic-release/gitlab",
    [
      "@eclass/semantic-release-ssh-commands",
      {
        "verifyConditionsCmd": "bash verify.sh",
        "publishCmd": "bash deploy.sh ${nextRelease.version}"
      }
    ]
  ]
}

NOTE: verify.sh and deploy.sh are script located in remote server

Configuration

Environment variables

VariableDescription
SSH_USERA ssh user
SSH_HOSTA ssh host
SSH_PRIVATE_KEYContent of private ssh key (Optional)

Options

VariableDescription
verifyConditionsCmdA command to verificate. Required. Ex: "docker pull myuser/myapp" or "bash verify.sh"
publishCmdA command to publish new release. Required. Ex: "bash deploy.sh ${nextRelease.version}"

Examples

{
  "plugins": [
    "@semantic-release/changelog",
    "@semantic-release/npm",
    "@semantic-release/git",
    "@semantic-release/gitlab",
    [
      "@eclass/semantic-release-ssh-commands",
      {
        "verifyConditionsCmd": "bash verify.sh",
        "publishCmd": "bash deploy.sh ${nextRelease.version}"
      }
    ]
  ]
}
# .gitlab-ci.yml
release:
  image: node:alpine
  stage: release
  before_script:
    - apk add --no-cache git openssh-client
    - mkdir -p /root/.ssh
    - chmod 0700 /root/.ssh
    - ssh-keyscan $SSH_HOST > /root/.ssh/known_hosts
    - echo "$SSH_PRIVATE_KEY" > /root/.ssh/id_rsa
    - chmod 600 /root/.ssh/id_rsa
    - echo "    IdentityFile /root/.ssh/id_rsa" >> /etc/ssh/ssh_config
  script:
    - npx semantic-release
  only:
    - master
# .travis.yml
language: node_js
cache:
  directories:
    - ~/.npm
node_js:
  - "12"
stages:
  - test
  - name: deploy
    if: branch = master
jobs:
  include:
    - stage: test
      script: npm t
    - stage: deploy
      addons:
        ssh_known_hosts: $SSH_HOST
      before_deploy:
        - eval "$(ssh-agent -s)"
        - echo "$SSH_PRIVATE_KEY" > /tmp/deploy_rsa
        - chmod 600 /tmp/deploy_rsa
        - ssh-add /tmp/deploy_rsa
      script: npx semantic-release

License

MIT

Keywords

FAQs

Package last updated on 14 Jul 2022

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc