Skip to content

Commit

Permalink
OPTIONS request is not supported, changed to GET
Browse files Browse the repository at this point in the history
  • Loading branch information
Matías J. Schilling committed Nov 3, 2023
1 parent 20447f2 commit ecb5fa7
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
FROM circleci/python:latest
FROM ubuntu:20.04

MAINTAINER Mathias Schilling <[email protected]>

ENV APP_PATH /home/circleci/project
RUN apt update
RUN apt --assume-yes install curl
RUN apt --assume-yes install python3

ENV APP_PATH /app

WORKDIR $APP_PATH
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ run: ## Run the container in an interactive shell
@docker run \
--rm \
-it \
--volume ${PWD}:/home/circleci/project \
--volume ${PWD}:/app \
"${STACK_SLUG}:${STACK_VERSION}" bash
2 changes: 1 addition & 1 deletion script/converter/from_csv.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

from datetime import datetime
from entity import Period, Rate, Response
Expand Down
2 changes: 1 addition & 1 deletion script/converter/from_xml.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

from datetime import datetime
from entity import Period, Rate, Response
Expand Down
6 changes: 3 additions & 3 deletions script/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ readonly PROJECT_DIR=$(cd "${SCRIPT_DIR}/.." && pwd)
readonly RATE_DIR=$(cd "${PROJECT_DIR}/rate" && pwd)
readonly README=$(cat "$SCRIPT_DIR/README_TEMPLATE.md")

command -v python version >/dev/null 2>&1 || {
command -v python3 version >/dev/null 2>&1 || {
echo >&2 "Please install python in your path before continuing."
exit 1
}
Expand Down Expand Up @@ -43,10 +43,10 @@ readonly HMRC_URL_01="https://www.trade-tariff.service.gov.uk/api/v2/exchange_ra
readonly HMRC_URL_02="https://www.trade-tariff.service.gov.uk/api/v2/exchange_rates/files/monthly_xml_${NEXT_YYYY}-${NEXT_MM}.XML"
HMRC_URL="${HMRC_URL_01}"

readonly STATUS_CODE_01=$(curl --silent -LI -X OPTIONS "${HMRC_URL_01}" -o /dev/null -w '%{http_code}')
readonly STATUS_CODE_01=$(curl --silent -LI -X GET "${HMRC_URL_01}" -o /dev/null -w '%{http_code}')
if [ "$STATUS_CODE_01" != '200' ]; then

readonly STATUS_CODE_02=$(curl --silent -LI -X OPTIONS "${HMRC_URL_02}" -o /dev/null -w '%{http_code}')
readonly STATUS_CODE_02=$(curl --silent -LI -X GET "${HMRC_URL_02}" -o /dev/null -w '%{http_code}')
if [ "$STATUS_CODE_02" != '200' ]
then
echo "No rates for ${NEXT_YYYY}-${NEXT_MM} available yet."
Expand Down

0 comments on commit ecb5fa7

Please sign in to comment.