Skip to content

Commit

Permalink
Updated to make code branch independent
Browse files Browse the repository at this point in the history
  • Loading branch information
genschmitt committed Sep 19, 2024
1 parent 7e33503 commit 94fb352
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# N.B.: this must match the Ruby version in the Gemfile, and /.ruby-version.
FROM --platform=linux/arm64 ruby:3.1.2
FROM ruby:3.1.2

ENV RUBY_ENV=prod
ENV RAILS_LOG_TO_STDOUT=true
Expand Down
1 change: 1 addition & 0 deletions deploy/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.list
18 changes: 18 additions & 0 deletions deploy/ecr-push.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh

if [ $# -lt 1 ]
then
echo "Usage: ecr-push.sh <env>"
exit 1
fi

source deploy/env.sh env-common.list
source deploy/env.sh env-$1.list

# AWS CLI v1
#eval $(aws ecr get-login --no-include-email --region $AWS_REGION --profile $AWS_PROFILE)
# AWS CLI v2
aws ecr get-login-password --region $AWS_REGION | docker login --username AWS --password-stdin $ECR_HOST

docker buildx build --platform linux/arm64 --push \
-t $ECR_HOST/$IMAGE_NAME .
17 changes: 17 additions & 0 deletions deploy/env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
##
# Copies Docker environment variables from one of the Docker variable files
# into shell environment variables.
#

if [ $# -lt 1 ]
then
echo "Usage: env.sh <filename>"
exit 1
fi

while read p; do
if [[ $p != "#"* && $p != "" ]]; then
IFS='=' read -ra parts <<< "$p"
export "${parts[0]}"="${parts[1]}"
fi
done < deploy/$1
9 changes: 0 additions & 9 deletions ecr-push.sh

This file was deleted.

1 change: 1 addition & 0 deletions lib/extractor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ def self.extract(bucket_name, object_key, binary_name, web_id, mime_type)
archive_extractor = ArchiveExtractor.new(bucket_name, object_key, binary_name, web_id, mime_type, sqs, s3_client)
archive_extractor.extract
end

end
3 changes: 2 additions & 1 deletion lib/extractor/extraction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ def extract_features
end
end


def mime_from_path(path)
file = File.open("#{path}")
file_mime_response = MimeMagic.by_path(file).to_s
Expand Down Expand Up @@ -128,7 +129,7 @@ def extract_zip
@status = ExtractionStatus::ERROR
@peek_type = PeekType::NONE
report_problem("problem extracting zip listing for task: #{ex.message}")

#return false
raise ex
end
end
Expand Down

0 comments on commit 94fb352

Please sign in to comment.