Compare commits

...

6 Commits

Author SHA1 Message Date
standardci
0eaf1a593d chore(release): publish
- @standardnotes/scheduler-server@1.1.0-alpha.3
2022-06-20 10:50:54 +00:00
Karol Sójko
1c4c609865 fix: add default value for db migrations path 2022-06-20 12:50:10 +02:00
Karol Sójko
17a0c9fd24 fix: install and build app locally before adding to docker image 2022-06-20 12:39:34 +02:00
standardci
dd3ea0bfb5 chore(release): publish
- @standardnotes/scheduler-server@1.1.0-alpha.2
2022-06-20 10:34:31 +00:00
Karol Sójko
a982c78541 fix: docker building for scheduler 2022-06-20 12:33:50 +02:00
Karol Sójko
49093923ca fix: testing script for scheduler 2022-06-20 11:33:18 +02:00
6 changed files with 30 additions and 29 deletions

View File

@@ -13,9 +13,6 @@ on:
jobs:
test:
defaults:
run:
working-directory: packages/scheduler
runs-on: ubuntu-latest
steps:
@@ -24,19 +21,15 @@ jobs:
with:
node-version: '16.x'
- run: yarn install
- run: yarn test
- run: yarn test:scheduler
publish-aws-ecr:
needs: test
defaults:
run:
working-directory: packages/scheduler
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: cp .env.sample .env
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
@@ -46,6 +39,10 @@ jobs:
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Install dependencies locally
run: yarn install
- name: Build application locally
run: yarn build:scheduler
- name: Build, tag, and push image to Amazon ECR
id: build-image
env:
@@ -53,7 +50,7 @@ jobs:
ECR_REPOSITORY: scheduler-worker
IMAGE_TAG: ${{ github.sha }}
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
docker build -f Dockerfile.scheduler -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
docker tag $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG $ECR_REGISTRY/$ECR_REPOSITORY:dev
docker push $ECR_REGISTRY/$ECR_REPOSITORY:dev
@@ -61,14 +58,14 @@ jobs:
publish-docker-hub:
needs: test
defaults:
run:
working-directory: packages/scheduler
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: cp .env.sample .env
- name: Install dependencies locally
run: yarn install
- name: Build application locally
run: yarn build:scheduler
- name: Publish to Registry
env:
DOCKER_BUILDKIT: 1
@@ -78,14 +75,12 @@ jobs:
name: standardnotes/scheduler
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
dockerfile: Dockerfile.scheduler
tags: "dev,${{ github.sha }}"
deploy-worker:
needs: publish-aws-ecr
defaults:
run:
working-directory: packages/scheduler
runs-on: ubuntu-latest
steps:
@@ -119,9 +114,6 @@ jobs:
newrelic:
needs: [ deploy-worker ]
defaults:
run:
working-directory: packages/scheduler
runs-on: ubuntu-latest
steps:
@@ -138,9 +130,6 @@ jobs:
notify_discord:
needs: [ deploy-worker ]
defaults:
run:
working-directory: packages/scheduler
runs-on: ubuntu-latest
steps:

View File

@@ -16,14 +16,13 @@ RUN chown -R $UID:$GID .
USER scheduler
COPY --chown=$UID:$GID package.json yarn.lock /var/www/
COPY --chown=$UID:$GID packages/scheduler/package.json .yarnrc.yml /var/www/
COPY --chown=$UID:$GID .yarn /var/www/.yarn
COPY --chown=$UID:$GID packages/scheduler/dist /var/www/dist
COPY --chown=$UID:$GID packages/scheduler/docker /var/www/docker
RUN yarn install
COPY --chown=$UID:$GID . /var/www
RUN yarn build
ENTRYPOINT [ "docker/entrypoint.sh" ]
CMD [ "start-worker" ]

View File

@@ -13,6 +13,7 @@
"scripts": {
"lint": "yarn workspaces foreach -pt --parallel --jobs 10 --verbose run lint",
"test": "yarn workspaces foreach -pt --parallel --jobs 10 --verbose run test",
"test:scheduler": "yarn workspaces foreach -pt --verbose -R --from @standardnotes/scheduler-server run test",
"clean": "yarn workspaces foreach -pt --parallel --jobs 10 --verbose run clean",
"build:all": "yarn workspaces foreach -pt --verbose run build",
"setup:env": "yarn workspaces foreach -pt --verbose run setup:env",

View File

@@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [1.1.0-alpha.3](https://github.com/standardnotes/server/compare/@standardnotes/scheduler-server@1.1.0-alpha.2...@standardnotes/scheduler-server@1.1.0-alpha.3) (2022-06-20)
### Bug Fixes
* add default value for db migrations path ([1c4c609](https://github.com/standardnotes/server/commit/1c4c609865f834f09106e934c85350a9ea276b6d))
# [1.1.0-alpha.2](https://github.com/standardnotes/server/compare/@standardnotes/scheduler-server@1.1.0-alpha.1...@standardnotes/scheduler-server@1.1.0-alpha.2) (2022-06-20)
### Bug Fixes
* docker building for scheduler ([a982c78](https://github.com/standardnotes/server/commit/a982c785419b70e6b3f4595070edc21acade6d19))
# [1.1.0-alpha.1](https://github.com/standardnotes/server/compare/@standardnotes/scheduler-server@1.1.0-alpha.0...@standardnotes/scheduler-server@1.1.0-alpha.1) (2022-06-20)
### Bug Fixes

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/scheduler-server",
"version": "1.1.0-alpha.1",
"version": "1.1.0-alpha.3",
"engines": {
"node": ">=16.0.0 <17.0.0"
},

View File

@@ -35,7 +35,7 @@ export const AppDataSource = new DataSource({
removeNodeErrorCount: 10,
},
entities: [Job, Predicate],
migrations: [env.get('DB_MIGRATIONS_PATH')],
migrations: [env.get('DB_MIGRATIONS_PATH', true) ?? 'dist/migrations/*.js'],
migrationsRun: true,
logging: <LoggerOptions>env.get('DB_DEBUG_LEVEL'),
})