|
@@ -1,8 +1,6 @@ |
|
|
defaultBranch=master |
|
|
defaultBranch=master |
|
|
|
|
|
|
|
|
for branch in $(cat package.json | jq .publishing | jq -r keys[]) ; do |
|
|
for branch in $(cat package.json | jq .publishing | jq -r keys[]) ; do |
|
|
git checkout $branch |
|
|
|
|
|
|
|
|
|
|
|
rawRepository=$(cat package.json | jq -r .publishing.$branch.repository) |
|
|
rawRepository=$(cat package.json | jq -r .publishing.$branch.repository) |
|
|
repository=$(cat package.json | jq -r .publishing.$branch.repository) |
|
|
repository=$(cat package.json | jq -r .publishing.$branch.repository) |
|
|
defaultRepository=$(cat package.json | jq -r .publishing.$defaultBranch.repository) |
|
|
defaultRepository=$(cat package.json | jq -r .publishing.$defaultBranch.repository) |
|
@@ -10,15 +8,10 @@ for branch in $(cat package.json | jq .publishing | jq -r keys[]) ; do |
|
|
if [ $repository = $defaultRepository ]; then |
|
|
if [ $repository = $defaultRepository ]; then |
|
|
echo "$( jq --arg repository "$repository" '.repository = $repository' package.json )" > package.json |
|
|
echo "$( jq --arg repository "$repository" '.repository = $repository' package.json )" > package.json |
|
|
echo "Publishing to primary repository: $repository" |
|
|
echo "Publishing to primary repository: $repository" |
|
|
git push |
|
|
|
|
|
git reset --hard |
|
|
|
|
|
elif [ $rawRepository != 'null' ]; then |
|
|
elif [ $rawRepository != 'null' ]; then |
|
|
echo "$branch is a mirror" |
|
|
echo "$branch is a mirror" |
|
|
echo "$( jq --arg repository "$repository" '.repository = $repository' package.json )" > package.json |
|
|
echo "$( jq --arg repository "$repository" '.repository = $repository' package.json )" > package.json |
|
|
echo "Publishing to mirror repository: $repository" |
|
|
echo "Publishing to mirror repository: $repository" |
|
|
git commit -am "Publish to $branch" |
|
|
|
|
|
git push --mirror $repository |
|
|
|
|
|
git reset --hard |
|
|
|
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
rawName=$(cat package.json | jq .publishing.$branch.name) |
|
|
rawName=$(cat package.json | jq .publishing.$branch.name) |
|
@@ -28,7 +21,6 @@ for branch in $(cat package.json | jq .publishing | jq -r keys[]) ; do |
|
|
fi |
|
|
fi |
|
|
registry=$(cat package.json | jq -r .publishing.$branch.publishConfig.registry) |
|
|
registry=$(cat package.json | jq -r .publishing.$branch.publishConfig.registry) |
|
|
echo "Publishing to package repository: $registry" |
|
|
echo "Publishing to package repository: $registry" |
|
|
npm publish --registry=$registry |
|
|
|
|
|
|
|
|
npm publish --registry=$registry --access public |
|
|
|
|
|
git reset --hard |
|
|
done |
|
|
done |
|
|
|
|
|
|
|
|
git checkout $defaultBranch |
|
|
|