69
69
export VERSION=$( http ${PULP_URL} status/ | jq --arg plugin $COMPONENT_NAME -r ' .versions[] | select(.component == $plugin) | .version' )
70
70
fi
71
71
72
+ # Mount volumes from parent container with `--volumes-from` option if the
73
+ # `PARENT_CONTAINER_ID` is set.
74
+ if [ -z $PARENT_CONTAINER_ID ]
75
+ then
76
+ VOLUME_OPTION=" --volume ${PWD} :${volume_name} "
77
+ VOLUME_DIR=" /local"
78
+ else
79
+ VOLUME_OPTION=" --volumes-from ${PARENT_CONTAINER_ID} :rw"
80
+ VOLUME_DIR=" ${PWD} "
81
+ fi
82
+
72
83
echo ::group::BINDINGS
73
84
if [ $2 = ' python' ]
74
85
then
75
86
$container_exec run \
76
87
$ULIMIT_COMMAND \
77
88
$USER_COMMAND \
78
89
--rm \
79
- -v ${PWD} : $volume_name \
90
+ ${VOLUME_OPTION} \
80
91
docker.io/openapitools/openapi-generator-cli:v4.3.1 generate \
81
- -i /local /api.json \
92
+ -i ${VOLUME_DIR} /api.json \
82
93
-g python \
83
- -o /local /$1 -client \
94
+ -o ${VOLUME_DIR} /$1 -client \
84
95
--additional-properties=packageName=pulpcore.client.$1 ,projectName=$1 -client,packageVersion=${VERSION} ,domainEnabled=${DOMAIN_ENABLED} \
85
- -t /local /templates/python \
96
+ -t ${VOLUME_DIR} /templates/python \
86
97
--skip-validate-spec \
87
98
--strict-spec=false
88
99
cp python/__init__.py $1 -client/pulpcore/
@@ -98,14 +109,14 @@ then
98
109
$container_exec run \
99
110
$ULIMIT_COMMAND \
100
111
$USER_COMMAND \
101
- --rm -v ${PWD} : $volume_name \
112
+ --rm ${VOLUME_OPTION} \
102
113
docker.io/openapitools/openapi-generator-cli:v4.3.1 generate \
103
- -i /local /api.json \
114
+ -i ${VOLUME_DIR} /api.json \
104
115
-g ruby \
105
- -o /local /$1 -client \
116
+ -o ${VOLUME_DIR} /$1 -client \
106
117
--additional-properties=gemName=$1 _client,gemLicense=" GPLv2+" ,gemVersion=${VERSION} ,gemHomepage=https://github.com/pulp/$1 \
107
118
--library=faraday \
108
- -t /local /templates/ruby \
119
+ -t ${VOLUME_DIR} /templates/ruby \
109
120
--skip-validate-spec \
110
121
--strict-spec=false
111
122
fi
@@ -114,12 +125,12 @@ then
114
125
$container_exec run \
115
126
$ULIMIT_COMMAND \
116
127
$USER_COMMAND \
117
- --rm -v ${PWD} : $volume_name \
128
+ --rm ${VOLUME_OPTION} \
118
129
docker.io/openapitools/openapi-generator-cli:v5.2.1 generate \
119
- -i /local /api.json \
130
+ -i ${VOLUME_DIR} /api.json \
120
131
-g typescript-axios \
121
- -o /local /$1 -client \
122
- -t /local /templates/typescript-axios \
132
+ -o ${VOLUME_DIR} /$1 -client \
133
+ -t ${VOLUME_DIR} /templates/typescript-axios \
123
134
--skip-validate-spec \
124
135
--strict-spec=false
125
136
fi
0 commit comments