diff --git a/scripts/build b/scripts/build index a3b7021..4d4e327 100755 --- a/scripts/build +++ b/scripts/build @@ -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 \ No newline at end of file diff --git a/scripts/post-process b/scripts/post-process deleted file mode 100755 index 3119f7d..0000000 --- a/scripts/post-process +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -set -eu -o pipefail - -pwd && ls && ls target - -JAR_NAME=$1 - -UNZIP_DIR="/home/circleci/project/target/unzipped" -mkdir -p $UNZIP_DIR - -# Extract the JAR into the specified directory -cd $UNZIP_DIR -jar -xf /home/circleci/project/$JAR_NAME -cd - - -# Modify the specific file -FILE_TO_MODIFY="$UNZIP_DIR/trdm/returntableservice/ReturnTable.java" # This holds the hard coded circleci values from codegen -ORIG_PATH="file:/home/circleci/project/src/main/resources/ReturnTableV7.wsdl" # This is the hard coded circleci value from codegen -NEW_PATH="classpath:ReturnTableV7.wsdl" # Replacing it with classpath - -sed -i "s|$ORIG_PATH|$NEW_PATH|g" $FILE_TO_MODIFY # Update the values within the file. (There are 3) - -# Re-zip into a JAR -cd $UNZIP_DIR -jar -cf /home/circleci/project/$JAR_NAME . -cd - \ No newline at end of file diff --git a/scripts/release b/scripts/release index 2e0397f..ba40e53 100755 --- a/scripts/release +++ b/scripts/release @@ -4,17 +4,16 @@ set -e -o pipefail # Setup/how to run usage() { - echo "Usage: $0 " + echo "Usage: $0 " 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}" \ No newline at end of file +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}" diff --git a/src/main/resources/ReturnTableV7.stg.wsdl b/src/main/resources/ReturnTableV7.stg.wsdl new file mode 100644 index 0000000..4eb1635 --- /dev/null +++ b/src/main/resources/ReturnTableV7.stg.wsdl @@ -0,0 +1,538 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/template.yml b/template.yml index 0d0ad44..9206fd0 100644 --- a/template.yml +++ b/template.yml @@ -6,7 +6,7 @@ Globals: Timeout: 900 Resources: - ProfileApiFunction: + SoapProxyFunction: Type: AWS::Serverless::Function Properties: CodeUri: . @@ -22,7 +22,7 @@ Resources: Variables: JAVA_TOOL_OPTIONS: -XX:+TieredCompilation -XX:TieredStopAtLevel=1 Events: - HelloWorld: + SoapProxyApiEvent: Type: Api Properties: Path: /{proxy+}