Do you want to save 80% of your bandwidth to your search provider? Do you want to deliver content to your users faster? With this one tr...Development Elasticsearch Debugging
If you’re not familiar, or just haven’t used Sass maps, here’s your chance to dive in. Our latest static site was built on Jekyll using ...sass
C# being an Object Oriented Programming (OOP) language, we have access to inheritance. Like any feature of a programming language, you sh...csharp bugs
We love the combination of SQL and Elasticsearch and believe it is a winning combination for anyone building a modern application. Elasti...Elasticsearch NEST C#
I’ve been watching [DotNetConf][dotnetconf] videos over the weekend, and was most curious about [Mads Torgersen’s][mads] [“What’s Coming ...c-sharp C# .NET
Hugo is an amazing static site generator, but getting lost when templating is easier than we’d like. We’ve found a way to evaluate variab...Hugo JAMStack Static
Regardless of your opinion on Object Relational Mappers (ORM), I think they are a great tool for prototyping ideas. Over time, they can l....net core sql
Dealing with JSON data in SQL Database introduces several challenges. This post addresses querying json data stored in SQL Database that...SQL Azure Database development
We are in the middle of writing a template engine to define dynamic forms. The user interface can only post to a known model on the serve...C# development
We are living on the bleeding edge that is Hugo’s release cycle. To keep our macOS development environments up to date we wrote this shel...development
Hugo recently released an amazing asset pipeline, which means you need less external dependencies to build a sweet static site. To take a...dev build
With the news that Microsoft is acquiring GitHub, I thought I would ask the team what their thoughts are on the topic. We utilize the .NE...
Security is an essential part of any application ecosystem, but it can also be a nebulous concept for an organization to grasp. During ou...development
Releasing new versions from continuous integration, rather than someone’s machine in a team environment is a great way to release new versions of npm packages in a predicable and controlled manner.
Here’s a quick runthrough for publishing an npm package from TeamCity:
We’ll need the build itself setup on TeamCity. For us, we’re currently following a
build.cmd philosophy for our projects. An example
build.cmd looks like this:
@echo Off pushd %~dp0 setlocal :Build call npm install if %ERRORLEVEL% neq 0 goto BuildFail call npm run build if %ERRORLEVEL% neq 0 goto BuildFail call npm run validate if %ERRORLEVEL% neq 0 goto BuildFail call npm pack if %ERRORLEVEL% neq 0 goto BuildFail goto BuildSuccess :BuildFail echo. echo *** BUILD FAILED *** goto End :BuildSuccess echo. echo *** BUILD SUCCEEDED *** goto End :End echo. popd exit /B %ERRORLEVEL%
Note the usage of
npm pack. This generates the necessary
.tgz artifact for the package that we can publish to npm.
Simply setup TeamCity to run your build.cmd, or however you want to setup your build.
The important point is ensuring the build artifacts include the
Now that there’s a working build generating the necessary artifact, we can create a build step to publish the package. This relies on the build script for the
Here’s a runthrough of the various options to configure:
ritter-jekyllto the name of your npm package):
@echo Off call npm config set "//registry.npmjs.org/:_authToken" "%npm_auth_token%" echo Before publish... for /f %%%%i in ('dir ritter-jekyll-*.tgz /b') do set PACKAGE=%%%%i call echo Publishing %%PACKAGE%% ... call npm publish %%PACKAGE%% call npm config delete "//registry.npmjs.org/:_authToken"
Now, you’re ready to deploy the latest version of your package from the
master branch. And, subsequent version updates will be automatically published by TeamCity as they reach