Skip to content

Commit

Permalink
Updated build and release files to reflect new sam building and zippi…
Browse files Browse the repository at this point in the history
…ng for stg and prd based on wsdl. Remoed unneeded scripts. Renamed sam template function names. Added new stg wsdl.
  • Loading branch information
cameroncaci committed Nov 1, 2023
1 parent 061052d commit c9ec078
Show file tree
Hide file tree
Showing 5 changed files with 554 additions and 51 deletions.
27 changes: 10 additions & 17 deletions scripts/build
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,20 @@

set -eu -o pipefail

# Extract artifact ID and version from pom.xml
ARTIFACT_ID=$(mvn org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \
-Dexpression=project.artifactId -q -DforceStdout)

VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \
-Dexpression=project.version -q -DforceStdout)

# Set Jar Name
JAR_NAME="target/$ARTIFACT_ID-$VERSION.jar"

# Announce
echo "Packaging $JAR_NAME..."

# Clean and package via maven, creating the jar file that will match JAR_NAME
mvn clean package
echo "Packaging..."

# Post process cleanup (Required due to the CXF codegen plugin hard coding paths)
# scripts/post-process $JAR_NAME
# Build via sam
sam build
# Zip prd
zip -r deployment-package.prd.zip .aws-sam/build/SoapProxyFunction
# Overwrite build wsdl and then zip stg
cp -f .aws-sam/build/SoapProxyFunction/ReturnTableV7.stg.wsdl .aws-sam/build/SoapProxyFunction/ReturnTableV7.wsdl
zip -r deployment-package.stg.zip .aws-sam/build/SoapProxyFunction

# Announce and calculate checksum
echo "Packaging complete, saving as artifact."
echo "Calculating checksum."
sha512sum $JAR_NAME > checksums.txt
sha512sum deployment-package.stg.zip > stg-checksums.txt
sha512sum deployment-package.prd.zip > prd-checksums.txt
ls
27 changes: 0 additions & 27 deletions scripts/post-process

This file was deleted.

9 changes: 4 additions & 5 deletions scripts/release
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@ set -e -o pipefail

# Setup/how to run
usage() {
echo "Usage: $0 <GITHUB_USER> <GITHUB_REPO> <NEW_TAG> <JAR_NAME>"
echo "Usage: $0 <GITHUB_USER> <GITHUB_REPO> <NEW_TAG>"
exit 1
}

[[ -z $1 || -z $2 || -z $3 || -z $4 ]] && usage
[[ -z $1 || -z $2 || -z $3 ]] && usage
set -u

readonly GITHUB_USER=$1
readonly GITHUB_REPO=$2
readonly NEW_TAG=$3
readonly JAR_NAME=$4

gh release upload --clobber --repo "${GITHUB_USER}/${GITHUB_REPO}" $NEW_TAG $JAR_NAME checksums.txt
echo "Uploaded zipfile and checksums to GitHub Release with tag ${NEW_TAG}"
gh release upload --clobber --repo "${GITHUB_USER}/${GITHUB_REPO}" $NEW_TAG deployment-package.stg.zip stg-checksums.txt deployment-package.prd.zip prd-checksums.txt
echo "Uploaded zipfiles and checksums to GitHub Release with tag ${NEW_TAG}"
Loading

0 comments on commit c9ec078

Please sign in to comment.