jfrog / jfrog-cli

JFrog CLI is a client that provides a simple interface that automates access to the JFrog products.
https://www.jfrog.com/confluence/display/CLI/JFrog+CLI
Apache License 2.0
531 stars 230 forks source link

npmp should be able to publich dist/ folder #856

Open xin6225 opened 4 years ago

xin6225 commented 4 years ago

I have a Angular library project and want to publish dist/mylib to our npm repo in Artifactory via gitlab CI.

in project root, I created gitlab-ci.yml file:

` build: stage: build script:

publish_package: stage: deploy before_script:

Install JFrog CLI

- curl -fL https://getcli.jfrog.io | sh
# Configure Artifactory instance with JFrog CLI
- ./jfrog rt config --url=$ARTIFACTORY_URL --user=$ARTIFACTORY_USER --password=$ARTIFACTORY_PASS
- ./jfrog rt c show

allow_failure: false dependencies:

How could I publish dist/mylib instead of root source?

stieler-it commented 3 years ago

We also missed that feature and applied a workaround that looks similar to this:

# Publish the package
- cp package.json dist/mylib
- cd dist/mylib
- ../../jfrog rt npmp $ARTIFACTORY_NPM_REPOSITORY --build-name=mylib --build-number=$CI_JOB_ID
stieler-it commented 3 years ago

Apparently JFrog CLI passes the arguments to npm, so it should also work to add the argument to the end: ./jfrog rt npmp $ARTIFACTORY_NPM_REPOSITORY --build-name=mylib --build-number=$CI_JOB_ID dist/mylib