-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* test java 11 build * add deploy images to swot cumulus and update readme * update checkout actions * update docker login action version * update changelog --------- Co-authored-by: James Wood <[email protected]>
- Loading branch information
1 parent
a2b3e58
commit 2ed15ab
Showing
9 changed files
with
120 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,7 @@ jobs: | |
# Checks out this repository and sets up the build/test environment with | ||
# gradle | ||
- name: Checkout project sources | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v4 | ||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v2 | ||
|
||
|
@@ -215,12 +215,17 @@ jobs: | |
# NOTE: This step is platform-specific | ||
# These are gradle-specific steps for installing the application | ||
- name: Build Software | ||
env: | ||
VERSION: ${{ env.the_version }} | ||
run: | | ||
rm -rf dist | ||
./gradlew --scan buildArtifact | ||
./gradlew shadowJar | ||
mv build/libs/*.jar build/libs/footprint_${VERSION}.jar | ||
ls -al | ||
ls -al dist/ | ||
ls -al docker/ | ||
ls -al build/libs | ||
ls -al terraform/ | ||
ls -al terraform_deploy/ | ||
|
@@ -298,7 +303,7 @@ jobs: | |
uses: ncipollo/[email protected] | ||
with: | ||
tag: ${{ env.the_version }} | ||
artifacts: "dist/*.zip" | ||
artifacts: "dist/*.zip, build/libs/*.jar" | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
body: "Version ${{ env.the_version }}" | ||
makeLatest: "${{ github.ref == 'refs/heads/main' }}" | ||
|
@@ -309,7 +314,7 @@ jobs: | |
######################################################################### | ||
# Setup docker to build and push images | ||
- name: Log in to the Container registry | ||
uses: docker/login-action@v1 | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
|
@@ -328,7 +333,6 @@ jobs: | |
echo "THE_ENV=${override_env}" >> $GITHUB_ENV | ||
echo "TARGET_ENV_UPPERCASE=${override_env_upper}" >> $GITHUB_ENV | ||
- name: Lower Case Target Env | ||
run: | | ||
original_env_value="${TARGET_ENV_UPPERCASE}" | ||
|
@@ -407,6 +411,24 @@ jobs: | |
create_repo: true | ||
dockerfile: ./docker/Dockerfile | ||
|
||
- name: Upload Docker image to SWOT Cumulus ECR | ||
if: | | ||
github.ref == 'refs/heads/develop' || | ||
github.ref == 'refs/heads/main' || | ||
startsWith(github.ref, 'refs/heads/release') || | ||
github.event.head_commit.message == '/deploy sit' || | ||
github.event.head_commit.message == '/deploy uat' || | ||
github.event.head_commit.message == '/deploy sandbox' | ||
uses: vitr/actions-build-and-upload-to-ecs@master | ||
with: | ||
access_key_id: ${{ secrets[format('AWS_ACCESS_KEY_ID_CUMULUS_SWOT_{0}', env.TARGET_ENV_UPPERCASE)] }} | ||
secret_access_key: ${{ secrets[format('AWS_SECRET_ACCESS_KEY_CUMULUS_SWOT_{0}', env.TARGET_ENV_UPPERCASE)] }} | ||
account_id: ${{ secrets[format('AWS_ACCOUNT_ID_CUMULUS_SWOT_{0}', env.TARGET_ENV_UPPERCASE)] }} | ||
repo: podaac/forge | ||
region: us-west-2 | ||
tags: ${{ env.the_version }} | ||
create_repo: true | ||
dockerfile: ./docker/Dockerfile | ||
|
||
######################################################################### | ||
# Deploy to AWS via Terraform | ||
|
@@ -444,6 +466,6 @@ jobs: | |
cat override.tf.json | ||
echo "End show override contents" | ||
terraform --version | ||
source bin/config.sh ${{ env.venue }} | ||
terraform plan -var-file=tfvars/"${{ env.venue }}".tfvars -var="app_version=${{ env.the_version }}" -out="tfplan" | ||
source bin/config.sh ${{ env.TARGET_ENV_LOWERCASE }} | ||
terraform plan -var-file=tfvars/"${{ env.TARGET_ENV_LOWERCASE }}".tfvars -var="app_version=${{ env.the_version }}" -out="tfplan" | ||
terraform apply -auto-approve tfplan |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import gov.nasa.podaac.forge.Footprinter; | ||
import java.util.Map; | ||
|
||
/** | ||
* A simple command-line interface for the Footprinter class. | ||
*/ | ||
class FootprintCLI { | ||
|
||
public FootprintCLI() { | ||
// Constructor, if needed | ||
} | ||
|
||
public static void main(String[] args) { | ||
if (args.length != 2) { | ||
System.err.println("Usage: java FootprintCLI <granuleFile> <configFile>"); | ||
System.exit(1); | ||
} | ||
|
||
String granuleFile = args[0]; | ||
String configFile = args[1]; | ||
|
||
try { | ||
System.out.println("Processing File"); | ||
Footprinter footprinter = new Footprinter(granuleFile, configFile); | ||
Map<String, String> fp = footprinter.footprint(); | ||
System.out.println("Process retrieved footprint"); | ||
System.out.println(fp.get("FOOTPRINT")); | ||
} catch (Exception e) { | ||
System.err.println("Error processing: " + granuleFile); | ||
// Log the exception or handle it appropriately | ||
e.printStackTrace(System.err); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters