forked from pulp/pulp_python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall_ruby_client.sh
More file actions
executable file
·43 lines (35 loc) · 1.52 KB
/
install_ruby_client.sh
File metadata and controls
executable file
·43 lines (35 loc) · 1.52 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
42
43
#!/bin/bash
# WARNING: DO NOT EDIT!
#
# This file was generated by plugin_template, and is managed by it. Please use
# './plugin-template --github pulp_python' to update this file.
#
# For more info visit https://github.com/pulp/plugin_template
set -euv
# make sure this script runs at the repo root
cd "$(dirname "$(realpath -e "$0")")"/../../..
export PULP_URL="${PULP_URL:-https://pulp}"
export REPORTED_VERSION=$(http $PULP_URL/pulp/api/v3/status/ | jq --arg plugin python --arg legacy_plugin pulp_python -r '.versions[] | select(.component == $plugin or .component == $legacy_plugin) | .version')
export DESCRIPTION="$(git describe --all --exact-match `git rev-parse HEAD`)"
if [[ $DESCRIPTION == 'tags/'$REPORTED_VERSION ]]; then
export VERSION=${REPORTED_VERSION}
else
export EPOCH="$(date +%s)"
export VERSION=${REPORTED_VERSION}${EPOCH}
fi
export response=$(curl --write-out %{http_code} --silent --output /dev/null https://rubygems.org/gems/pulp_python_client/versions/$VERSION)
if [ "$response" == "200" ];
then
echo "pulp_python client $VERSION has already been released. Installing from RubyGems.org."
gem install pulp_python_client -v $VERSION
touch pulp_python_client-$VERSION.gem
tar cvf ruby-client.tar ./pulp_python_client-$VERSION.gem
exit
fi
cd ../pulp-openapi-generator
rm -rf pulp_python-client
./generate.sh pulp_python ruby $VERSION
cd pulp_python-client
gem build pulp_python_client
gem install --both ./pulp_python_client-$VERSION.gem
tar cvf ../../pulp_python/ruby-client.tar ./pulp_python_client-$VERSION.gem