Skip to content

Commit

Permalink
feat: Publish packages to Nexus.
Browse files Browse the repository at this point in the history
  • Loading branch information
christofferartmannmrf committed Jun 16, 2020
1 parent cc936b0 commit e47c617
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 9 deletions.
10 changes: 6 additions & 4 deletions build/ci/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pipeline {
}
stage('Build') {
steps {
sh """docker build -f build/ci/Dockerfile -t $TAG --build-arg GITHUB_ACCESS_TOKEN="$GITHUB_ACCESS_TOKEN" ."""
sh """docker build -f build/ci/Dockerfile -t $TAG --build-arg GITHUB_ACCESS_TOKEN="$GITHUB_ACCESS_TOKEN" ."""
}
}
stage('Lint') {
Expand All @@ -47,9 +47,11 @@ pipeline {
}
}
steps {
sh """
docker run --rm --entrypoint /bin/bash $TAG -c "npm run lerna publish -- --dist-tag latest --canary --no-git-tag-version --yes --preid snapshot"
"""
withCredentials([string(credentialsId: 'NEXUS_BASIC_AUTH_BASE64', variable: 'nexusAuth')]) {
sh """
docker run --rm --entrypoint /bin/bash $TAG -c 'build/ci/publish ${nexusAuth}'
"""
}
}
}
}
Expand Down
17 changes: 17 additions & 0 deletions build/ci/publish
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

npm run lerna publish -- --dist-tag latest --canary --no-git-tag-version --no-git-reset --yes --preid snapshot

for dir in packages/*/ ; do
printf "registry = https://repositories.mrf.io/nexus/repository/npm-internal/\nalways-auth=true\n_auth=${1}" > "${dir}.npmrc"
done

npm config set registry https://repositories.mrf.io/nexus/repository/npm-internal/
npm config set https://repositories.mrf.io/nexus/repository/npm-internal/:_authToken $1
npm config set strict-ssl false
git config --global user.email 'jenkins@elpilas'
git config --global user.name 'jenkins'
npm config list && git add . && git commit -m 'new version'
git status

npm run lerna publish -- from-package --dist-tag latest --yes --registry https://repositories.mrf.io/nexus/repository/npm-internal/
18 changes: 18 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/eslint-config-js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,3 +165,4 @@ module.exports = {
}
}]
};

5 changes: 0 additions & 5 deletions packages/eslint-config-react/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/prettier-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@
"prettier": "^1.19.1"
}
}

0 comments on commit e47c617

Please sign in to comment.