-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: change to workspaces structure
This enables separation between server and client dependencies, which makes it easy to know what is used where. It also reduces the footprint of the final Docker image, as we only need the dev deps when building the client bundle, so in the final image we can include only the server runtime deps.
- Loading branch information
Showing
189 changed files
with
12,454 additions
and
20,157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
> 0.5% | ||
last 2 versions | ||
Firefox ESR | ||
not ie 11 | ||
not dead |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,16 @@ | ||
version: 1 | ||
|
||
update_configs: | ||
- package_manager: "javascript" | ||
directory: "/" | ||
update_schedule: "live" | ||
version_requirement_updates: "increase_versions" | ||
- package_manager: 'javascript' | ||
directory: '/' | ||
update_schedule: 'daily' | ||
version_requirement_updates: 'increase_versions' | ||
target_branch: 'master' | ||
automerged_updates: | ||
- match: | ||
dependency_name: '@dhis2/*' | ||
dependency_type: 'all' | ||
update_type: 'semver:minor' | ||
- match: | ||
dependency_type: 'all' | ||
update_type: 'security:patch' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,103 +1,110 @@ | ||
name: 'DHIS2: Docker' | ||
|
||
on: | ||
push: | ||
# Publish `master` as Docker `latest` image. | ||
branches: | ||
- master | ||
push: | ||
# Publish `master` as Docker `latest` image. | ||
branches: | ||
- master | ||
|
||
# Publish `v1.2.3` tags as releases. | ||
tags: | ||
- v* | ||
|
||
# Run tests for any PRs. | ||
pull_request: | ||
# Publish `v1.2.3` tags as releases. | ||
tags: | ||
- v* | ||
|
||
# Run tests for any PRs. | ||
pull_request: | ||
|
||
jobs: | ||
# Run tests. | ||
# See also https://docs.docker.com/docker-hub/builds/automated-testing/ | ||
build-docker: | ||
runs-on: ubuntu-latest | ||
|
||
if: "!contains(github.event.head_commit.message, '[skip ci]')" | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Test that dockerfile builds | ||
run: docker build . | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
|
||
container: | ||
image: node:lts-slim | ||
|
||
services: | ||
postgres: | ||
image: dhis2/postgres-contrib | ||
env: | ||
POSTGRES_USER: apphub | ||
POSTGRES_PASSWORD: apphub | ||
POSTGRES_DB: apphub | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
if: "!contains(github.event.head_commit.message, '[skip ci]')" | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install deps for tests | ||
run: npm install | ||
- name: Build frontend/client | ||
run: npm run build | ||
- name: Run tests | ||
run: npm run test | ||
env: | ||
RDS_HOSTNAME: postgres | ||
RDS_USERNAME: apphub | ||
RDS_PASSWORD: apphub | ||
RDS_DB_NAME: apphub | ||
RDS_DB_PORT: 5432 | ||
AUTH_STRATEGY: jwt | ||
AUTH0_M2M_SECRET: ${{ secrets.AUTH0_M2M_SECRET }} | ||
AUTH0_SECRET: ${{ secrets.AUTH0_SECRET }} | ||
AUTH0_AUDIENCE: ${{ secrets.AUTH0_AUDIENCE }} | ||
AUTH0_DOMAIN: https://dhis2.eu.auth0.com/ | ||
AUTH0_ALG: HS256 | ||
|
||
push: | ||
# Ensure test job passes before pushing image. | ||
needs: [test, build-docker] | ||
|
||
runs-on: ubuntu-latest | ||
|
||
if: github.event_name == 'push' && !contains(github.event.head_commit.message, '[skip ci]') | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Build image | ||
run: docker build . --file Dockerfile --tag image | ||
|
||
- name: Log into DockerHub registry | ||
run: echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin | ||
|
||
- name: Push image | ||
run: | | ||
IMAGE_ID=dhis2/app-hub | ||
# Strip git ref prefix from version | ||
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') | ||
# Strip "v" prefix from tag name | ||
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') | ||
# Use Docker `latest` tag convention | ||
[ "$VERSION" == "master" ] && VERSION=latest | ||
echo IMAGE_ID=$IMAGE_ID | ||
echo VERSION=$VERSION | ||
docker tag image $IMAGE_ID:$VERSION | ||
docker push $IMAGE_ID:$VERSION | ||
# Run tests. | ||
# See also https://docs.docker.com/docker-hub/builds/automated-testing/ | ||
build-docker: | ||
runs-on: ubuntu-latest | ||
|
||
if: "!contains(github.event.head_commit.message, '[skip ci]')" | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Test that dockerfile builds | ||
run: docker build . | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
|
||
container: | ||
image: node:lts-slim | ||
|
||
services: | ||
postgres: | ||
image: dhis2/postgres-contrib | ||
env: | ||
POSTGRES_USER: apphub | ||
POSTGRES_PASSWORD: apphub | ||
POSTGRES_DB: apphub | ||
ports: | ||
- 5432/tcp | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
if: "!contains(github.event.head_commit.message, '[skip ci]')" | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Install deps for tests | ||
run: yarn install --frozen-lockfile | ||
|
||
- name: Build frontend/client | ||
run: yarn build | ||
|
||
- name: Run client tests | ||
run: yarn test:client | ||
|
||
- name: Run server tests | ||
run: yarn test:server | ||
env: | ||
RDS_HOSTNAME: postgres | ||
RDS_USERNAME: apphub | ||
RDS_PASSWORD: apphub | ||
RDS_DB_NAME: apphub | ||
RDS_DB_PORT: ${{ job.services.postgres.ports[5432] }} | ||
AUTH_STRATEGY: jwt | ||
AUTH0_M2M_SECRET: ${{ secrets.AUTH0_M2M_SECRET }} | ||
AUTH0_SECRET: ${{ secrets.AUTH0_SECRET }} | ||
AUTH0_AUDIENCE: ${{ secrets.AUTH0_AUDIENCE }} | ||
AUTH0_DOMAIN: https://dhis2.eu.auth0.com/ | ||
AUTH0_ALG: HS256 | ||
|
||
push: | ||
# Ensure test job passes before pushing image. | ||
needs: [test, build-docker] | ||
|
||
runs-on: ubuntu-latest | ||
|
||
if: github.event_name == 'push' && !contains(github.event.head_commit.message, '[skip ci]') | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Build image | ||
run: docker build . --file Dockerfile --tag image | ||
|
||
- name: Log into DockerHub registry | ||
run: echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin | ||
|
||
- name: Push image | ||
run: | | ||
IMAGE_ID=dhis2/app-hub | ||
# Strip git ref prefix from version | ||
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') | ||
# Strip "v" prefix from tag name | ||
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') | ||
# Use Docker `latest` tag convention | ||
[ "$VERSION" == "master" ] && VERSION=latest | ||
echo IMAGE_ID=$IMAGE_ID | ||
echo VERSION=$VERSION | ||
docker tag image $IMAGE_ID:$VERSION | ||
docker push $IMAGE_ID:$VERSION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,14 @@ | ||
const { config } = require('@dhis2/cli-style') | ||
const husky = require(config.husky) | ||
|
||
const tasks = arr => arr.join(' && ') | ||
|
||
module.exports = { | ||
hooks: { | ||
'commit-msg': 'd2-style commit check', | ||
'pre-commit': 'd2-style validate', | ||
...husky.hooks, | ||
'pre-commit': tasks([ | ||
'd2-style js check --staged', | ||
'd2-style text check --staged', | ||
]), | ||
}, | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const { config } = require('@dhis2/cli-style') | ||
|
||
module.exports = { | ||
extends: [config.eslintReact], | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.