Пример #1
0
 public BitbucketCreateRepositoryOptions(BitbucketClientOptions clientOptions, string ownerUsername, string repositorySlug, string scm, bool isPrivate)
 {
     NewRepository = new Repository {
         Scm = scm, IsPrivate = isPrivate
     };
     OwnerUsername  = ownerUsername;
     RepositorySlug = repositorySlug;
     ServerUri      = clientOptions.ServerUri;
     Username       = clientOptions.Username;
     Password       = clientOptions.Password;
 }
Пример #2
0
        public override void Run(Context context)
        {
            const string ownerUsername = "******";
            const string repoSlug      = "jstestrepo";
            const string scm           = "git";
            const bool   isPrivate     = true;

            context.Log.Write(Cake.Core.Diagnostics.Verbosity.Normal, Cake.Core.Diagnostics.LogLevel.Information, "Creating repo: {0}/{1}", ownerUsername, repoSlug);
            var bco = new BitbucketClientOptions {
                ServerUri = new System.Uri("https://api.bitbucket.org"), Username = "******", Password = "******"
            };
            var repo = context.BitbucketCreateRepository(bco, ownerUsername, repoSlug, scm, isPrivate);

            context.Log.Write(Cake.Core.Diagnostics.Verbosity.Normal, Cake.Core.Diagnostics.LogLevel.Information, "Succeesfully created repo: {0}", repo.Name);
        }
Пример #3
0
 public static Repository BitbucketCreateRepository(this Context context, BitbucketClientOptions clientOptions, string ownerUsername, string repositorySlug, string scm, bool isPrivate)
 {
     return(BitbucketCreateRepositoryAsync(context, clientOptions, ownerUsername, repositorySlug, scm, isPrivate).Result);
 }
Пример #4
0
 public static async Task <Repository> BitbucketCreateRepositoryAsync(this Context context, BitbucketClientOptions clientOptions, string ownerUsername, string repositorySlug, string scm, bool isPrivate)
 {
     return(await BitbucketCreateRepositoryAsync(context, new BitbucketCreateRepositoryOptions(clientOptions, ownerUsername, repositorySlug, scm, isPrivate)));
 }