Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate deploy file for Open Measurement SDK #321

Merged
merged 1 commit into from
Dec 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"