Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: fix version 7 LTS branch CI #17296

Merged
merged 2 commits into from
Mar 24, 2020
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
var_1: &docker_image angular/ngcontainer:0.7.0
var_2: &cache_key angular_devkit-{{ checksum "yarn.lock" }}-0.7.0
var_3: &node_8_docker_image angular/ngcontainer:0.3.3
var_3: &node_12_docker_image circleci/node:12.1-browsers
var_4: &node_12_docker_image circleci/node:12.1-browsers

# Settings common to each job
anchor_1: &defaults
Expand Down
7 changes: 6 additions & 1 deletion scripts/snapshots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,12 @@ async function _publishSnapshot(

_exec('git', ['clone', url], { cwd: root }, publishLogger);
if (branch) {
_exec('git', ['checkout', '-B', branch], { cwd: destPath }, publishLogger);
// Try to checkout an existing branch, otherwise create it.
try {
_exec('git', ['checkout', branch], { cwd: destPath }, publishLogger);
} catch {
_exec('git', ['checkout', '-b', branch], { cwd: destPath }, publishLogger);
}
}

// Clear snapshot directory before publishing to remove deleted build files.
Expand Down