Skip to content

Commit

Permalink
Merge pull request #14790 from transcom/B-21322-INT
Browse files Browse the repository at this point in the history
B-21322 TPPS ECS Scheduled Task - INT
  • Loading branch information
traskowskycaci authored Feb 17, 2025
2 parents 879e40f + 5cd0ee3 commit d481853
Show file tree
Hide file tree
Showing 25 changed files with 1,519 additions and 225 deletions.
2 changes: 2 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1394,6 +1394,8 @@ deploy_tasks_dp3:
- ./scripts/ecs-deploy-task-container save-ghc-fuel-price-data "${ECR_REPOSITORY_URI}/app-tasks@${ECR_DIGEST}" "${APP_ENVIRONMENT}"
- echo "Deploying payment reminder email task service"
- ./scripts/ecs-deploy-task-container send-payment-reminder "${ECR_REPOSITORY_URI}/app-tasks@${ECR_DIGEST}" "${APP_ENVIRONMENT}"
- echo "Deploying process TPPS task service"
- ./scripts/ecs-deploy-task-container process-tpps "${ECR_REPOSITORY_URI}/app-tasks@${ECR_DIGEST}" "${APP_ENVIRONMENT}"
after_script:
- *announce_failure
rules:
Expand Down
4 changes: 4 additions & 0 deletions Dockerfile.tasks_dp3
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,8 @@ COPY bin/rds-ca-rsa4096-g1.pem /bin/rds-ca-rsa4096-g1.pem

COPY bin/milmove-tasks /bin/milmove-tasks

# Mount mutable tmp for process-tpps
# hadolint ignore=DL3007
VOLUME ["/tmp"]

WORKDIR /bin
16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,22 @@ tasks_process_edis: tasks_build_linux_docker ## Run process-edis from inside doc
$(TASKS_DOCKER_CONTAINER):latest \
milmove-tasks process-edis

.PHONY: tasks_process_tpps
tasks_process_tpps: tasks_build_linux_docker ## Run process-tpps from inside docker container
@echo "Processing TPPS files with docker command..."
DB_NAME=$(DB_NAME_DEV) DB_DOCKER_CONTAINER=$(DB_DOCKER_CONTAINER_DEV) scripts/wait-for-db-docker
docker run \
-t \
-e DB_HOST="database" \
-e DB_NAME \
-e DB_PORT \
-e DB_USER \
-e DB_PASSWORD \
--link="$(DB_DOCKER_CONTAINER_DEV):database" \
--rm \
$(TASKS_DOCKER_CONTAINER):latest \
milmove-tasks process-tpps

.PHONY: tasks_save_ghc_fuel_price_data
tasks_save_ghc_fuel_price_data: tasks_build_linux_docker ## Run save-ghc-fuel-price-data from inside docker container
@echo "Saving the fuel price data to the ${DB_NAME_DEV} database with docker command..."
Expand Down
1 change: 1 addition & 0 deletions cmd/ecs-deploy/put_target.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ var names = []string{
"connect-to-gex-via-sftp",
"post-file-to-gex",
"process-edis",
"process-tpps",
"save-ghc-fuel-price-data",
"send-payment-reminder",
}
Expand Down
1 change: 1 addition & 0 deletions cmd/ecs-deploy/task_def.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ var servicesToEntryPoints = map[string][]string{
fmt.Sprintf("%s connect-to-gex-via-sftp", binMilMoveTasks),
fmt.Sprintf("%s post-file-to-gex", binMilMoveTasks),
fmt.Sprintf("%s process-edis", binMilMoveTasks),
fmt.Sprintf("%s process-tpps", binMilMoveTasks),
fmt.Sprintf("%s save-ghc-fuel-price-data", binMilMoveTasks),
fmt.Sprintf("%s send-payment-reminder", binMilMoveTasks),
},
Expand Down
10 changes: 10 additions & 0 deletions cmd/milmove-tasks/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,16 @@ func main() {
initConnectToGEXViaSFTPFlags(processEDIsCommand.Flags())
root.AddCommand(processEDIsCommand)

processTPPSCommand := &cobra.Command{
Use: "process-tpps",
Short: "process TPPS files asynchrounously",
Long: "process TPPS files asynchrounously",
RunE: processTPPS,
SilenceUsage: true,
}
initProcessTPPSFlags(processTPPSCommand.Flags())
root.AddCommand(processTPPSCommand)

completionCommand := &cobra.Command{
Use: "completion",
Short: "Generates bash completion scripts",
Expand Down
11 changes: 0 additions & 11 deletions cmd/milmove-tasks/process_edis.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,16 +244,5 @@ func processEDIs(_ *cobra.Command, _ []string) error {
logger.Info("Successfully processed EDI824 application advice responses")
}

// Pending completion of B-20560, uncomment the code below
/*
// Process TPPS paid invoice report
pathTPPSPaidInvoiceReport := v.GetString(cli.SFTPTPPSPaidInvoiceReportPickupDirectory)
_, err = syncadaSFTPSession.FetchAndProcessSyncadaFiles(appCtx, pathTPPSPaidInvoiceReport, lastReadTime, invoice.NewTPPSPaidInvoiceReportProcessor())
if err != nil {
logger.Error("Error reading TPPS Paid Invoice Report application advice responses", zap.Error(err))
} else {
logger.Info("Successfully processed TPPS Paid Invoice Report application advice responses")
}
*/
return nil
}
Loading

0 comments on commit d481853

Please sign in to comment.