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

Circleci project setup #228

Closed
Closed
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
61 changes: 61 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# This config was automatically generated from your source code
# Stacks detected: cicd:github-actions:.github/workflows,deps:node:udagram-frontend
version: 2.1
orbs:
node: circleci/node@5
jobs:
test-node:
# Install node dependencies and run tests
executor: node/default
working_directory: ~/project/udagram-frontend
steps:
- checkout:
path: ~/project
- node/install-packages:
pkg-manager: npm
- run:
name: Run tests
command: npm test --passWithNoTests
build-node:
# Build node project
executor: node/default
working_directory: ~/project/udagram-frontend
steps:
- checkout:
path: ~/project
- node/install-packages:
pkg-manager: npm
- run:
command: npm run build
- run:
name: Create the ~/artifacts directory if it doesn't exist
command: mkdir -p ~/artifacts
# Copy output to artifacts dir
- run:
name: Copy artifacts
command: cp -R build dist public .output .next .docusaurus ~/artifacts 2>/dev/null || true
- store_artifacts:
path: ~/artifacts
destination: node-build
deploy:
# This is an example deploy job, not actually used by the workflow
docker:
- image: cimg/base:stable
steps:
# Replace this with steps to deploy to users
- run:
name: deploy
command: '#e.g. ./deploy.sh'
- run:
name: found github actions config
command: ':'
workflows:
build-and-test:
jobs:
- test-node
- build-node:
requires:
- test-node
# - deploy:
# requires:
# - build-node
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ venv/
.elasticbeanstalk/*
!.elasticbeanstalk/*.cfg.yml
!.elasticbeanstalk/*.global.yml
set_env.sh
18 changes: 18 additions & 0 deletions docker-compose-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: "3"
services:
reverseproxy:
build:
context: ./udagram-reverseproxy
image: reverseproxy
backend_user:
build:
context: ./udagram-api-user
image: udagram-api-user
backend_feed:
build:
context: ./udagram-api-feed
image: udagram-api-feed
frontend:
build:
context: ./udagram-frontend
image: udagram-frontend:local
40 changes: 40 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
version: "3"
services:
reverseproxy:
image: reverseproxy
ports:
- 8080:8080
restart: always
depends_on:
- backend-user
- backend-feed
backend-user:
image: udagram-api-user
environment:
POSTGRES_USERNAME: $POSTGRES_USERNAME
POSTGRES_PASSWORD: $POSTGRES_PASSWORD
POSTGRES_DB: $POSTGRES_DB
POSTGRES_HOST: $POSTGRES_HOST
AWS_REGION: $AWS_REGION
AWS_PROFILE: $AWS_PROFILE
AWS_BUCKET: $AWS_BUCKET
JWT_SECRET: $JWT_SECRET
URL: "http://localhost:8100"
backend-feed:
image: udagram-api-feed
volumes:
- $HOME/.aws:/root/.aws
environment:
POSTGRES_USERNAME: $POSTGRES_USERNAME
POSTGRES_PASSWORD: $POSTGRES_PASSWORD
POSTGRES_DB: $POSTGRES_DB
POSTGRES_HOST: $POSTGRES_HOST
AWS_REGION: $AWS_REGION
AWS_PROFILE: $AWS_PROFILE
AWS_BUCKET: $AWS_BUCKET
JWT_SECRET: $JWT_SECRET
URL: "http://localhost:8100"
frontend:
image: udagram-frontend:local
ports:
- "8100:80"
11 changes: 0 additions & 11 deletions set_env.sh

This file was deleted.

1 change: 1 addition & 0 deletions udagram-api-feed/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
26 changes: 26 additions & 0 deletions udagram-api-feed/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"env": {
"browser": true,
"es6": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
}
}
42 changes: 42 additions & 0 deletions udagram-api-feed/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Specifies intentionally untracked files to ignore when using Git
# http://git-scm.com/docs/gitignore

*~
*.sw[mnpcod]
*.log
*.tmp
*.tmp.*
log.txt
*.sublime-project
*.sublime-workspace
.vscode/
npm-debug.log*

.idea/
.ionic/
.sourcemaps/
.sass-cache/
.tmp/
.versions/
coverage/
www/
node_modules/
tmp/
temp/
platforms/
plugins/
plugins/android.json
plugins/ios.json
$RECYCLE.BIN/
postgres_dev/
logfile

.DS_Store
Thumbs.db
UserInterfaceState.xcuserstate
node_modules
venv/
# Elastic Beanstalk Files
.elasticbeanstalk/*
!.elasticbeanstalk/*.cfg.yml
!.elasticbeanstalk/*.global.yml
1 change: 1 addition & 0 deletions udagram-api-feed/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
unsafe-perm=true
11 changes: 11 additions & 0 deletions udagram-api-feed/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM node:12
## Create app directory
WORKDIR /usr/src/app
## Install app dependencies
## A wildcard is used to ensure both package.json AND package-lock.json are copied where available (npm@5+)
COPY package*.json ./
RUN npm ci
## Bundle app source
COPY . .
EXPOSE 8080
CMD [ "npm", "run", "prod" ]
Binary file added udagram-api-feed/mock/xander0.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added udagram-api-feed/mock/xander1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added udagram-api-feed/mock/xander2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading