summaryrefslogtreecommitdiff
path: root/qa/qa/fixtures/package_managers/npm/npm_upload_install_package_project.yaml.erb
diff options
context:
space:
mode:
Diffstat (limited to 'qa/qa/fixtures/package_managers/npm/npm_upload_install_package_project.yaml.erb')
-rw-r--r--qa/qa/fixtures/package_managers/npm/npm_upload_install_package_project.yaml.erb31
1 files changed, 31 insertions, 0 deletions
diff --git a/qa/qa/fixtures/package_managers/npm/npm_upload_install_package_project.yaml.erb b/qa/qa/fixtures/package_managers/npm/npm_upload_install_package_project.yaml.erb
new file mode 100644
index 00000000000..8d94d03ef9b
--- /dev/null
+++ b/qa/qa/fixtures/package_managers/npm/npm_upload_install_package_project.yaml.erb
@@ -0,0 +1,31 @@
+image: node:latest
+
+stages:
+ - deploy
+ - install
+
+deploy:
+ stage: deploy
+ script:
+ - echo "//${CI_SERVER_HOST}/api/v4/projects/${CI_PROJECT_ID}/packages/npm/:_authToken=<%= auth_token %>">.npmrc
+ - npm publish
+ only:
+ - "<%= project.default_branch %>"
+ tags:
+ - "runner-for-<%= project.name %>"
+install:
+ stage: install
+ script:
+ - "npm config set @<%= registry_scope %>:registry <%= gitlab_address_with_port %>/api/v4/projects/${CI_PROJECT_ID}/packages/npm/"
+ - "npm install <%= package.name %>"
+ cache:
+ key: ${CI_BUILD_REF_NAME}
+ paths:
+ - node_modules/
+ artifacts:
+ paths:
+ - node_modules/
+ only:
+ - "<%= project.default_branch %>"
+ tags:
+ - "runner-for-<%= project.name %>" \ No newline at end of file