To make this integration work you will need to have running Artifactory-Enterprise/Artifactory-pro/Artifactory SAAS.
- Set npm command line client to work with Artifactory Npm Registry.
create
.npmrc
file and paste following content to it:
registry = https://$ARTIFACTORY_URL/api/npm/$ARTIFACTORY_NPM_REPO_NAME/
_auth = $ARTIFACTORY_USER:$ARTIFACTORY_PASSWORD
email = youremail@email.com
always-auth = true
- Install dependencies:
npm install
- Start node Server:
npm start
- Test node package:
npm test
- Access Application on: http://localhost:3000
- Build docker image:
docker build -t $ARTIFACTORY_DOCKER_REPOSITORY/node-version .
- Run docker container:
docker run -d -p 3000:3000 $ARTIFACTORY_DOCKER_REPOSITORY/node-version
- Login to Artifactory docker registry:
docker login -u ARTIFACTORY_USER -p $ARTIFACTORY_PASSWORD $ARTIFACTORY_DOCKER_REPOSITORY
- Push docker image:
docker push $ARTIFACTORY_DOCKER_REPOSITORY/node-version
copy .travis.yml
to your project
Enable your project in travis-ci .
add Environment Variables ARTIFACTORY_URL
, ARTIFACTORY_USER
, ARTIFACTORY_DOCKER_REPOSITORY
, ARTIFACTORY_PASSWORD
, DOCEKR_STAGE_REPO
and DOCEKR_PROD_REPO
in Environment Variables settings of Bitbucket Pipeline.
In this example $ARTIFACTORY_DOCKER_REPOSITORY=jfrogtraining-docker-dev.jfrog.io
ARTIFACTORY_URL -> Artifactory URL
e.g ARTIFACTORY_URL -> https://mycompany.jforg.io/mycompany
ARTIFACTORY_USER -> Artifactory User which has permission to deploy artifacts.
e.g ARTIFACTORY_USER -> admin
ARTIFACTORY_PASSWORD -> Password for Artifactory User.
e.g ARTIFACTORY_PASSWORD -> password
ARTIFACTORY_DOCKER_REPOSITORY -> Artifactory docker registry to download and push Artifacts.
e.g ARTIFACTORY_DOCKER_REPOSITORY -> docker
DOCEKR_STAGE_REPO -> Artifactory docker registry to push Artifacts.
e.g DOCEKR_STAGE_REPO -> docker-stage-local
DOCEKR_PROD_REPO -> Artifactory docker registry to push Artifacts.
e.g DOCEKR_PROD_REPO -> docker-prod-local
You should be able to see published Docker image in Artifactory.