-
Notifications
You must be signed in to change notification settings - Fork 49
/
put.sh
executable file
·77 lines (63 loc) · 2.17 KB
/
put.sh
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/bash
set -e
source $(dirname $0)/helpers.sh
it_can_deploy_release_to_folder_without_pom() {
local src=$(mktemp -d $TMPDIR/out-src.XXXXXX)
mkdir $src/m2-release
mkdir $src/m2-snapshot
local url=file://$src/m2-release
local snapshot_url=file://$src/m2-snapshot
local version=1.0.0-rc.0
deploy_without_pom_without_credentials $url $version $src $snapshot_url | jq -e "
.version == {version: $(echo $version | jq -R .)}
"
}
it_can_deploy_snapshot_to_folder_without_pom() {
local src=$(mktemp -d $TMPDIR/out-src.XXXXXX)
mkdir $src/m2-release
mkdir $src/m2-snapshot
local url=file://$src/m2-release
local snapshot_url=file://$src/m2-snapshot
local version=1.0.0-rc.0-SNAPSHOT
local snapshot_version=$(deploy_without_pom_without_credentials $url $version $src $snapshot_url | jq -r '.version.version')
local snapshot_date=$(env TZ=UTC date '+%Y%m%d.')
[[ "$snapshot_version" = "${version%-SNAPSHOT}-$snapshot_date"* ]]
}
# it_can_deploy_release_to_folder_with_pom() {
#
# local src=$(mktemp -d $TMPDIR/out-src.XXXXXX)
#
# mkdir $src/project
# cp $(dirname $0)/resources/pom-release.xml $src/project/pom.xml
#
# mkdir $src/m2-repo
#
# local url=file://$src/m2-repo
# local pom=$src/project/pom.xml
# local version=$(xmllint --xpath "//*[local-name()='project']/*[local-name()='version']/text()" $pom)
#
# deploy_with_pom_without_credentials $url $pom $src | jq -e "
# .version == {version: $(echo $version | jq -R .)}
# "
# }
# it_can_deploy_snapshot_to_folder_with_pom() {
#
# local src=$(mktemp -d $TMPDIR/out-src.XXXXXX)
#
# mkdir $src/project
# cp $(dirname $0)/resources/pom-snapshot.xml $src/project/pom.xml
#
# mkdir $src/m2-repo
#
# local url=file://$src/m2-repo
# local pom=$src/project/pom.xml
# local version=$(xmllint --xpath "//*[local-name()='project']/*[local-name()='version']/text()" $pom)
#
# deploy_with_pom_without_credentials $url $pom $src | jq -e "
# .version == {version: $(echo $version | jq -R .)}
# "
# }
run it_can_deploy_release_to_folder_without_pom
run it_can_deploy_snapshot_to_folder_without_pom
# run it_can_deploy_release_to_folder_with_pom
# run it_can_deploy_snapshot_to_folder_with_pom