-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSampleInitRepoScript.ps1
More file actions
45 lines (32 loc) · 1.6 KB
/
SampleInitRepoScript.ps1
File metadata and controls
45 lines (32 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env pwsh
# A sample script for initialization of repositories. You can adapt it for
# specific needs. Can also be used for testing.
# Function:
# * Defines some variables that will specify repositories location, addresses,
# checkout branches, etc.
# * Clones a repository without specifying a branches
# * Checks out specific branch
# * Checks out specific tag
# https://github.com/ajgorhoe/IGLib.modules.IGLibScriptsPS.git
# Execute definitions from other files:
. $(Join-Path "$PSScriptRoot" "File.ps1")
# Import definitions:
Write-Host "`n`nImporting definitions..."
. $(Join-Path "$PSScriptRoot" "GitHelpers.ps1")
# Define location where repository is cloned, branch to be checked out, etc.:
$RepositoryDirectory=Join-Path "$PSScriptRoot" "testrepos"
$RepoIGLibScriptsSubdir="IGLibScriptsPS"
$RepoIGLibScriptsAddress="https://github.com/ajgorhoe/IGLib.modules.IGLibScriptsPS.git"
$RepoIGLibScriptsBranchCloned=$null
$RepoIGLibScriptsBranch="remotes/origin/release/21_08_release_1.9.1"
$RepoIGLibScriptsTag="save/21_11_26_IglibContainsExternal_DemoAppsWork"
$RepoIGLibScriptsBranchDefault="master"
# Parameters for specific scripts:
$RepoIGLibScriptsParam = @($RepoIGLibScriptsAddress,
$RepoIGLibScriptsSubdir, $RepoIGLibScriptsBranch)
# Parameters for all repos, enable iterations over them:
$RepoParams = @($RepoIGLibScriptsParam)
Write-Host "`n`nCloning repository into $RepoIGLibScriptsSubdir ..."
$RepoDir=Join-Path "$RepositoryDirectory" "$RepoIGLibScriptsSubdir"
GitClone $RepoIGLibScriptsAddress $RepoDir
Write-Host "`nCloning finished. Verification (id Git repo): " $(IsGitRoot $RepoDir) "`\n"