Skip to content

Feature: Setup cicd pipeline#18

Open
ikovac wants to merge 82 commits intochore/migrate-to-typescript-with-bottlejs-and-mikro-ormfrom
feature/ST-293_setup-cicd
Open

Feature: Setup cicd pipeline#18
ikovac wants to merge 82 commits intochore/migrate-to-typescript-with-bottlejs-and-mikro-ormfrom
feature/ST-293_setup-cicd

Conversation

@ikovac
Copy link
Copy Markdown
Contributor

@ikovac ikovac commented Oct 13, 2021

This PR:

  • Setup infrastructure using pulumi
  • Setup ci/cd pipeline using circleci

Infrastructure components:

  • Site S3 bucket for frontend delivery
  • Storage S3 bucket
  • Kubernetes cluster with metrics server, ingress controller, server service, horizontal pod autoscaler
  • Database - rds instance
  • VPC

Comment thread infrastructure/index.js Outdated
const s3 = require('./s3');

const siteDir = path.join(__dirname, '../dist/client');
s3.copyDirToBucket(siteDir, s3.siteBucket);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why publish dist through Pulumi instead of AWS orb through CI/CD pipeline?

Copy link
Copy Markdown
Contributor Author

@ikovac ikovac Oct 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because last week I spent all circleci free credits so I temporary set it this way 😅 but yes, the plan is to use aws orb to push dist folder to the S3 bucket

Base automatically changed from fix/refactor-auth-initialize-middleware to chore/migrate-to-typescript-with-bottlejs-and-mikro-orm October 14, 2021 12:13
Comment thread .circleci/config.yml Outdated
version: 2.1

defaults: &defaults
working_directory: ~/project/solution-tree
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀

@ikovac ikovac requested a review from MiroDojkic October 20, 2021 12:24
@MiroDojkic
Copy link
Copy Markdown
Member

@ikovac please resolve conflicts.

@ikovac
Copy link
Copy Markdown
Contributor Author

ikovac commented Oct 21, 2021

@MiroDojkic resolved

Comment thread .circleci/config.yml Outdated
build-client-prod:
<<: *build-client
build-server-dev: &build-server
working_directory: ~/project/app-starter
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we keep working dir in a separate anchor than defaults so we can reuse it here as well?

Comment thread .circleci/config.yml Outdated
- kubernetes/install-kubectl
- pulumi/login
- run:
name: Stack init
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for nitpicking, but please consider whether this is nicer for the eyes 😅

Suggested change
name: Stack init
name: Configure stack

Comment thread .circleci/config.yml Outdated
<<: *deploy
deploy-prod:
<<: *deploy
push-to-s3-dev: &push-to-s3
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this name match the job intention better?

Suggested change
push-to-s3-dev: &push-to-s3
deploy-client-dev: &deploy-client

Comment thread .circleci/config.yml
<<: *push-to-s3

workflows:
test-and-deploy:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we try to make workflows a bit easier to read through parametrization or something else?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far I saw, only jobs can be parametrized, and here we need to parametrize it with context and filters which are part of the workflow and not the job itself. Have I missed something?

Comment thread Dockerfile Outdated
FROM node:14.18.1 as builder
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use npm ci instead to match the dependency versions in lock file?

Comment thread package.json
"rewrite-lockfile": "^1.0.0",
"rimraf": "^3.0.2",
"sass": "^1.43.2",
"sass": "~1.32.13",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to lock ourselves to patch version?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because later versions display vuetify warnings about using / scss operator instead of math.div()

@ikovac ikovac requested a review from MiroDojkic October 22, 2021 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

👉 Need's code review Need's code review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants