Skip to content

Commit

Permalink
Make separate script for deploying Open Measurement SDK #318 (#321)
Browse files Browse the repository at this point in the history
  • Loading branch information
ValentinPostindustria authored Dec 13, 2021
1 parent c7ab615 commit 0a8550a
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 21 deletions.
3 changes: 2 additions & 1 deletion PrebidMobile/PrebidMobile-rendering/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/build
/build
out.map
37 changes: 37 additions & 0 deletions scripts/Maven/deployOpenMeasurement.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#! /bin/bash

#################################
# This script deploys Open measurement SDK. It must be called only when
# omsdk-android module have a new version.
#################################

function echoX() {
echo -e "PREBID DEPLOY-LOG: $@"
}

# $1 - absolute pom path, $2 - absolute aar path, $3 - absolute source path, $4 - absolute javadoc path
function mavenDeploy() {
echoX "Deploying ${2} on Maven..."

mvn gpg:sign-and-deploy-file "-DpomFile=${1}" "-Dfile=${2}" "-DrepositoryId=ossrh" "-Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/" "-DstagingRepositoryId=ossrh" "-Dsources=${3}" "-Djavadoc=${4}" || {
echoX "Deploy failed!"
echoX "End Script"
exit 1
}

echoX "Please complete the release process by promoting the jar at https://oss.sonatype.org/#stagingRepositories"
}

BASE_DIR="$PWD"
DEPLOY_DIR_ABSOLUTE="$BASE_DIR/filesToDeploy"

rm -r "$DEPLOY_DIR_ABSOLUTE" || true
mkdir "$DEPLOY_DIR_ABSOLUTE"

cd ..
sh ./buildPrebidMobile.sh
cp -r ../generated/* "$DEPLOY_DIR_ABSOLUTE" || true

mavenDeploy $"$BASE_DIR/PrebidMobile-open-measurement-pom.xml" $"$DEPLOY_DIR_ABSOLUTE/omsdk.jar" $"$BASE_DIR/stub.jar" $"$BASE_DIR/stub.jar"

echoX "End Script"
24 changes: 4 additions & 20 deletions scripts/Maven/deployPrebidMobile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,46 +32,30 @@ BASE_DIR="$PWD"
DEPLOY_DIR_NAME="filesToDeploy"
DEPLOY_DIR_ABSOLUTE="$BASE_DIR/$DEPLOY_DIR_NAME"

rm -r $DEPLOY_DIR_ABSOLUTE || true
mkdir $DEPLOY_DIR_ABSOLUTE
rm -r "$DEPLOY_DIR_ABSOLUTE" || true
mkdir "$DEPLOY_DIR_ABSOLUTE"

cd ..
sh ./buildPrebidMobile.sh

cp -r ../generated/* $DEPLOY_DIR_ABSOLUTE || true
cp -r ../generated/* "$DEPLOY_DIR_ABSOLUTE" || true

modules=("PrebidMobile" "PrebidMobile-core" "PrebidMobile-rendering" "PrebidMobile-gamEventHandlers" "PrebidMobile-mopubAdapters")
extensions=("jar" "jar" "aar" "jar" "jar")
for n in ${!modules[@]}; do
#######
# Start
#######

echo -e "\n"
echoX "Deploying ${modules[$n]} on Maven..."

#######
# Deploy
#######
extension="${extensions[$n]}"
module="${modules[$n]}"
if [ $extension == "aar" ]; then
if [ "$extension" == "aar" ]; then
compiledPath=$"$DEPLOY_DIR_ABSOLUTE/aar/${module}-release.aar"
else
compiledPath=$"$DEPLOY_DIR_ABSOLUTE/${module}.jar"
fi
mavenDeploy $"$BASE_DIR/${module}-pom.xml" "$compiledPath" $"$DEPLOY_DIR_ABSOLUTE/${module}-sources.jar" $"$DEPLOY_DIR_ABSOLUTE/${module}-javadoc.jar"

#######
# End
#######
echoX "Please complete the release process by promoting the jar at https://oss.sonatype.org/#stagingRepositories"

done

#######
# Open measurement SDK
#######
mavenDeploy $"$BASE_DIR/PrebidMobile-open-measurement-pom.xml" $"$DEPLOY_DIR_ABSOLUTE/omsdk.jar" $"$BASE_DIR/stub.jar" $"$BASE_DIR/stub.jar"

echoX "End Script"

0 comments on commit 0a8550a

Please sign in to comment.