Skip to content

Commit

Permalink
Merge pull request #207 from rundeck/dev/project-archive-scm
Browse files Browse the repository at this point in the history
Export and Import SCM project settings
  • Loading branch information
gschueler authored Dec 11, 2018
2 parents 933c884 + d6973ec commit 91c94d0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,8 @@ Call<ProjectExportStatus> exportProjectAsync(
@Query("exportExecutions") boolean execs,
@Query("exportConfigs") boolean configs,
@Query("exportReadmes") boolean readmes,
@Query("exportAcls") boolean acls
@Query("exportAcls") boolean acls,
@Query("exportScm") boolean scm
);

/**
Expand Down Expand Up @@ -391,6 +392,7 @@ Call<ProjectImportStatus> importProjectArchive(
@Query("importExecutions") Boolean importExecutions,
@Query("importConfig") Boolean importConfig,
@Query("importACL") Boolean importACL,
@Query("importScm") Boolean importScm,
@Body RequestBody body
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ public Archives(final RdApp rdApp) {
@Option(shortName = "a", longName = "include-acl", description = "Include ACLs in import, default: false")
boolean isIncludeAcl();

@Option(shortName = "s", longName = "include-scm", description = "Include SCM configuration in import, default: false (api v28 required)")
boolean isIncludeScm();

@Option(description = "Return non-zero exit status if any imported item had an error. Default: only job " +
"import errors are treated as failures.")
boolean isStrict();
Expand All @@ -94,6 +97,7 @@ public boolean importArchive(ArchiveImportOpts opts, CommandOutput out) throws I
!opts.isNoExecutions(),
opts.isIncludeConfig(),
opts.isIncludeAcl(),
opts.isIncludeScm(),
body
));
boolean anyerror = false;
Expand Down Expand Up @@ -143,7 +147,7 @@ interface ArchiveFileOpts {
longName = "include",
shortName = "i",
description =
"List of archive contents to include. [all,jobs,executions,configs,readmes,acls]. Default: " +
"List of archive contents to include. [all,jobs,executions,configs,readmes,acls,scm]. Default: " +
"all. (API v19 required for other " +
"options).")
Set<Flags> getIncludeFlags();
Expand All @@ -158,7 +162,8 @@ enum Flags {
executions,
configs,
readmes,
acls
acls,
scm
}

@Command(description = "Export a project archive")
Expand Down Expand Up @@ -217,7 +222,8 @@ public boolean export(ArchiveExportOpts opts, CommandOutput output) throws IOExc
includeFlags.contains(Flags.executions),
includeFlags.contains(Flags.configs),
includeFlags.contains(Flags.readmes),
includeFlags.contains(Flags.acls)
includeFlags.contains(Flags.acls),
includeFlags.contains(Flags.scm)
));
}

Expand Down

0 comments on commit 91c94d0

Please sign in to comment.