Skip to content

Commit 1fb2ce5

Browse files
Merge pull request #226 from makeopensource/develop
Deploy current version of develop to main
2 parents bd433a0 + 848bc23 commit 1fb2ce5

363 files changed

Lines changed: 13874 additions & 37074 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.DS_Store

6 KB
Binary file not shown.

.dockerignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/**/node_modules
22
/logs
3-
/devU-api/src/tango/tests/test_files
3+
/devU-api/src/tango/tests/test_files
4+
.env.*

.github/workflows/api.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Builds DevU api
2+
name: Build DevU api
3+
4+
on:
5+
push:
6+
paths:
7+
- 'devU-api/**'
8+
branches:
9+
- develop # add more branches as needed
10+
11+
jobs:
12+
build-api-docker:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: write # to be able to publish a GitHub release
16+
packages: write # to be able to publish docker image packages
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
submodules: recursive
21+
fetch-depth: 0
22+
23+
- name: Set up Docker Buildx
24+
uses: docker/setup-buildx-action@v3
25+
26+
- name: Login to GHCR registry
27+
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
28+
29+
- name: Convert image name to lowercase
30+
run: |
31+
original_string=${{ github.repository }}
32+
echo "repo_url=$(echo $original_string | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
33+
34+
- name: Get Branch Name
35+
id: get_branch
36+
run: echo "::set-output name=branch_name::${GITHUB_REF#refs/heads/}"
37+
38+
- name: build api docker
39+
run: |
40+
IMAGE_NAME=ghcr.io/${{ env.repo_url }}/api:${{ steps.get_branch.outputs.branch_name }}
41+
echo "IMAGE_NAME=$IMAGE_NAME" >> $GITHUB_ENV
42+
43+
docker build . -f api.Dockerfile -t $IMAGE_NAME
44+
docker push $IMAGE_NAME
45+
46+
- name: build tango docker
47+
run: |
48+
IMAGE_NAME=ghcr.io/${{ env.repo_url }}/tango:${{ steps.get_branch.outputs.branch_name }}
49+
docker build ./tango -f ./tango/Dockerfile -t $IMAGE_NAME
50+
docker push $IMAGE_NAME

.github/workflows/client.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Builds DevU client
2+
name: Build DevU client
3+
4+
on:
5+
push:
6+
paths:
7+
- 'devU-client/**'
8+
branches:
9+
- develop # add more branches as needed
10+
11+
jobs:
12+
build-client-docker:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: write # to be able to publish a GitHub release
16+
packages: write # to be able to publish packages
17+
steps:
18+
- uses: actions/checkout@v3
19+
with:
20+
submodules: recursive
21+
fetch-depth: 0
22+
23+
- name: Set up Docker Buildx
24+
uses: docker/setup-buildx-action@v3
25+
26+
- name: Login to GHCR registry
27+
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
28+
29+
- name: Convert image name to lowercase
30+
run: |
31+
original_string=${{ github.repository }}
32+
echo "repo_url=$(echo $original_string | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
33+
34+
- name: Get Branch Name
35+
id: get_branch
36+
run: echo "::set-output name=branch_name::${GITHUB_REF#refs/heads/}"
37+
38+
- name: build client docker
39+
run: |
40+
IMAGE_NAME=ghcr.io/${{ env.repo_url }}/client:${{ steps.get_branch.outputs.branch_name }}
41+
echo "IMAGE_NAME=$IMAGE_NAME" >> $GITHUB_ENV
42+
43+
docker build . -f client.Dockerfile -t $IMAGE_NAME
44+
docker push $IMAGE_NAME
45+
46+
- name: build nginx
47+
run: |
48+
IMAGE_NAME=ghcr.io/${{ env.repo_url }}/nginx:${{ steps.get_branch.outputs.branch_name }}
49+
echo "IMAGE_NAME=$IMAGE_NAME" >> $GITHUB_ENV
50+
51+
docker build . -f nginx.Dockerfile -t $IMAGE_NAME
52+
docker push $IMAGE_NAME

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,7 @@ node_modules/
44
./docker-compose.yml
55
/.idea
66
/.vscode
7-
/logs
7+
/logs
8+
/*/node_modules
9+
/*/package-lock.json
10+
levi

.releaserc.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"branches": [
3+
{
4+
"name": "release"
5+
}
6+
],
7+
"plugins": [
8+
"@semantic-release/commit-analyzer",
9+
"@semantic-release/release-notes-generator",
10+
"@semantic-release/changelog",
11+
"@semantic-release/github",
12+
"@semantic-release/git"
13+
]
14+
}

api.Dockerfile

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,45 @@
1-
FROM node:16 as module_builder
1+
FROM node:22-alpine AS module_builder
22

33
WORKDIR /tmp
44

5-
COPY ./devu-shared .
5+
COPY devU-shared .
66

77
RUN npm install && \
88
npm run clean-directory && \
99
npm run build-docker
1010

11-
FROM node:16
11+
FROM docker.io/python:alpine AS config-builder
12+
13+
WORKDIR /config
14+
15+
RUN apk add --no-cache bash jq openssl \
16+
&& pip install yq
17+
18+
COPY devU-api/scripts/ .
19+
20+
COPY devU-api/config/ ./config
21+
22+
RUN ./generateConfig.sh default.yml
23+
24+
FROM node:22-alpine
1225

1326
WORKDIR /app
1427

15-
COPY ./devU-api/package.json ./devU-api/package-lock.json ./
28+
COPY ./devU-api/package.json ./
1629

1730
RUN npm install
1831

1932
COPY ./devU-api .
2033

34+
COPY --from=config-builder /config/default.yml ./config/default.yml
35+
2136
COPY --from=module_builder /tmp/devu-shared-modules ./devu-shared-modules
2237

38+
# Indicate that the api is running in docker; value here is irrelevant
39+
ENV IS_DOCKER=0
40+
2341
ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.2.1/wait /wait
2442
RUN chmod +x /wait
2543

2644
# TypeORM Migrations
27-
CMD /wait && npm run typeorm -- migration:run && npm start
28-
45+
CMD /wait && npm run typeorm -- migration:run -d src/database.ts && npm start

client.Dockerfile

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
1-
FROM node:16 as module_builder
1+
FROM node:22-alpine AS module_builder
22

33
WORKDIR /tmp
44

5-
COPY ./devu-shared .
5+
COPY devU-shared .
66

77
RUN npm install && \
88
npm run clean-directory && \
99
npm run build-docker
1010

11-
FROM node:16
11+
FROM node:22-alpine
1212

1313
WORKDIR /app
1414

15-
COPY ./devU-client/package.json ./devU-client/package-lock.json ./
16-
15+
COPY ./devU-client/package.json ./
1716

1817
RUN npm install
1918

2019
COPY ./devU-client/ .
2120

2221
COPY --from=module_builder /tmp/devu-shared-modules ./devu-shared-modules
2322

24-
RUN npm run build-local
25-
CMD cp -r /app/dist/* /out
23+
# build frontend during run so that we can modify baseurl via docker envoirment
24+
CMD npm run --silent build-docker && rm -rf /out/* && cp -r /app/dist/* /out

devU-api/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ build/
33
env/
44
.idea/
55
/devu-shared-modules
6+
package-lock.json
67

78
config/*.yml
89
!config/test.yml

devU-api/@types/express/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ declare global {
66
// Auth Data
77
currentUser?: AccessToken // Deserialized access token
88
refreshUser?: RefreshToken // Deserialized refresh token
9+
ownerId?: string // The owner of the requested resource(s)
910
}
1011
}
1112
}

0 commit comments

Comments
 (0)