Skip to content

Commit

Permalink
chore(release): pull release/v1.22.1 into main (#2056)
Browse files Browse the repository at this point in the history
  • Loading branch information
utsabc authored Apr 13, 2023
2 parents c01cfc7 + 54d5261 commit d543132
Show file tree
Hide file tree
Showing 99 changed files with 17,607 additions and 250 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
!jest*.js
!benchmark
!package*.json
# to be removed later
!tsconfig.json
!test
7 changes: 6 additions & 1 deletion .github/workflows/build-pr-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ jobs:
with:
context: .
file: Dockerfile
target: development
load: true
tags: |
${{ env.REPO_NAME }}:${{ env.TAG_NAME }}
Expand All @@ -73,12 +74,14 @@ jobs:
- name: Run Tests
run: |
docker run ${{ env.REPO_NAME }}:${{ env.TAG_NAME }} npm run test:ci
docker run ${{ env.REPO_NAME }}:${{ env.TAG_NAME }} npm run test:integration
- name: Build and Push Multi-platform Images
uses: docker/[email protected]
with:
context: .
push: true
target: production
tags: |
${{ env.REPO_NAME_OLD }}:${{ env.TAG_NAME }}
${{ env.REPO_NAME }}:${{ env.TAG_NAME }}
Expand All @@ -104,7 +107,7 @@ jobs:
runs-on: ubuntu-latest
needs: [generate-tag-name]
env:
TAG_NAME: ${{ needs.generate-tag-name.outputs.tag_name }}
TAG_NAME: ut-${{ needs.generate-tag-name.outputs.tag_name }}

# Skip for the release pull requests as staging artifacts will be generated
if: startsWith(github.event.pull_request.head.ref, 'release/') != true && startsWith(github.event.pull_request.head.ref, 'hotfix-release/') != true && github.event.pull_request.head.ref != 'main'
Expand Down Expand Up @@ -136,6 +139,7 @@ jobs:
with:
context: .
file: Dockerfile-ut-func
target: development
load: true
tags: |
${{ env.REPO_NAME }}:${{ env.TAG_NAME }}
Expand All @@ -151,6 +155,7 @@ jobs:
with:
context: .
file: Dockerfile-ut-func
target: development
push: true
tags: |
${{ env.REPO_NAME_OLD }}:${{ env.TAG_NAME }}
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/prepare-for-dev-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,15 @@ jobs:
with:
context: .
file: Dockerfile
target: development
load: true
tags: |
${{ env.REPO_NAME }}:${{ steps.gen_tag_name.outputs.tag_name }}
- name: Run Tests
run: |
docker run ${{ env.REPO_NAME }}:${{ steps.gen_tag_name.outputs.tag_name }} npm run test:ci
docker run ${{ env.REPO_NAME }}:${{ steps.gen_tag_name.outputs.tag_name }} npm run test:integration
- name: Setup Docker Buildx
uses: docker/[email protected]
Expand Down Expand Up @@ -112,6 +114,7 @@ jobs:
with:
context: .
file: Dockerfile-ut-func
target: development
load: true
tags: |
${{ env.REPO_NAME }}:${{ steps.gen_tag_name.outputs.tag_name }}
Expand All @@ -132,6 +135,7 @@ jobs:
with:
context: .
file: Dockerfile-ut-func
target: development
push: true
tags: |
${{ env.REPO_NAME_OLD }}:${{ steps.gen_tag_name.outputs.tag_name }}
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/prepare-for-prod-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ jobs:
with:
context: .
file: Dockerfile
target: development
load: true
tags: |
${{ env.REPO_NAME }}:${{ steps.gen_tag_name.outputs.tag_name }}
Expand All @@ -72,6 +73,7 @@ jobs:
- name: Run Tests
run: |
docker run ${{ env.REPO_NAME }}:${{ steps.gen_tag_name.outputs.tag_name }} npm run test:ci
docker run ${{ env.REPO_NAME }}:${{ steps.gen_tag_name.outputs.tag_name }} npm run test:development
- name: Build and Push Multi-platform Images
uses: docker/[email protected]
Expand Down Expand Up @@ -143,6 +145,7 @@ jobs:
with:
context: .
file: Dockerfile-ut-func
target: development
load: true
tags: |
${{ env.REPO_NAME }}:${{ steps.gen_tag_name.outputs.tag_name }}
Expand All @@ -158,6 +161,7 @@ jobs:
with:
context: .
file: Dockerfile-ut-func
target: development
push: true
tags: |
${{ env.REPO_NAME_OLD }}:${{ steps.gen_tag_name.outputs.tag_name }}
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/prepare-for-staging-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ jobs:
with:
context: .
file: Dockerfile
target: development
load: true
tags: |
${{ env.REPO_NAME }}:${{ steps.gen_tag_name.outputs.tag_name }}
Expand All @@ -67,12 +68,14 @@ jobs:
- name: Run Tests
run: |
docker run ${{ env.REPO_NAME }}:${{ steps.gen_tag_name.outputs.tag_name }} npm run test:ci
docker run ${{ env.REPO_NAME }}:${{ steps.gen_tag_name.outputs.tag_name }} npm run test:integration
- name: Build and Push Multi-platform Images
uses: docker/[email protected]
with:
context: .
file: Dockerfile
target: production
push: true
tags: |
${{ env.REPO_NAME_OLD }}:${{ steps.gen_tag_name.outputs.tag_name }}
Expand Down Expand Up @@ -137,6 +140,7 @@ jobs:
with:
context: .
file: Dockerfile-ut-func
target: development
load: true
tags: |
${{ env.REPO_NAME }}:${{ steps.gen_tag_name.outputs.tag_name }}
Expand All @@ -152,6 +156,7 @@ jobs:
with:
context: .
file: Dockerfile-ut-func
target: development
push: true
tags: |
${{ env.REPO_NAME_OLD }}:${{ steps.gen_tag_name.outputs.tag_name }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/publish-new-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ jobs:
- name: Notify Slack Channel
id: slack
uses: slackapi/[email protected]
continue-on-error: true
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
PROJECT_NAME: 'Rudder Transformer'
Expand All @@ -97,6 +98,7 @@ jobs:
channel-id: ${{ secrets.SLACK_RELEASE_CHANNEL_ID }}
payload: |
{
"text": "*<${{env.RELEASES_URL}}v${{ steps.extract-version.outputs.release_version }}|v${{ steps.extract-version.outputs.release_version }}>*\nCC: <@U03KG4BK1L1> <@U02AE5GMMHV> <@U01LVJ30QEB>"
"blocks": [
{
"type": "header",
Expand Down
11 changes: 10 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,20 @@
"name": "transformer",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/destTransformer.js",
"program": "${workspaceRoot}/index.js",
"runtimeArgs": ["--nolazy"],
"sourceMaps": true,
"runtimeExecutable": "/usr/local/bin/node"
},
{
"type": "node",
"request": "launch",
"name": "Launch TS",
"program": "${workspaceFolder}/dist/src/index.js",
"outFiles": ["${workspaceFolder}/dist/src/**/*.js"],
"preLaunchTask": "npm run build",
"runtimeExecutable": "/usr/local/bin/node"
},
{
"name": "benchmark",
"type": "node",
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [1.22.1](https://github.com/rudderlabs/rudder-transformer/compare/v1.22.0...v1.22.1) (2023-04-12)


### Bug Fixes

* allow event names without forced lowercasing, disable lowercasing ([#2050](https://github.com/rudderlabs/rudder-transformer/issues/2050)) ([02382c5](https://github.com/rudderlabs/rudder-transformer/commit/02382c5f6c02511928e25264ed6472ec3e2b0566))
* **drip:** datatype and character limit check ([#2045](https://github.com/rudderlabs/rudder-transformer/issues/2045)) ([15889ce](https://github.com/rudderlabs/rudder-transformer/commit/15889ce0929c0369c639e877bca9a668ed153aae))

## [1.22.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.21.0...v1.22.0) (2023-04-10)


Expand Down
48 changes: 40 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,38 +1,70 @@
# syntax=docker/dockerfile:1.4
FROM node:14.21.1-alpine3.15
FROM node:14.21.1-alpine3.15 AS base

RUN apk update
RUN apk upgrade

# installing specific python version based on your previous configuration
RUN apk add --no-cache tini python2

# installing specific make version based on your previous configuration
RUN apk add make=4.2.1-r2 --repository=http://dl-cdn.alpinelinux.org/alpine/v3.11/main

# installing specific gcc version based on your previous configuration
RUN apk add g++=9.3.0-r0 --repository=http://dl-cdn.alpinelinux.org/alpine/v3.11/main

# RUN apk add --no-cache tini python make g++
RUN mkdir -p /home/node/app/node_modules && chown -R node:node /home/node/app

FROM base AS development

ARG version
ARG GIT_COMMIT_SHA
ENV transformer_build_version=$version
ENV git_commit_sha=$GIT_COMMIT_SHA

# Create app directory
WORKDIR /home/node/app
ADD . .
RUN chown -R node:node /home/node/app
USER node

RUN npm ci
RUN npm run build

ENTRYPOINT ["/sbin/tini", "--"]

HEALTHCHECK --interval=1s --timeout=30s --retries=30 \
CMD wget --no-verbose --tries=5 --spider http://localhost:9090/health || exit 1

CMD [ "npm", "start" ]

EXPOSE 9090/tcp

FROM base AS prodbuilder

WORKDIR /home/node/app
USER node
COPY --chown=node:node --from=development /home/node/app/package.json ./

RUN npm install --production

FROM base as production

ARG version
ARG GIT_COMMIT_SHA
ENV transformer_build_version=$version
ENV git_commit_sha=$GIT_COMMIT_SHA
COPY package*.json ./
RUN npm ci

COPY --chown=node:node . .
WORKDIR /home/node/app

USER node

COPY --chown=node:node --from=development /home/node/app/dist/ ./dist
COPY --chown=node:node --from=prodBuilder /home/node/app/package.json ./
COPY --chown=node:node --from=prodBuilder /home/node/app/node_modules ./node_modules

ENTRYPOINT ["/sbin/tini", "--"]

HEALTHCHECK --interval=1s --timeout=30s --retries=30 \
CMD wget --no-verbose --tries=5 --spider http://localhost:9090/health || exit 1
CMD wget --no-verbose --tries=5 --spider http://localhost:9090/health || exit 1

CMD [ "npm", "start" ]

Expand Down
28 changes: 0 additions & 28 deletions Dockerfile-no-func

This file was deleted.

19 changes: 13 additions & 6 deletions Dockerfile-ut-func
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# syntax=docker/dockerfile:1.4
FROM ubuntu:20.04
FROM ubuntu:20.04 AS base

RUN apt-get update \
&& apt-get install -y curl make g++ \
&& apt-get install -y cpio \
&& curl -sL https://deb.nodesource.com/setup_14.x | bash \
&& apt-get install -y nodejs \
&& rm -rf /var/lib/apt/lists/* \
Expand All @@ -15,20 +16,26 @@ RUN adduser --disabled-password --gecos "" --uid 1000 node

RUN mkdir -p /home/node/app/node_modules && chown -R node:node /home/node/app && mkdir -p /home/node/.npm && chown -R node:node /home/node/.npm

# Create app directory
WORKDIR /home/node/app
USER node
FROM base AS development

ARG version
ENV transformer_build_version=$version
COPY package*.json ./
RUN npm ci

WORKDIR /home/node/app
USER node
COPY --chown=node:node . .
COPY package*.json ./

USER node

RUN npm ci
RUN npm run build

HEALTHCHECK --interval=1s --timeout=30s --retries=30 \
CMD wget --no-verbose --tries=5 --spider http://localhost:9090/health || exit 1

CMD [ "npm", "start" ]

EXPOSE 9090/tcp

# TODO: Add prod builds
Loading

0 comments on commit d543132

Please sign in to comment.