All Projects → ymedlop → Npm Cache Resource

ymedlop / Npm Cache Resource

Licence: mit
Concourse resource for caching dependencies

Programming Languages

shell
77523 projects

Labels

Projects that are alternatives of or similar to Npm Cache Resource

Iceci
IceCI is a continuous integration system designed for Kubernetes from the ground up.
Stars: ✭ 29 (-43.14%)
Mutual labels:  ci
Doact
A Terraform module for hosting your own runner for CI/CD on Digital Ocean to run jobs in your GitHub Actions workflows. 🚀
Stars: ✭ 42 (-17.65%)
Mutual labels:  ci
Automatic Release
Automates the release process for GitHub projects.
Stars: ✭ 46 (-9.8%)
Mutual labels:  ci
Condition Circle
Checks CircleCI environment before publishing successful build using semantic-release
Stars: ✭ 32 (-37.25%)
Mutual labels:  ci
Aliyungradleconfig
自用的安卓开源项目工程模板。阿里云远程仓库加速,发布到maven仓库、上传到jcenter,代码混淆、资源混淆,持续集成(CI),多渠道自动打包。在天朝使用jcenter、mavenCentral及google三个远程仓库,Gradle Sync太慢?一招教你配置阿里云镜像源。init.d/init.gradle
Stars: ✭ 37 (-27.45%)
Mutual labels:  ci
Fluenttc
🌊 👬 🏢 Integrate with TeamCity fluently
Stars: ✭ 42 (-17.65%)
Mutual labels:  ci
Plek
Make continuous deployment delightful. Deploy and preview your apps for each pull request with Plek. 🇳🇱
Stars: ✭ 15 (-70.59%)
Mutual labels:  ci
Abs cd
CI/CD for the Arch build system with webinterface.
Stars: ✭ 48 (-5.88%)
Mutual labels:  ci
Action Ros Ci
Github Action to build and test ROS 2 packages using colcon
Stars: ✭ 41 (-19.61%)
Mutual labels:  ci
Stu
Display Clojurescript builds using D3
Stars: ✭ 46 (-9.8%)
Mutual labels:  ci
Python Packaging Tutorial
Tutorial on python packaging
Stars: ✭ 34 (-33.33%)
Mutual labels:  ci
Drone Vault
Drone plugin for integrating with the Vault secrets manager
Stars: ✭ 36 (-29.41%)
Mutual labels:  ci
Infrabox
Stars: ✭ 45 (-11.76%)
Mutual labels:  ci
Yb
A new build tool optimized for local + remote development
Stars: ✭ 29 (-43.14%)
Mutual labels:  ci
Octopod
🐙🛠️ Open-source self-hosted solution for managing multiple deployments in a Kubernetes cluster with a user-friendly web interface.
Stars: ✭ 47 (-7.84%)
Mutual labels:  ci
Chinese Poetry
The most comprehensive database of Chinese poetry 🧶最全中华古诗词数据库, 唐宋两朝近一万四千古诗人, 接近5.5万首唐诗加26万宋诗. 两宋时期1564位词人,21050首词。
Stars: ✭ 34,881 (+68294.12%)
Mutual labels:  ci
Xcode Server And Continuous Integration Guide In Chinese
《Xcode Server and Continuous Integration Guide》官方文档中文版
Stars: ✭ 42 (-17.65%)
Mutual labels:  ci
Metac
It is metacontroller and more
Stars: ✭ 50 (-1.96%)
Mutual labels:  ci
Kdtool
Kubernetes deployment utility
Stars: ✭ 47 (-7.84%)
Mutual labels:  ci
Setup Nim Action
Setup Nim action
Stars: ✭ 46 (-9.8%)
Mutual labels:  ci

npm-cache-resource

a Concourse resource for caching dependencies downloaded by NPM - built on mhart/alpine-node and git-resource.

EXAMPLE PIPELINE

Versions

Tag From Bower Yarn Maintained
latest mhart/alpine-node:latest Yes Yes Yes
15 mhart/alpine-node:15 Yes Yes Yes
14 mhart/alpine-node:14 Yes Yes Yes
12 mhart/alpine-node:12 Yes Yes Yes
10 mhart/alpine-node:10 Yes Yes Yes
9 mhart/alpine-node:9 No Yes No
8 mhart/alpine-node:8 No Yes No
7 mhart/alpine-node:7 No No No
6 mhart/alpine-node:6 No No No
4 mhart/alpine-node:4 No No No
0.12 mhart/alpine-node:0.12 No No No
0.10 mhart/alpine-node:0.10 No No No

Resource Configuration

