#!/bin/bash

# this setup script is used locally to create an .npmrc file and run yarn install.
# It relies on Docker secrets and Docker BuildKit.

set -e

source /run/secrets/tokens || true

unique_id=theorchard_jenkins

# Append github configuration
sed "s/{{GITHUB_TOKEN}}/$GITHUB_TOKEN/" .npmrc.shadow > .npmrc

yarn install

rm -f .npmrc
