Skip to content

Commit d2fd9b7

Browse files
authored
Release 1.4.0: 2.0.0 Feature Flag Off (#216)
* 2.0.0 draft1 * remove pycache * clean assets dir * ignore vscode settings * getting ready to deploy 1.4.0 * testing production build * ready to deploy 1.4.0 * updated codecov config * add a test for disabled feature flag
1 parent ef75dce commit d2fd9b7

File tree

227 files changed

+43619
-46
lines changed

Some content is hidden

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

227 files changed

+43619
-46
lines changed

.github/workflows/release.yml

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,54 @@ jobs:
2424
uses: CultureHQ/actions-yarn@master
2525
with:
2626
args: --cwd services/bot install
27-
- name: Build and publish Docker Image to GitHub Packages Registry
27+
- name: Build and publish qutex_bot
2828
uses: VaultVulp/gp-docker-action@1.2.0
2929
with:
3030
github-token: ${{ secrets.GITHUB_TOKEN }}
3131
image-name: qutex_bot
3232
extract-git-tag: true
3333
build-context: ./services/bot
34-
dockerfile: ./services/bot/Dockerfile
34+
dockerfile: ./services/bot/Dockerfile
35+
- name: Build and publish qutex_nginx
36+
uses: VaultVulp/gp-docker-action@1.2.0
37+
with:
38+
github-token: ${{ secrets.GITHUB_TOKEN }}
39+
image-name: qutex_nginx
40+
extract-git-tag: true
41+
build-context: ./services/nginx
42+
dockerfile: ./services/nginx/Dockerfile
43+
- name: Build and publish qutex_ui
44+
uses: VaultVulp/gp-docker-action@1.2.0
45+
with:
46+
github-token: ${{ secrets.GITHUB_TOKEN }}
47+
image-name: qutex_ui
48+
extract-git-tag: true
49+
build-context: ./services/ui
50+
dockerfile: ./services/ui/Dockerfile
51+
- name: Build and publish qutex_projects
52+
uses: VaultVulp/gp-docker-action@1.2.0
53+
with:
54+
github-token: ${{ secrets.GITHUB_TOKEN }}
55+
image-name: qutex_projects
56+
extract-git-tag: true
57+
build-context: .
58+
dockerfile: ./services/_api_service_template/Dockerfile
59+
custom-args: --build-arg SERVICE_PREFIX=projects
60+
- name: Build and publish qutex_users
61+
uses: VaultVulp/gp-docker-action@1.2.0
62+
with:
63+
github-token: ${{ secrets.GITHUB_TOKEN }}
64+
image-name: qutex_users
65+
extract-git-tag: true
66+
build-context: .
67+
dockerfile: ./services/_api_service_template/Dockerfile
68+
custom-args: --build-arg SERVICE_PREFIX=users
69+
- name: Build and publish qutex_auth
70+
uses: VaultVulp/gp-docker-action@1.2.0
71+
with:
72+
github-token: ${{ secrets.GITHUB_TOKEN }}
73+
image-name: qutex_auth
74+
extract-git-tag: true
75+
build-context: .
76+
dockerfile: ./services/_api_service_template/Dockerfile
77+
custom-args: --build-arg SERVICE_PREFIX=auth

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ coverage/
88
.DS_Store
99
site/
1010
secrets
11+
*.pyc
12+
__pycache__/
13+
.vscode
14+
.version.env
1115

1216
# Jekyll
1317
docs/_site

.local.env

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
AUTH_SERVICE_TOKEN_CHECK_ROUTE=/api/v1/auth/token/check
2+
AUTH_SERVICE_HOST=http://auth:4000
3+
FLASK_ENV=development
4+
FQDN=http://localhost
5+
NODE_ENV=development
6+
7+
# UI
8+
DANGEROUSLY_DISABLE_HOST_CHECK=true
9+
HOST=0.0.0.0
10+
PORT=3000
11+
12+
# FEATURE FLAGS
13+
BOT_2_0_0=true

.production.env

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
AUTH_SERVICE_TOKEN_CHECK_ROUTE=/api/v1/auth/token/check
2+
AUTH_SERVICE_HOST=http://auth:4000
3+
FLASK_ENV=production
4+
FQDN=https://qutexbot.com
5+
NODE_ENV=production
6+
AUTHOR_NAME=Ava Thorn
7+
AUTHOR_EMAIL=avatheavian@gmail.com
8+
DEBUG_EMAIL=avthorn@cisco.com
9+
SUPER_ADMINS=["Y2lzY29zcGFyazovL3VzL1BFT1BMRS9kODRkZjI1MS1iYmY3LTRlZTEtOTM1OS00Y2I0MGIyOTBhN2I"]
10+
MONGO_INITDB_ROOT_USERNAME=root
11+
MONGO_INITDB_DATABASE=qutex
12+
MONGO_INITDB_ROOT_PASSWORD_FILE=/run/secrets/mongoPassword
13+
14+
# FEATURE FLAGS
15+
BOT_2_0_0=false

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ build:
55
.PHONY: up
66
up:
77
docker compose -f docker-compose.yml -f docker-compose.dev.yml up --build -d
8-
yarn --cwd services/bot start:dev-bot
98

109
.PHONY: deploy $(VERSION)
1110
deploy:
@@ -28,4 +27,6 @@ test:
2827
.PHONY: lint
2928
lint:
3029
yarn --cwd services/bot lint
30+
yarn --cwd services/ui lint
31+
docker run -it -v $(PWD)services:/apps/services alpine/flake8 /apps
3132

bin/deploy_stack.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,17 @@ today=$(date +"%b %d, %Y")
1212
# Deploy the docs to docs.qutexbot.com
1313
mkdocs gh-deploy
1414

15-
export QUTEX_RELEASE_DATE="$today"
16-
export QUTEX_VERSION=$1
17-
export QUTEX_IMAGE=docker.pkg.github.com/amthorn/qutex/qutex_bot:${QUTEX_VERSION}
15+
QUTEX_RELEASE_DATE="$today"
16+
QUTEX_VERSION=$1
1817

1918
echo "
2019
Release Date: ${QUTEX_RELEASE_DATE}
2120
Version: ${QUTEX_VERSION}
22-
Image: ${QUTEX_IMAGE}
2321
"
2422

2523
read -p "Press enter to continue"
2624

27-
docker --context qutex stack deploy --with-registry-auth qutex -c docker-compose.yml
25+
echo "QUTEX_RELEASE_DATE=${QUTEX_RELEASE_DATE}
26+
QUTEX_VERSION=${QUTEX_VERSION}" > .version.env
27+
28+
env QUTEX_VERSION="${QUTEX_VERSION}" docker --context qutex stack deploy --with-registry-auth qutex -c docker-compose.yml

codecov.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@ coverage:
22
status:
33
project:
44
default:
5+
paths:
6+
- servies/bot
57
target: auto

docker-compose.dev.yml

Lines changed: 72 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,92 @@
11
version: '3.9'
2+
x-env_files: &env_files
3+
- .local.env
4+
- .version.env
5+
x-interactive: &interactive
6+
tty: true
7+
stdin_open: true
28
services:
9+
nginx:
10+
image: qutex_nginx:latest
11+
build:
12+
context: services/nginx
313
bot:
14+
<<: *interactive
15+
image: qutex_bot:latest
416
build:
517
context: ./services/bot
618
command: start:dev
7-
tty: true
8-
environment:
9-
NODE_ENV: development
19+
env_file: *env_files
1020
volumes:
1121
- ./services/bot:/app
1222
- ./services/bot/tsconfig.json:/app/tsconfig.json
1323
- ./services/bot/package.json:/app/package.json
24+
ui:
25+
<<: *interactive
26+
image: qutex_ui:latest
27+
build:
28+
context: services/ui/
29+
args:
30+
DEVELOPMENT: "true"
31+
env_file: *env_files
32+
volumes:
33+
- ./services/ui/src:/qutex/src
34+
- ./services/ui/public:/qutex/public
35+
- compiled_css:/qutex/src/assets/css
36+
projects:
37+
<<: *interactive
38+
image: qutex_projects:latest
39+
build:
40+
context: .
41+
dockerfile: services/_api_service_template/Dockerfile
42+
args:
43+
SERVICE_PREFIX: projects
44+
env_file: *env_files
45+
volumes:
46+
- ./services/projects/api:/projects/api
47+
- ./services/projects/documents:/projects/documents
48+
users:
49+
<<: *interactive
50+
image: qutex_users:latest
51+
build:
52+
context: .
53+
dockerfile: services/_api_service_template/Dockerfile
54+
args:
55+
SERVICE_PREFIX: users
56+
env_file: *env_files
57+
volumes:
58+
- ./services/users/api:/users/api
59+
- ./services/users/documents:/users/documents
60+
auth:
61+
<<: *interactive
62+
image: qutex_auth:latest
63+
build:
64+
context: .
65+
dockerfile: services/_api_service_template/Dockerfile
66+
args:
67+
SERVICE_PREFIX: auth
68+
env_file: *env_files
69+
volumes:
70+
- ./services/auth/api:/auth/api
71+
- ./services/auth/documents:/auth/documents
1472
migrate:
73+
image: qutex_bot:latest
1574
build:
1675
context: ./services/bot
76+
env_file: *env_files
1777
mongo:
78+
env_file: *env_files
1879
ports:
1980
- 27017:27017
81+
volumes:
82+
# ignore all css from the docker container and do not mount to my local dir
83+
# This is because the CSS files shouldn't be modified. Only the sass files
84+
# So no need to store them locally.
85+
compiled_css:
2086
secrets:
2187
token:
2288
file: secrets/local/token
2389
mongoPassword:
24-
file: secrets/local/mongoPassword
90+
file: secrets/local/mongoPassword
91+
privateKey:
92+
file: secrets/local/privateKey

docker-compose.yml

Lines changed: 61 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,84 @@
11
version: '3.9'
2+
x-env_files: &env_files
3+
- .production.env
4+
- .version.env
5+
x-common: &common
6+
restart: always
7+
env_file: *env_files
28
services:
9+
nginx:
10+
<<: *common
11+
image: docker.pkg.github.com/amthorn/qutex/qutex_nginx:${QUTEX_VERSION:-latest}
12+
depends_on:
13+
- web
14+
- auth
15+
- projects
16+
ports:
17+
- 80:80
318
bot:
4-
image: ${QUTEX_IMAGE:-qutex_bot:latest}
5-
restart: always
19+
<<: *common
20+
image: docker.pkg.github.com/amthorn/qutex/qutex_bot:${QUTEX_VERSION:-latest}
621
depends_on:
722
- mongo
823
ports:
924
- target: 3000
10-
published: 80
25+
published: 3000
1126
mode: host
12-
environment:
13-
NODE_ENV: production
14-
VERSION: ${QUTEX_VERSION}
15-
RELEASE_DATE: ${QUTEX_RELEASE_DATE}
16-
AUTHOR_NAME: Ava Thorn
17-
AUTHOR_EMAIL: avatheavian@gmail.com
18-
DEBUG_EMAIL: avthorn@cisco.com
19-
SUPER_ADMINS: '["Y2lzY29zcGFyazovL3VzL1BFT1BMRS9kODRkZjI1MS1iYmY3LTRlZTEtOTM1OS00Y2I0MGIyOTBhN2I"]'
20-
MONGO_INITDB_ROOT_USERNAME: root
21-
MONGO_INITDB_DATABASE: qutex
2227
secrets:
2328
- token
2429
- mongoPassword
25-
healthcheck:
26-
test: ["CMD", "curl", "-f", "http://localhost:3000/healthcheck"]
27-
interval: 1m30s
28-
timeout: 10s
29-
retries: 3
30+
ui:
31+
<<: *common
32+
image: docker.pkg.github.com/amthorn/qutex/qutex_ui:${QUTEX_VERSION:-latest}
33+
depends_on:
34+
- mongo
35+
- bot
36+
# - api
37+
build:
38+
context: services/ui/
39+
projects:
40+
<<: *common
41+
image: docker.pkg.github.com/amthorn/qutex/qutex_projects:${QUTEX_VERSION:-latest}
42+
depends_on:
43+
- mongo
44+
- auth
45+
secrets:
46+
- mongoPassword
47+
users:
48+
<<: *common
49+
image: docker.pkg.github.com/amthorn/qutex/qutex_users:${QUTEX_VERSION:-latest}
50+
depends_on:
51+
- auth
52+
secrets:
53+
- token
54+
- mongoPassword
55+
auth:
56+
<<: *common
57+
image: docker.pkg.github.com/amthorn/qutex/qutex_auth:${QUTEX_VERSION:-latest}
58+
depends_on:
59+
- redis
60+
- mongo
61+
secrets:
62+
- privateKey
63+
- token
64+
- mongoPassword
65+
redis:
66+
restart: always
67+
image: redis:6.2.1
3068
migrate:
3169
depends_on:
3270
- mongo
33-
image: ${QUTEX_IMAGE:-qutex_bot:latest}
34-
environment:
35-
NODE_ENV: production
36-
MONGO_INITDB_ROOT_USERNAME: root
37-
MONGO_INITDB_DATABASE: qutex
71+
image: docker.pkg.github.com/amthorn/qutex/qutex_bot:${QUTEX_VERSION:-latest}
72+
env_file: *env_files
3873
secrets:
3974
- mongoPassword
4075
entrypoint: node_modules/migrate-mongo/bin/migrate-mongo.js
4176
command: up
4277
# command: down # undo-last
4378
# command: status # status
4479
mongo:
80+
<<: *common
4581
image: mongo:4.4.5
46-
restart: always
47-
environment:
48-
MONGO_INITDB_ROOT_USERNAME: root
49-
MONGO_INITDB_DATABASE: qutex
50-
MONGO_INITDB_ROOT_PASSWORD_FILE: /run/secrets/mongoPassword
5182
volumes:
5283
- mongo_volume:/data/db
5384
secrets:
@@ -57,5 +88,7 @@ secrets:
5788
file: secrets/prod/token
5889
mongoPassword:
5990
file: secrets/prod/mongoPassword
91+
privateKey:
92+
file: secrets/prod/privateKey
6093
volumes:
6194
mongo_volume:

package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"dependencies": {
3+
"eslint": "^7.32.0",
4+
"qutex_web": "file:services/ui"
5+
}
6+
}

0 commit comments

Comments
 (0)