Skip to content

Commit

Permalink
Merge pull request #97 from sul-dlss/cybersource-folio
Browse files Browse the repository at this point in the history
Cybersource cron job for folio
  • Loading branch information
shelleydoljack authored Nov 21, 2023
2 parents 5c173b3 + a2e3fda commit 24369b4
Show file tree
Hide file tree
Showing 26 changed files with 647 additions and 302 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
14 changes: 7 additions & 7 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
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"

gem 'rake'

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
Loading

0 comments on commit 24369b4

Please sign in to comment.