resource_types:

  - name: npm-cache
    type: docker-image
    source: {repository: ymedlop/npm-cache-resource, tag: "12"}

Source Configuration

  • <<:: Required. The source is the same as the corresponding git resource

Configuration to access a Git Private Repo

SSH:

  • private_key: Required. Private key.

HTTP(S):

  • username_key: Required. Username for HTTP(S) auth. This is needed when only HTTP/HTTPS protocol for git is available (which does not support private key auth) and auth is required.
  • password_key: Required. Password for HTTP(S) auth.
  • skip_ssl_verification: Optional. Skips git ssl verification by exporting GIT_SSL_NO_VERIFY=true.

Configuration to access a NPM Registry or Private Registry by User and Password.

  • registry-url: Optional. Private NPM registry to log in to (Default: https://registry.npmjs.org)
  • registry-user: Required. Registry Username.
  • registry-pass: Required. Registry User Password.
  • registry-email: Required. Registry User Email.
  • registry-scope: Optional. Registry Scope.

Configuration to access a Private Registry by Base64 Token

  • registry: Required. The location our private npm registry.
  • token: Required. Our npm token.

Node.js Environment variables

  • node-env: Set NODE_ENV. (Default: development)

Configuration for projects living in subdirectories

  • project-path: Optional Relative path of subdirectory containing the project (i.e. where the package.json is).

Configuration use for npm

  • npm-args: Optional Allow to add extra args to npm i / npm ci command. (Default: "-q")

Configuration use npm ci command

  • npm-ci-support: Optional Allow to use npm ci instead of npm install to install the npm modules into our resource. (Default: false)

Configuration use yarn cli

  • yarn-support: Optional Allow to use yarn to install the npm modules into our resource. (Default: false)
  • yarn-args: Optional Allow to add extra args to yarn install command. (Default: "")

Configuration use bower cli

  • bower-support: Optional Allow to use bower to install packages into our resource (Bower dependency has to be in our package.json). (Default: false)
  • bower-args: Optional Allow to add extra args to bower install command. (Default: "-q --allow-root")
Whatever tool you use to generate the encoded username and password string, try to encode the string admin:admin123, which should result in YWRtaW46YWRtaW4xMjM=. `
Another example for a valid setup is jane:testpassword123 resulting in amFuZTp0ZXN0cGFzc3dvcmQxMjM=.

In our demo we are using admin:123456 resulting in YWRtaW46MTIzNDU2

Example

resources:

  # a perfectly normal source repository with lashings and lashings of dependencies
  - name: repo
    type: git
    source: &repo-source # apply a YAML anchor so we can refer to this in the cache resource
      uri: https://github.com/ymedlop/npm-cache-resource.git
      branch: npm-package-example

  # a resource caching the dependencies listed in the source repository
  - name: npm-repo-cache
    type: npm-cache # as defined above
    source:
      <<: *repo-source # the source is the same as the corresponding git resource ...
      paths: # ... except that it's only interested in files listing dependencies
        - package.json

Behavior

check: Check for new commits

The repository is cloned (or pulled if already present), and any commits from the given version on are returned. If no version is given, the ref for HEAD is returned.

Any commits that contain the string [ci skip] will be ignored. This allows you to commit to your repository without triggering a new version.

in: Pulls a package from npm

Clones the repository to the destination, and locks it down to a given ref. It will return the same given ref as version. And fetch npm package from the package.json`.

Examples

jobs:

  - name: cache
    plan:

      - get: repo
        trigger: true

      - get: npm-repo-cache

  - name: test
    plan:

      - get: repo
        trigger: true
        passed: [cache]

      - get: npm-repo-cache
        passed: [cache]

      - task: run tests
        config:

          platform: linux
          image_resource:
            type: docker-image
            source: {repository: mhart/alpine-node, tag: "12"}

          inputs:
            - name: repo
              path: /src
            - name: npm-repo-cache
              path: /cache

          run:
            path: sh
            args:
              - -exc
              - |
                mv cache/node_modules src
                cd src && npm test

  - name: build
    plan:

      - get: repo
        trigger: true
        passed: [cache]

      - get: npm-repo-cache
        passed: [cache]

      - task: run build
        config:

          platform: linux
          image_resource:
            type: docker-image
            source: {repository: mhart/alpine-node, tag: "12"}

          inputs:
            - name: repo
              path: /src
            - name: npm-repo-cache
              path: /cache

          run:
            path: sh
            args:
              - -exc
              - |
                mv cache/node_modules src
                cd src && npm run build

out: Nothing to do here....

Getting Started

You can see more examples here.

Credits:

License

See the LICENSE file for license text and copyright information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].