Skip to content

Commit

Permalink
Card payment report using accounts data from FOLIO, run as rake task
Browse files Browse the repository at this point in the history
  • Loading branch information
jgreben committed Nov 8, 2023
1 parent 5c173b3 commit 09283b4
Show file tree
Hide file tree
Showing 26 changed files with 611 additions and 295 deletions.
44 changes: 36 additions & 8 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
name: CI
name: PushImage

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
on: push

permissions:
contents: read
packages: write

env:
OKAPI_URL: http://okapi:9130
SLEEP: 0

jobs:
test:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Ruby
Expand All @@ -23,3 +25,29 @@ jobs:
run: bundle exec rspec
- name: Verify output file
run: cat spec/fixtures/report_file.csv

build-and-push-image:
runs-on: ubuntu-latest
steps:

- name: Extract branch name
id: extract_branch
run: echo "::set-output name=branch::$(echo ${GITHUB_REF#refs/heads/})"

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1

- name: Log in to the Container registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build image and push to Docker Hub and GitHub Container Registry
uses: docker/build-push-action@v2
with:
push: true
tags: ghcr.io/sul-dlss/cybersource-rest-ruby:${{ steps.extract_branch.outputs.branch }}
file: Dockerfile
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/config/settings/dev.yml
/config/settings/prod.yml
/log/*
*.csv
secret.yaml
12 changes: 0 additions & 12 deletions Capfile

This file was deleted.

49 changes: 0 additions & 49 deletions CyberSource/download_payment_batch_detail_report.rb

This file was deleted.

20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM ruby:2.7.1

USER root

# Install and setup mail
RUN apt update
RUN apt-get install -y bsd-mailx
RUN apt-get install -y sendmail

WORKDIR /etc/mail

RUN echo \"AuthInfo:smtp.domain.com "U:USERNAME" "P:PASSWORD" "M:PLAIN"\" > authinfo
RUN makemap hash authinfo < authinfo
RUN make

WORKDIR /home/cybersource

COPY . .

RUN bundle install
12 changes: 5 additions & 7 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
source 'https://rubygems.org'
ruby '2.7.1'

gem 'config'
gem 'cybersource_rest_client', '0.0.31'

gem "folio_client", "~> 0.13.0"

gem "mail", "~> 2.8"

group :development, :test do
gem 'byebug'
gem 'rspec'
gem 'rubocop'
gem 'rubocop-performance'
gem 'rubocop-rspec'
gem 'webmock'
end

group :deployment do
gem 'capistrano'
gem 'capistrano-bundler'
gem 'capistrano-shared_configs'
gem 'dlss-capistrano'
end
137 changes: 59 additions & 78 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,116 +7,93 @@ GEM
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
airbrussh (1.4.1)
sshkit (>= 1.6.1, != 1.7.0)
addressable (2.8.5)
public_suffix (>= 2.0.2, < 6.0)
ast (2.4.2)
base64 (0.1.1)
bundler-audit (0.9.1)
bundler (>= 1.2.0, < 3)
thor (~> 1.0)
byebug (11.1.3)
capistrano (3.17.3)
airbrussh (>= 1.0.0)
i18n
rake (>= 10.0.0)
sshkit (>= 1.9.0)
capistrano-bundle_audit (0.4.0)
bundler-audit (~> 0.5)
capistrano (~> 3.0)
capistrano-bundler (>= 1.4)
capistrano-bundler (2.1.0)
capistrano (~> 3.1)
capistrano-one_time_key (0.1.0)
capistrano (~> 3.0)
capistrano-shared_configs (0.2.2)
concurrent-ruby (1.2.2)
config (4.2.1)
deep_merge (~> 1.2, >= 1.2.1)
dry-validation (~> 1.0, >= 1.0.0)
crack (0.4.5)
rexml
cybersource_rest_client (0.0.31)
activesupport (~> 6.0, >= 6.0.3.2)
addressable (~> 2.3, >= 2.3.0)
interface (~> 1.0, >= 1.0.4)
json (~> 2.1, >= 2.1.0)
jwt (~> 2.1.0)
typhoeus (~> 1.0, >= 1.0.1)
deep_merge (1.2.2)
date (3.3.3)
diff-lcs (1.5.0)
dlss-capistrano (4.4.0)
capistrano (~> 3.0)
capistrano-bundle_audit (>= 0.3.0)
capistrano-one_time_key
capistrano-shared_configs
dry-configurable (1.0.1)
dry-core (~> 1.0, < 2)
zeitwerk (~> 2.6)
dry-core (1.0.0)
concurrent-ruby (~> 1.0)
zeitwerk (~> 2.6)
dry-inflector (1.0.0)
dry-initializer (3.1.1)
dry-logic (1.5.0)
concurrent-ruby (~> 1.0)
dry-core (~> 1.0, < 2)
zeitwerk (~> 2.6)
dry-schema (1.13.3)
concurrent-ruby (~> 1.0)
dry-configurable (~> 1.0, >= 1.0.1)
dry-core (~> 1.0, < 2)
dry-initializer (~> 3.0)
dry-logic (>= 1.4, < 2)
dry-types (>= 1.7, < 2)
zeitwerk (~> 2.6)
dry-types (1.7.1)
concurrent-ruby (~> 1.0)
dry-core (~> 1.0)
dry-inflector (~> 1.0)
dry-logic (~> 1.4)
zeitwerk (~> 2.6)
dry-validation (1.10.0)
dry-monads (1.6.0)
concurrent-ruby (~> 1.0)
dry-core (~> 1.0, < 2)
dry-initializer (~> 3.0)
dry-schema (>= 1.12, < 2)
zeitwerk (~> 2.6)
ethon (0.15.0)
ethon (0.16.0)
ffi (>= 1.15.0)
ffi (1.15.5)
faraday (2.7.11)
base64
faraday-net_http (>= 2.0, < 3.1)
ruby2_keywords (>= 0.0.4)
faraday-net_http (3.0.2)
ffi (1.16.3)
folio_client (0.13.0)
activesupport (>= 4.2, < 8)
dry-monads
faraday
marc
zeitwerk
hashdiff (1.0.1)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
interface (1.0.5)
json (2.6.3)
jwt (2.1.0)
language_server-protocol (3.17.0.3)
minitest (5.19.0)
net-scp (4.0.0)
net-ssh (>= 2.6.5, < 8.0.0)
net-ssh (7.1.0)
mail (2.8.1)
mini_mime (>= 0.1.1)
net-imap
net-pop
net-smtp
marc (1.2.0)
rexml
scrub_rb (>= 1.0.1, < 2)
unf
mini_mime (1.1.5)
minitest (5.20.0)
net-imap (0.3.7)
date
net-protocol
net-pop (0.1.2)
net-protocol
net-protocol (0.2.1)
timeout
net-smtp (0.4.0)
net-protocol
parallel (1.23.0)
parser (3.2.2.4)
ast (~> 2.4.1)
racc
public_suffix (4.0.6)
public_suffix (5.0.3)
racc (1.7.1)
rainbow (3.1.1)
rake (13.0.6)
regexp_parser (2.8.2)
rexml (3.2.6)
rspec (3.12.0)
rspec-core (~> 3.12.0)
rspec-expectations (~> 3.12.0)
rspec-mocks (~> 3.12.0)
rspec-core (3.12.0)
rspec-core (3.12.2)
rspec-support (~> 3.12.0)
rspec-expectations (3.12.0)
rspec-expectations (3.12.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-mocks (3.12.0)
rspec-mocks (3.12.6)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-support (3.12.0)
rspec-support (3.12.1)
rubocop (1.57.1)
base64 (~> 0.1.1)
json (~> 2.3)
Expand All @@ -143,35 +120,39 @@ GEM
rubocop-capybara (~> 2.17)
rubocop-factory_bot (~> 2.22)
ruby-progressbar (1.13.0)
sshkit (1.21.4)
net-scp (>= 1.1.2)
net-ssh (>= 2.8.0)
thor (1.2.1)
ruby2_keywords (0.0.5)
scrub_rb (1.0.1)
timeout (0.4.0)
typhoeus (1.4.0)
ethon (>= 0.9.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unf (0.1.4)
unf_ext
unf_ext (0.0.8.2)
unicode-display_width (2.5.0)
webmock (3.19.1)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
zeitwerk (2.6.12)

PLATFORMS
ruby

DEPENDENCIES
byebug
capistrano
capistrano-bundler
capistrano-shared_configs
config
cybersource_rest_client (= 0.0.31)
dlss-capistrano
folio_client (~> 0.13.0)
mail (~> 2.8)
rspec
rubocop
rubocop-performance
rubocop-rspec
webmock

RUBY VERSION
ruby 2.7.1p83

BUNDLED WITH
2.1.4
2.3.22
Loading

0 comments on commit 09283b4

Please sign in to comment.