Skip to content

Commit

Permalink
#296 first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
DannyCastroVentura committed Nov 18, 2022
2 parents 734ddba + 11c4241 commit 41daf5a
Show file tree
Hide file tree
Showing 22 changed files with 2,916 additions and 2,265 deletions.
10 changes: 10 additions & 0 deletions copado-function/app/Deploy.fn.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,12 @@ async function run() {
* handles downloading metadata
*/
class Deploy {
/**
* used to ensure our working directory is clean before checking out branches
*/
static stashChanges() {
Util.execCommand(null, [`git stash`], null);
}
/**
* retrieve the new values into the targets folder so it can be commited later.
*
Expand All @@ -297,6 +303,10 @@ class Deploy {
let gitAddArr;
let gitDiffArr = [];
try {
Log.info(
`Stashing changes made by mcdev.deploy() to avoid issues during branch checkout`
);
Deploy.stashChanges();
Log.info('Switch to source branch to add updates for target');
Copado.checkoutSrc(CONFIG.promotionBranch);
} catch (ex) {
Expand Down
Loading

0 comments on commit 41daf5a

Please sign in to comment.