1.5.13 • Published 2 years ago

@edgelogistics/semantic-release v1.5.13

Weekly downloads
-
License
UNLICENSED
Repository
-
Last release
2 years ago

Bitbucket Semantic Release

Package to use semantic release in a bitbucket project. This project is based on NPM semantic-release package, and is expected to be used with a semantic release configuration

Installation

To install this package run the following command in the terminal in the root directory of your application.

npm install --save-dev @edgelogistics/semantic-release

OR

yarn add --dev @edgelogistics/semantic-release

Usage

Add to your .releaserc or .releaserc.js or release.config.js

"extends": ["@edgelogistics/semantic-release"],

In order to use the deployment step, the env variable EXECUTE_RELEASE_SCRIPT must be set to true and the env variable CUSTOM_PIPELINE_SELECTOR_TO_RELEASE must be also be set the an existent custom pipe

To define the custom pipe you must add to the bitbucket-pipelines.yml

definitions:
    steps:
        - step: &deployment
            name: Deployment
            image: edgelogistics/node-16-alpine # This image must be able to use curl, bash and npm
            script:
                - echo "deploying"

pipelines:
    custom:
        echo:
            - step: *deployment

In case that EXECUTE_BACK_MERGE_SCRIPT is set to true, then a back merge would be executed by default between master to develop. You can change this behavior by setting the env variable ORIGIN_BRANCH_BACK_MERGE and DESTINATION_BRANCH_BACK_MERGE to the branches for the back merge, the ORIGIN_BRANCH_BACK_MERGE is the source branch and the DESTINATION_BRANCH_BACK_MERGE is the branch that will receive the back merge.

In case that EXECUTE_RELEASE_SCRIPT is set to true, then the package will be published using the value passed in the env NPM_TOKEN.

Variables

VariableUsage
EXECUTE_RELEASE_SCRIPTFlag to see if the release custom pipeline must be executed. Default: false
EXECUTE_BACK_MERGE_SCRIPTFlag to see if the back merge script must be executed. Default: false
PUBLISH_PACKAGE_TO_NPMFlag to see if the package must be published to NPM. Default: false
NPM_TOKENFlag to see if the package must be published to NPM. Required if PUBLISH_PACKAGE_TO_NPM is true.
CUSTOM_PIPELINE_SELECTOR_TO_RELEASEName of the custom pipe to be executed in the release step. Required if EXECUTE_RELEASE_SCRIPT is true.
ORIGIN_BRANCH_BACK_MERGEOrigin branch from where the back merge will be done. Default: master.
DESTINATION_BRANCH_BACK_MERGEDestination branch that will receive the back merge. Default: develop.
BITBUCKET_REPO_OWNERThe bitbucket repo owner, used to build bitbucket url. Required if EXECUTE_RELEASE_SCRIPT is true. Default: ${BITBUCKET_REPO_OWNER}
BITBUCKET_REPO_SLUGThe bitbucket repo slug, used to build bitbucket url. Required if EXECUTE_RELEASE_SCRIPT is true. Default: ${BITBUCKET_REPO_SLUG}
GIT_CREDENTIALSCredentials for bitbucket to execute the custom pipeline. Required if EXECUTE_RELEASE_SCRIPT is true. Default: ${GIT_CREDENTIALS}
DEBUGTurn on extra debug information. Default: false

(*) = required variable.

Prerequisites

Examples

Basic example:

script:
  - npm run semantic-release

Advanced example:

script:
    - export PUBLISH_PACKAGE_TO_NPM=1
    - export EXECUTE_RELEASE_SCRIPT=1
    - export EXECUTE_BACK_MERGE_SCRIPT=1
    - export CUSTOM_PIPELINE_SELECTOR_TO_RELEASE=deployment
    - export NPM_TOKEN=yyy
    - export GIT_CREDENTIALS=username:password
    - npm run semantic-release

Executing Tests

Part of this library is tested using bats for the bash scripts, so is necessary to install the git submodules

git submodule update --init --recursive
npm install
chmod a+x test/*.bats
npm run test:bash
npm run test:js

Support

If you’d like help with this library, or you have an issue or feature request, let us know. The library is maintained by cnieto@lean-tech.io.

If you’re reporting an issue, please include:

  • the version of the library
  • relevant logs and error messages
  • steps to reproduce
1.5.5

2 years ago

1.5.4

2 years ago

1.5.3

2 years ago

1.5.10

2 years ago

1.5.12

2 years ago

1.5.11

2 years ago

1.5.13

2 years ago

1.5.9

2 years ago

1.5.8

2 years ago

1.5.7

2 years ago

1.5.6

2 years ago

1.5.2

2 years ago

1.5.1

2 years ago

1.5.0

2 years ago

1.4.0

2 years ago

1.3.11

2 years ago

1.3.2

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago