This repository was archived by the owner on Jun 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
90 additions
and
162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import * as fs from 'fs'; | ||
|
||
export default { | ||
pipelines: ['tag'], | ||
pipelines: ['main', 'tag'], | ||
sshKey: './ssh-key', | ||
sshUrl: '[email protected]:ttoss/carlin.git', | ||
taskEnvironment: [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
npx lerna run "build" --stream --parallel | ||
npx lerna run "test" --stream --parallel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
npx lerna run "build" --stream --parallel | ||
npx lerna run "test" --stream --parallel | ||
npx lerna run "deploy" --stream --parallel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,7 @@ | ||
import * as faker from 'faker'; | ||
|
||
import * as pipelinesModule from './pipelines'; | ||
|
||
const branch = faker.random.word(); | ||
|
||
const tag = faker.random.word(); | ||
|
||
test('pipelines', () => { | ||
expect(pipelinesModule.pipelines).toEqual(['pr', 'main', 'tag']); | ||
}); | ||
|
||
test('getClosedPrCommands', () => { | ||
expect(pipelinesModule.getClosedPrCommands({ branch })).toEqual([ | ||
'git status', | ||
'git fetch', | ||
'git pull origin main', | ||
'git rev-parse HEAD', | ||
`export CARLIN_BRANCH=${branch}`, | ||
`npx lerna run "deploy" --stream --parallel -- --destroy`, | ||
]); | ||
}); | ||
|
||
test('getMainCommands', () => { | ||
expect(pipelinesModule.getMainCommands()).toEqual([ | ||
'git status', | ||
'git fetch', | ||
'git pull origin main', | ||
'git rev-parse HEAD', | ||
'yarn', | ||
`export CARLIN_ENVIRONMENT=Staging`, | ||
`npx lerna run "build" --stream --parallel`, | ||
`npx lerna run "test" --stream --parallel`, | ||
`npx lerna run "deploy" --stream --parallel`, | ||
]); | ||
}); | ||
|
||
test('getTagCommands', () => { | ||
expect(pipelinesModule.getTagCommands({ tag })).toEqual([ | ||
'git status', | ||
'git fetch --tags', | ||
`git checkout tags/${tag} -b ${tag}-branch`, | ||
'git rev-parse HEAD', | ||
'yarn', | ||
`export CARLIN_ENVIRONMENT=Production`, | ||
`npx lerna run "build" --stream --parallel`, | ||
`npx lerna run "test" --stream --parallel`, | ||
`npx lerna run "deploy" --stream --parallel`, | ||
]); | ||
}); | ||
|
||
test('getPrCommands', () => { | ||
expect(pipelinesModule.getPrCommands({ branch })).toEqual([ | ||
'git status', | ||
'git fetch', | ||
'git pull origin main', | ||
`git checkout ${branch}`, | ||
`git pull origin ${branch}`, | ||
'git rev-parse HEAD', | ||
'git status', | ||
'yarn', | ||
'npx lerna ls --since=main', | ||
`git diff --name-only HEAD..main | grep -E "\\.(j|t)sx?$" | xargs npx eslint --no-error-on-unmatched-pattern`, | ||
`npx lerna run "build" --since=main --stream --parallel`, | ||
`npx lerna run "test" --since=main --stream --parallel`, | ||
`npx lerna run "deploy" --since=main --stream --parallel`, | ||
]); | ||
expect(pipelinesModule.pipelines).toMatchObject( | ||
expect.arrayContaining(['pr', 'main', 'tag', 'closed-pr', 'ss']), | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.