Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to node 20 #182

Merged
merged 2 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['18']
node-version: ['20']
python-version: ['3.12']
env:
TM_NTT_CERT_ARN: ${{ secrets.TM_NTT_CERT_ARN }}
Expand All @@ -19,11 +19,11 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Set up Node ${{ matrix.node-version }}.x
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Check if package-lock.json is up to date
Expand Down Expand Up @@ -52,4 +52,4 @@ jobs:
run: |
curl -sSL https://install.python-poetry.org | python3 -
npm ci
cd devops && bash ./deploy.sh -p -c
cd devops && bash ./deploy.sh -p
10 changes: 5 additions & 5 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['18']
node-version: ['20']
python-version: ['3.12']
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Set up Node ${{ matrix.node-version }}.x
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Check if package-lock.json is up to date
Expand All @@ -37,7 +37,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['18']
node-version: ['20']
python-version: ['3.12']
steps:
- name: Checkout repo
Expand All @@ -47,7 +47,7 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- name: Set up Node ${{ matrix.node-version }}.x
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Check if package-lock.json is up to date
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Shows new MBTA Orange, Red, and Green Line trains as they come into service.

## Install & Run
Dependencies:
- `node 18.x` (with `npm 9.x`)
- `node 20.x` (with `npm 10.x`)
- `python 3.12`
- [`poetry`](https://python-poetry.org/)
- Ensure `poetry` is using the correct Python version by running `poetry env use <your python3.12 binary>`
Expand Down
4 changes: 2 additions & 2 deletions devops/deploy-playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
url: https://deb.nodesource.com/gpgkey/nodesource.gpg.key
state: present

- name: add nodejs 18.x ppa for apt repo
- name: add nodejs 20.x ppa for apt repo
become: yes
become_user: root
apt_repository:
repo: deb https://deb.nodesource.com/node_18.x focal main
repo: deb https://deb.nodesource.com/node_20.x focal main
update_cache: yes

- name: install nodejs
Expand Down
9 changes: 3 additions & 6 deletions devops/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,15 @@ export AWS_DEFAULT_REGION=us-east-1
export AWS_PAGER=""

PRODUCTION=false
CI=false

# Argument parsing
# pass "-p" flag to deploy to production
# pass "-c" flag if deploying with CI

while getopts "pc" opt; do
case $opt in
p)
PRODUCTION=true
;;
c)
CI=true
;;
esac
done

Expand All @@ -31,7 +26,7 @@ $PRODUCTION && CERT_ARN="$TM_NTT_CERT_ARN" || CERT_ARN="$TM_LABS_WILDCARD_CERT_A

$PRODUCTION && STACK_NAME="ntt" || STACK_NAME="ntt-beta"

echo "Deploying Train Tracker to $HOSTNAME..."
echo "Deploying Train Tracker CloudFormation stack to $HOSTNAME..."
echo "View stack log here: https://$AWS_REGION.console.aws.amazon.com/cloudformation/home?region=$AWS_REGION"

aws cloudformation deploy --stack-name $STACK_NAME \
Expand All @@ -45,7 +40,9 @@ aws cloudformation deploy --stack-name $STACK_NAME \

# Look up the physical ID of the EC2 instance currently associated with the stack
INSTANCE_PHYSICAL_ID=$(aws cloudformation list-stack-resources --stack-name $STACK_NAME --query "StackResourceSummaries[?LogicalResourceId=='NTTInstance'].PhysicalResourceId" --output text)

# Run the playbook! :-)
echo "Deploying the New Train Tracker to $INSTANCE_PHYSICAL_ID via Ansible..."
export ANSIBLE_HOST_KEY_CHECKING=False # If it's a new host, ssh known_hosts not having the key fingerprint will cause an error. Silence it
SSH_PROXY_ARGS="-o ProxyCommand='aws ec2-instance-connect open-tunnel --instance-id $INSTANCE_PHYSICAL_ID'"
ansible-playbook -v --ssh-extra-args "$SSH_PROXY_ARGS" -i $INSTANCE_PHYSICAL_ID, -u ubuntu --private-key ~/.ssh/transitmatters-ntt.pem deploy-playbook.yml
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"url": "https://github.com/transitmatters/new-train-tracker/issues"
},
"engines": {
"node": "18.x"
"node": "20.x"
},
"homepage": "https://github.com/transitmatters/new-train-tracker#readme",
"dependencies": {
Expand Down
Loading