Skip to content

Commit

Permalink
Drone: Publish NPM packages after Storybook to avoid race condition (g…
Browse files Browse the repository at this point in the history
…rafana#29340)

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
  • Loading branch information
aknuds1 authored Nov 24, 2020
1 parent 22788d1 commit 7d8cb68
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 25 deletions.
49 changes: 26 additions & 23 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,7 @@ steps:
from_secret: gcp_key
depends_on:
- build-storybook
- end-to-end-tests

- name: build-frontend-docs
image: grafana/build-container:1.2.29
Expand Down Expand Up @@ -933,18 +934,6 @@ steps:
- mysql-integration-tests
- postgres-integration-tests

- name: release-npm-packages
image: grafana/build-container:1.2.29
commands:
- ./node_modules/.bin/lerna bootstrap
- echo "//registry.npmjs.org/:_authToken=$${NPM_TOKEN}" >> ~/.npmrc
- ./scripts/build/release-packages.sh ${DRONE_TAG}
environment:
NPM_TOKEN:
from_secret: npm_token
depends_on:
- end-to-end-tests

- name: publish-storybook
image: grafana/grafana-ci-deploy:1.2.7
commands:
Expand All @@ -957,6 +946,19 @@ steps:
from_secret: gcp_key
depends_on:
- build-storybook
- end-to-end-tests

- name: release-npm-packages
image: grafana/build-container:1.2.29
commands:
- ./node_modules/.bin/lerna bootstrap
- echo "//registry.npmjs.org/:_authToken=$${NPM_TOKEN}" >> ~/.npmrc
- ./scripts/build/release-packages.sh ${DRONE_TAG}
environment:
NPM_TOKEN:
from_secret: npm_token
depends_on:
- publish-storybook

services:
- name: postgres
Expand Down Expand Up @@ -1699,17 +1701,6 @@ steps:
- mysql-integration-tests
- postgres-integration-tests

- name: release-npm-packages
image: grafana/build-container:1.2.29
commands:
- ./node_modules/.bin/lerna bootstrap
- echo "//registry.npmjs.org/:_authToken=$${NPM_TOKEN}" >> ~/.npmrc
environment:
NPM_TOKEN:
from_secret: npm_token
depends_on:
- end-to-end-tests

- name: publish-storybook
image: grafana/grafana-ci-deploy:1.2.7
commands:
Expand All @@ -1719,6 +1710,18 @@ steps:
from_secret: gcp_key
depends_on:
- build-storybook
- end-to-end-tests

- name: release-npm-packages
image: grafana/build-container:1.2.29
commands:
- ./node_modules/.bin/lerna bootstrap
- echo "//registry.npmjs.org/:_authToken=$${NPM_TOKEN}" >> ~/.npmrc
environment:
NPM_TOKEN:
from_secret: npm_token
depends_on:
- publish-storybook

services:
- name: postgres
Expand Down
1 change: 1 addition & 0 deletions scripts/lib.star
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ def publish_storybook_step(edition, ver_mode):
'image': publish_image,
'depends_on': [
'build-storybook',
'end-to-end-tests',
],
'environment': {
'GCP_KEY': {
Expand Down
5 changes: 3 additions & 2 deletions scripts/release.star
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ def release_npm_packages_step(edition, ver_mode):
'name': 'release-npm-packages',
'image': build_image,
'depends_on': [
'end-to-end-tests',
# Has to run after publish-storybook since this step cleans the files publish-storybook depends on
'publish-storybook',
],
'environment': {
'NPM_TOKEN': {
Expand Down Expand Up @@ -78,8 +79,8 @@ def get_steps(edition, ver_mode, publish):
if publish:
steps.extend([
upload_packages_step(edition=edition, ver_mode=ver_mode),
release_npm_packages_step(edition=edition, ver_mode=ver_mode),
publish_storybook_step(edition=edition, ver_mode=ver_mode),
release_npm_packages_step(edition=edition, ver_mode=ver_mode),
])
windows_steps = get_windows_steps(edition=edition, ver_mode=ver_mode)

Expand Down

0 comments on commit 7d8cb68

Please sign in to comment.