Skip to content

Commit cff3b54

Browse files
committed
update base image and dependencies
1 parent a0e4254 commit cff3b54

File tree

16 files changed

+4409
-5172
lines changed

16 files changed

+4409
-5172
lines changed

.circleci/config.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@ install_deploysuite: &install_deploysuite
2020
cp ./../buildscript/master_deploy.sh .
2121
cp ./../buildscript/buildenv.sh .
2222
cp ./../buildscript/awsconfiguration.sh .
23+
24+
restore_cache_settings_for_build: &restore_cache_settings_for_build
25+
key: docker-node-modules-{{ checksum "yarn.lock" }}
26+
27+
save_cache_settings: &save_cache_settings
28+
key: docker-node-modules-{{ checksum "yarn.lock" }}
29+
paths:
30+
- node_modules
31+
2332
run_build: &run_build
2433
name: Installation of build dependencies.
2534
command: ./build.sh
@@ -35,9 +44,12 @@ jobs:
3544
- setup_remote_docker
3645
- run: *install_dependency
3746
- run: *install_deploysuite
47+
- restore_cache: *restore_cache_settings_for_build
3848
- run: *run_build
49+
- save_cache: *save_cache_settings
3950

4051
- deploy:
52+
name: Running MasterScript.
4153
command: "./awsconfiguration.sh DEV\nsource awsenvconf \n./buildenv.sh -e DEV -b submission-processor-es_deployvar\nsource buildenvvar\n./master_deploy.sh -d ECS -e DEV -t latest -s dev-global-appvar,submission-processor-es_appvar -i submission-processor-es\n#magic___^_^___line\n#magic___^_^___line\n"
4254
"build-prod":
4355
!!merge <<: *defaults
@@ -47,8 +59,11 @@ jobs:
4759
- setup_remote_docker
4860
- run: *install_dependency
4961
- run: *install_deploysuite
62+
- restore_cache: *restore_cache_settings_for_build
5063
- run: *run_build
64+
- save_cache: *save_cache_settings
5165
- deploy:
66+
name: Running MasterScript.
5267
command: "./awsconfiguration.sh PROD\nsource awsenvconf \n./buildenv.sh -e PROD -b submission-processor-es_deployvar\nsource buildenvvar\n./master_deploy.sh -d ECS -e PROD -t latest -s prod-global-appvar,submission-processor-es_appvar -i submission-processor-es\n"
5368
workflows:
5469
version: 2

.eslintrc.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
env:
2+
browser: true
3+
commonjs: true
4+
es2021: true
5+
mocha: true
6+
extends: standard
7+
parserOptions:
8+
ecmaVersion: latest
9+
rules: {}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This processor only writes to ElasticSearch. It deals with the create, update an
44

55
## Dependencies
66

7-
- nodejs https://nodejs.org/en/ (v8+)
7+
- nodejs https://nodejs.org/en/ (v18+)
88
- Kafka
99
- ElasticSearch
1010
- Docker, Docker Compose

build.sh

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
11
#!/bin/bash
22
set -eo pipefail
3-
#ENV=$1
4-
#AWS_ACCOUNT_ID=$(eval "echo \$${ENV}_AWS_ACCOUNT_ID")
5-
#AWS_REGION=$(eval "echo \$${ENV}_AWS_REGION")
6-
#AWS_REPOSITORY=$(eval "echo \$${ENV}_AWS_REPOSITORY")
7-
8-
# Builds Docker image of the app.
9-
#TAG=$AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/$AWS_REPOSITORY:$CIRCLE_BUILD_NUM
10-
#sed -i='' "s|submission-processor-es:latest|$TAG|" docker/docker-compose.yml
3+
UPDATE_CACHE=""
114
echo "" > docker/api.env
125
docker-compose -f docker/docker-compose.yml build submission-processor-es
13-
docker images
6+
docker create --name app submission-processor-es:latest
7+
8+
if [ -d node_modules ]
9+
then
10+
mv yarn.lock old-yarn.lock
11+
docker cp app:/submission-processor-es/yarn.lock yarn.lock
12+
set +eo pipefail
13+
UPDATE_CACHE=$(cmp yarn.lock old-yarn.lock)
14+
set -eo pipefail
15+
else
16+
UPDATE_CACHE=1
17+
fi
18+
19+
if [ "$UPDATE_CACHE" == 1 ]
20+
then
21+
docker cp app:/submission-processor-es/node_modules .
22+
fi

docker/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Use the base image with Node.js 8.11.3
2-
FROM node:8.11.3
1+
# Use the base image with Node.js 18.16.1
2+
FROM node:18.16.1
33

44
# Copy the current directory into the Docker image
55
COPY . /submission-processor-es
@@ -8,5 +8,5 @@ COPY . /submission-processor-es
88
WORKDIR /submission-processor-es
99

1010
# Install the dependencies from package.json
11-
RUN npm install
12-
CMD npm start
11+
RUN yarn install
12+
CMD node src/app.js

0 commit comments

Comments
 (0)