Skip to content

Commit

Permalink
Update Semaphore configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
TomFern committed Jun 14, 2021
1 parent 2e5e6d8 commit 40aebab
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .semaphore/pipeline_2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: v1.0
name: Pipeline 2
agent:
machine:
type: e1-standard-2
os_image: ubuntu1804
blocks:
- name: Publish
task:
jobs:
- name: Publish
commands:
- npm install --global lerna
- checkout
- 'echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc'
- 'lerna exec -- cache restore node-modules-\$LERNA_PACKAGE_NAME-$SEMAPHORE_GIT_BRANCH,node-modules-\$LERNA_PACKAGE_NAME node_modules'
- lerna bootstrap
- lerna publish from-git --no-git-tag-version --no-push --yes
secrets:
- name: NPM
70 changes: 70 additions & 0 deletions .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
version: v1.0
name: First pipeline
agent:
machine:
type: e1-standard-2
os_image: ubuntu1804
auto_cancel:
queued:
when: 'true'
blocks:
- name: Install
task:
jobs:
- name: Bootstrap
commands:
- npm install --global lerna
- checkout
- 'lerna exec -- cache restore node-modules-\$LERNA_PACKAGE_NAME-$SEMAPHORE_GIT_BRANCH,node-modules-\$LERNA_PACKAGE_NAME'
- lerna bootstrap
- 'lerna exec -- cache store node-modules-\$LERNA_PACKAGE_NAME-$SEMAPHORE_GIT_BRANCH,node-modules-\$LERNA_PACKAGE_NAME node_modules'
dependencies: []
- name: Tests API
task:
prologue:
commands:
- npm install --global lerna
- checkout
- 'lerna exec -- cache restore node-modules-\$LERNA_PACKAGE_NAME-$SEMAPHORE_GIT_BRANCH,node-modules-\$LERNA_PACKAGE_NAME node_modules'
- lerna bootstrap
jobs:
- name: Lint
commands:
- lerna run lint --scope @tomfern/api2
- name: Unit tests
commands:
- lerna run test --scope @tomfern/api2
- name: Integration tests
commands:
- lerna run test-integration --scope @tomfern/api2
run:
when: 'change_in(''/packages/api/'', { default_branch: ''main''})'
dependencies:
- Install
- name: Tests WEB
run:
when: 'change_in(''/packages/web/'', { default_branch: ''main''})'
dependencies:
- Install
task:
prologue:
commands:
- npm install --global lerna
- checkout
- 'lerna exec -- cache restore node-modules-\$LERNA_PACKAGE_NAME-$SEMAPHORE_GIT_BRANCH,node-modules-\$LERNA_PACKAGE_NAME node_modules'
- lerna bootstrap
jobs:
- name: Lint
commands:
- lerna run lint --scope @tomfern/web2
- name: Unit tests
commands:
- lerna run test --scope @tomfern/web2
- name: Integration tests
commands:
- lerna run test-integration --scope @tomfern/web2
promotions:
- name: Publish packages
pipeline_file: pipeline_2.yml
auto_promote:
when: tag =~ '.*' AND result = 'passed'

0 comments on commit 40aebab

Please sign in to comment.