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

ci: build fix #108

Open
wants to merge 9 commits into
base: dev
Choose a base branch
from
Open
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
38 changes: 19 additions & 19 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2
python_env: &python_env
docker:
- image: cimg/python:3.11.0-browsers

install_awscli: &install_awscli
name: "Install awscli"
command: |
Expand All @@ -11,13 +11,13 @@ install_awscli: &install_awscli
sudo apt install python3-pip
sudo pip3 install awscli --upgrade
install_deploysuite: &install_deploysuite
name: Installation of install_deploysuite.
command: |
git clone --branch v1.4.15 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript
cp ./../buildscript/master_deploy.sh .
cp ./../buildscript/buildenv.sh .
cp ./../buildscript/awsconfiguration.sh .
name: Installation of install_deploysuite.
command: |
git clone --branch v1.4.15 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript
cp ./../buildscript/master_deploy.sh .
cp ./../buildscript/buildenv.sh .
cp ./../buildscript/awsconfiguration.sh .

# Instructions of deployment
deploy_steps: &deploy_steps
- checkout
Expand All @@ -28,7 +28,7 @@ deploy_steps: &deploy_steps
- setup_remote_docker
- run: cd consumer && docker build -t tc-connect2sf:latest .
- deploy:
name: "Running Masterscript - deploy tc-connect2sf "
name: "Running Masterscript - deploy tc-connect2sf "
command: |
# cd consumer
./awsconfiguration.sh $DEPLOY_ENV
Expand All @@ -48,18 +48,18 @@ deploy_steps: &deploy_steps
./buildenv.sh -e $DEPLOY_ENV -b ${VAR_ENV}-tc-connect2sf-salesforce-consumers-deployvar
source buildenvvar
./master_deploy.sh -d ECS -e $DEPLOY_ENV -t latest -s ${VAR_ENV}-global-appvar,${VAR_ENV}-tc-connect2sf-service-appvar -i tc-connect2sf

jobs:
test:
docker:
- image: circleci/node:8.9.4
- image: cimg/node:14.20
environment:
LOG_LEVEL: debug
steps:
- checkout
- restore_cache:
key: test-node-modules-{{ checksum "consumer/package.json" }}
- run: cd consumer && npm install
- run: cd consumer && yarn install
- save_cache:
key: test-node-modules-{{ checksum "consumer/package.json" }}
paths:
Expand All @@ -71,7 +71,7 @@ jobs:
root: .
paths:
- consumer/node_modules

deployProd:
<<: *python_env
environment:
Expand All @@ -84,24 +84,24 @@ jobs:
environment:
DEPLOY_ENV: "DEV"
VAR_ENV: "dev"
steps: *deploy_steps
steps: *deploy_steps

workflows:
version: 2
build:
jobs:
- test
- deployDev:
context : org-global
context: org-global
requires:
- test
filters:
branches:
only: ['dev']
only: ["dev", "ci/build-fix"]
- deployProd:
context : org-global
context: org-global
requires:
- test
filters:
branches:
only: ['master']
only: ["master"]
23 changes: 5 additions & 18 deletions consumer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,33 +1,20 @@
FROM node:6.9.4
# Base Image
FROM node:14.21.3
LABEL version="1.0"
LABEL description="Topcoder Salesforce Integration"

RUN sed -i '/jessie-updates/d' /etc/apt/sources.list
RUN sed -i 's|security.debian.org|archive.debian.org/debian-security|' /etc/apt/sources.list
RUN sed -i 's/deb.debian/archive.debian/' /etc/apt/sources.list

RUN apt-get update && \
apt-get upgrade -y --force-yes

#RUN apt-get install cron -y


# Create app directory
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app

# Bundle app source
COPY . /usr/src/app
# Install app dependencies
RUN npm install

RUN npm install -g forever babel-cli

#RUN crontab config/scheduler-cron
# Install app dependencies
RUN yarn install

#RUN service cron start
RUN yarn global add forever babel-cli

EXPOSE 3000

ENTRYPOINT ["npm","run"]
# CMD forever -c "npm start" --uid "consumer" .
10 changes: 5 additions & 5 deletions consumer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,27 +128,27 @@ Your aws region, key id and secret must match settings from `config` and `creden
## Starting

Install dependencies:
`npm install`
`yarn install`


Prod mode:
`npm start`
`yarn start`

It's recommenced to use tools like forever or pm2.
App will exit if there is any connection error to RabbitMQ.

See https://www.npmjs.com/package/forever
Example:
```
forever start -c "npm start" --uid "consumer" .
forever start -c "yarn start" --uid "consumer" .
```

See https://www.npmjs.com/package/pm2
Example:
```
pm2 start npm --name consumer -- start
pm2 start yarn --name consumer -- start
```
it will run a command `npm start` and set name to process `consumer`
it will run a command `yarn start` and set name to process `consumer`


Dev/local mode (auto reload + debug):
Expand Down
11 changes: 8 additions & 3 deletions consumer/deploy/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
FROM node:6
# Base Image
FROM node:14.21.3

# Set working directory
WORKDIR /app

# Copy files to the working directory
COPY config config
COPY package.json .
COPY src src
COPY .babelrc .
COPY .eslintignore .
COPY .eslintrc .

RUN npm install
# Install dependencies
RUN yarn install

CMD npm start
# Command to start the app
CMD yarn start
Loading