npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

bitbucket-pipelines-env-vars-populator

v1.0.1

Published

Utility to populate Bitbucket pipelines' environment variables.

Downloads

10

Readme

Bitbucket Pipelines Env Vars Populator

Utility to populate Bitbucket pipelines' environment variables.

The problem

Manual configuration of the piepeline environment variables can lead to errors: you can forget to configure a specific variable for a specific environment, you can misspell the variable key, etc. With this tool you will be sure that each evironment will contain the same variables, and that not error are performed during variables population.

Getting started

  • Create you .env file from the .env.example file
  • Create your CSV input file from the ./in/example.csv file
  • npm start to populate the variables!

Use the Binary to deploy and .env file into a repo deployment

  • install as dependency in your project or globally with
  • run deploy-bitbucket-envs

Do you want to know more?

CSV structure

The input file has to be a CSV file (for which you can define you own symbol separator). The CSV file has to have two mandatory columns:

  • key column: define the variable key (aka variable name)
  • secured column: wheather or not the variable should be secured and not visible from the Bitbucket console. Any other column in you CSV file will correspond to a different environment. You can specify as many columns as you want, and each column should be named with you environment slug (aka environment name).

Example

You want to populate your pipeline environments as following:

Test environment

  • Variable named DANIELE with value SALVATORE
  • Secured variable named MY_PASSWORD with value SECURE_PWD

Production environment

  • Variable named DANIELE with value SAVER
  • Secured variable named MY_PASSWORD with value 12$trRt

You will then create a CSV file similar to:

key;secured;test;production
DANIELE;FALSE;SALVATORE;SAVER
MY_PASSWORD;TRUE;SECURE_PWD;12$trRt

** PS: note that the CSV separator is ; so you will need to specify it in your .env file. **

while running the tool with the npm start command, you will see usefull log message in your console.

From you Bitbucket > Deployment console you will then see something similar to: Bitbucket console screenshot

You can specify additional environment adding new column to the CSV.

The following image shows the correspondence between CSV and Bitbucket console:

Correspondence

Important!

** You wrote your account password in the .env file. Remember to remove it once you are done! ** At the moment in which this tool was developer, the library used to interact with Bitbucket API do not support any other authentication method differnt from simple auth username/password.

Assumptions

  • You already have a bitbucket workspace in place
  • You already have a bitbuket repository in place
  • You already configured the bitbucket repository to enable pipelines