Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions src/update-last-successful-build/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,25 @@ async function updateLastSuccessfulBuild (opts) {
console.info('Creating temp branch') // eslint-disable-line no-console
await exec('git', ['checkout', '-b', tempBranch])

console.info('Creating yarn.lock') // eslint-disable-line no-console
await exec('yarn')
console.info('Removing dependencies') // eslint-disable-line no-console
await exec('rm', ['-rf', 'node_modules', 'package-lock.json', 'yarn.lock', 'npm-shrinkwrap.json'])

console.info('Installing dependencies') // eslint-disable-line no-console
await exec('npm', ['install', '--production'])

console.info('Removing package-lock.json') // eslint-disable-line no-console
await exec('rm', ['-rf', 'package-lock.json']) // removing package-lock after install prevents dev deps being added to the shrinkwrap file

console.info('Creating npm-shrinkwrap.json') // eslint-disable-line no-console
await exec('npm', ['shrinkwrap'])

console.info('Creating yarn.lock') // eslint-disable-line no-console
await exec('yarn', [], {
env: {
NODE_ENV: 'production'
}
})

try {
console.info('Committing') // eslint-disable-line no-console
await exec('git', ['add', '-f', 'npm-shrinkwrap.json', 'yarn.lock'])
Expand Down
15 changes: 11 additions & 4 deletions src/update-release-branch-lockfiles/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,22 @@ async function updateReleaseBranchLockfiles (opts) {
console.info('Removing dependencies') // eslint-disable-line no-console
await exec('rm', ['-rf', 'node_modules', 'package-lock.json', 'yarn.lock', 'npm-shrinkwrap.json'])

console.info('Creating yarn.lock') // eslint-disable-line no-console
await exec('yarn')

console.info('Installing dependencies') // eslint-disable-line no-console
await exec('npm', ['install'])
await exec('npm', ['install', '--production'])

console.info('Removing package-lock.json') // eslint-disable-line no-console
await exec('rm', ['-rf', 'package-lock.json']) // removing package-lock after install prevents dev deps being added to the shrinkwrap file

console.info('Creating npm-shrinkwrap.json') // eslint-disable-line no-console
await exec('npm', ['shrinkwrap'])

console.info('Creating yarn.lock') // eslint-disable-line no-console
await exec('yarn', [], {
env: {
NODE_ENV: 'production'
}
})

try {
console.info('Committing') // eslint-disable-line no-console
await exec('git', ['add', '-f', 'npm-shrinkwrap.json', 'yarn.lock'])
Expand Down