-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdeploy_mule.sh
executable file
·79 lines (63 loc) · 2.26 KB
/
deploy_mule.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
78
79
#!/bin/bash
# Set up VERSION file for local development
if [ ! -f "../VERSION" ]; then
echo -n "0.0.dev" > ../VERSION
fi
set -euo pipefail
set -x
mkdir -p maven_cache
# Find the plugin jar
# Array variable to force glob expansion during assignment
# echo "${target/*$(<../VERSION)-mule-plugin.jar}"
jar_paths=(target/conjur-mule-connector-*.jar)
echo $jar_paths
# Get first item from the array
jar_path="${jar_paths[0]}"
# Extract jar filename from path
jar="$(basename "${jar_path}")"
# Bring the conjur-mule-connector jar into this directory so
# it is accessible to docker.
cp "${jar_path}" "${jar}"
docker run \
--volume "${PWD}:${PWD}" \
--volume "${PWD}/maven_cache":/root/.m2 \
--workdir "${PWD}" \
tools \
mvn --batch-mode install:install-file \
-Dfile="${jar}" \
-DgroupId=com.cyberark.conjur \
-DartifactId=conjur-mule-connector \
-Dversion="$(<VERSION)" \
-Dpackaging=jar \
-DgeneratePom=true
# Update the sample app pom to use the version of conjur mule connector plugin thats under test
docker run \
--volume "${PWD}:${PWD}" \
--volume "${PWD}/maven_cache":/root/.m2 \
--workdir "${PWD}" \
tools \
mvn --batch-mode -f pom.xml versions:use-dep-version -Dincludes=com.cyberark:conjur-mule-connector -DdepVersion="0.0.1"
docker run \
--volume "${PWD}:${PWD}" \
--volume "${PWD}/maven_cache":/root/.m2 \
--workdir "${PWD}" \
tools \
mvn --batch-mode -f pom.xml dependency:tree
# Use Tools image to package code
docker run \
--volume "${PWD}:${PWD}" \
--volume "${PWD}/maven_cache":/root/.m2 \
--workdir "${PWD}" \
tools \
mvn --batch-mode -f pom.xml clean compile package
docker build --no-cache --build-arg maven_version=3.8.4 --build-arg java_version=8 -t conjur-mule-image .
echo "list the docker images"
docker images | grep conjur-mule-image
# #deploy into Aynpoint exchange studio
# echo "deploy into Aynpoint exchange studio"
# docker run \
# --volume "${PWD}:${PWD}" \
# --volume "${PWD}/maven_cache":/root/.m2 \
# --workdir "${PWD}" \
# tools \
# mvn deploy -P anypoint-exchange-v3 -Dexchange-mule-maven-plugin=0.0.13 -Danypoint.username="anypointstudio userid" -Danypoint.password="anypointstudio pwd"