Skip to content

Commit d8db4a3

Browse files
committed
Merge branch 'dev-circleci' into develop
2 parents 6681046 + 1b38ddc commit d8db4a3

File tree

4 files changed

+55
-1
lines changed

4 files changed

+55
-1
lines changed

.circleci/config.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
version: 2
2+
3+
jobs:
4+
# Build & Deploy against development backend
5+
"build-dev":
6+
docker:
7+
- image: docker:18.06.0-ce-git
8+
steps:
9+
# Initialization.
10+
- checkout
11+
- setup_remote_docker
12+
- run:
13+
name: Installation of build dependencies.
14+
command: |
15+
apk add --no-cache bash
16+
apk add --no-cache jq py-pip sudo curl
17+
pip install --upgrade pip
18+
sudo pip install awscli --upgrade
19+
sudo curl -o /usr/local/bin/ecs-cli https://s3.amazonaws.com/amazon-ecs-cli/ecs-cli-linux-amd64-latest
20+
sudo pip install docker-compose
21+
sudo chmod +x /usr/local/bin/ecs-cli
22+
- run:
23+
name: Installation of build dependencies.
24+
command: ./build.sh DEV
25+
- deploy:
26+
command: |
27+
git clone --branch master https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript
28+
cp ./../buildscript/master_deply_v4.2.sh .
29+
./master_deply_v4.2.sh -d ECS -e DEV -t $CIRCLE_BUILD_NUM -s submission-processor-es
30+
31+
32+
workflows:
33+
version: 2
34+
build:
35+
jobs:
36+
# Development builds are executed on "develop" branch only.
37+
- "build-dev":
38+
filters:
39+
branches:
40+
only: dev-circleci

build.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
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
11+
echo "" > docker/api.env
12+
docker-compose -f docker/docker-compose.yml build submission-processor-es
13+
docker images

docker/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ WORKDIR /submission-processor-es
99

1010
# Install the dependencies from package.json
1111
RUN npm install
12+
CMD npm start

docker/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
version: '3'
22
services:
33
submission-processor-es:
4+
image: submission-processor-es:latest
45
build:
56
context: ../
67
dockerfile: docker/Dockerfile
78
env_file:
89
- api.env
9-
command: npm start
1010
network_mode: "host"

0 commit comments

Comments
 (0)