@lenne.tech/cli 1.33.0 → 1.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -5
- package/build/commands/codex/codex.js +23 -0
- package/build/commands/codex/plugins.js +103 -0
- package/build/commands/codex/shortcuts.js +110 -0
- package/build/commands/config/validate.js +0 -4
- package/build/commands/deployment/create.js +218 -213
- package/build/commands/dev/init.js +2 -1
- package/build/commands/dev/status.js +2 -0
- package/build/commands/dev/test.js +12 -6
- package/build/commands/dev/up.js +17 -7
- package/build/commands/frontend/nuxt.js +4 -7
- package/build/commands/fullstack/add-api.js +6 -9
- package/build/commands/fullstack/add-app.js +5 -7
- package/build/commands/fullstack/init.js +34 -20
- package/build/commands/status.js +2 -0
- package/build/commands/ticket/list.js +2 -0
- package/build/commands/ticket/start.js +6 -4
- package/build/extensions/frontend-helper.js +44 -39
- package/build/extensions/server.js +354 -22
- package/build/lib/angular-environments.js +108 -0
- package/build/lib/codex-cli.js +56 -0
- package/build/lib/codex-plugin-utils.js +102 -0
- package/build/lib/dev-identity.js +38 -18
- package/build/lib/dev-package-manager.js +89 -0
- package/build/lib/dev-patches.js +4 -1
- package/build/lib/dev-project.js +20 -7
- package/build/lib/dev-state.js +17 -1
- package/build/lib/dev-test-session.js +61 -19
- package/build/lib/dev-ticket.js +12 -6
- package/build/lib/ensure-root-dockerignore.js +92 -0
- package/build/lib/fs-utils.js +19 -0
- package/build/lib/hoist-workspace-pnpm-config.js +2 -11
- package/build/lib/remove-nested-lockfiles.js +53 -0
- package/build/lib/turboops-config.js +93 -0
- package/build/lib/vendor-claude-md.js +7 -2
- package/build/lib/workspace-integration.js +96 -3
- package/build/templates/deployment/turboops.json.ejs +3 -0
- package/build/templates/vendor-scripts/migrate-store.js +25 -0
- package/docs/LT-ECOSYSTEM-GUIDE.md +1 -1
- package/docs/commands.md +30 -9
- package/docs/lt.config.md +9 -19
- package/package.json +1 -1
- package/build/templates/deployment/.github/workflows/pre-release.yml.ejs +0 -41
- package/build/templates/deployment/.github/workflows/release.yml.ejs +0 -41
- package/build/templates/deployment/.gitlab-ci.yml.ejs +0 -181
- package/build/templates/deployment/Dockerfile.app.ejs +0 -13
- package/build/templates/deployment/Dockerfile.ejs +0 -18
- package/build/templates/deployment/docker-compose.dev.yml.ejs +0 -99
- package/build/templates/deployment/docker-compose.prod.yml.ejs +0 -92
- package/build/templates/deployment/docker-compose.test.yml.ejs +0 -98
- package/build/templates/deployment/scripts/build-push.sh.ejs +0 -20
- package/build/templates/deployment/scripts/deploy.sh.ejs +0 -7
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
name: Deploy
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
release:
|
|
5
|
-
types:
|
|
6
|
-
- prereleased
|
|
7
|
-
|
|
8
|
-
env:
|
|
9
|
-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
|
|
10
|
-
|
|
11
|
-
jobs:
|
|
12
|
-
deploy:
|
|
13
|
-
runs-on: [self-hosted, docker-live]
|
|
14
|
-
env:
|
|
15
|
-
STACK_NAME: <%= props.nameCamel %>
|
|
16
|
-
APP_URL: test.<%= props.url %>
|
|
17
|
-
CI_REGISTRY_IMAGE: localhost:5000/<%= props.nameCamel %>
|
|
18
|
-
FILE_NAME: docker-compose.test.yml
|
|
19
|
-
steps:
|
|
20
|
-
- uses: actions/checkout@v1
|
|
21
|
-
- name: Use Node.js 18
|
|
22
|
-
uses: actions/setup-node@v1
|
|
23
|
-
with:
|
|
24
|
-
node-version: 18
|
|
25
|
-
- name: Install
|
|
26
|
-
run: npm run init
|
|
27
|
-
- name: Build app
|
|
28
|
-
run: npm run build:test
|
|
29
|
-
- name: Build docker
|
|
30
|
-
run: STACK_NAME=${{env.STACK_NAME}} APP_URL=${{env.APP_URL}} IMAGE_TAG=test CI_REGISTRY_IMAGE=${{env.CI_REGISTRY_IMAGE}} sh build-push.sh
|
|
31
|
-
- name: Deploy
|
|
32
|
-
run: FILE_NAME=${{env.FILE_NAME}} STACK_NAME=${{env.STACK_NAME}} APP_URL=${{env.APP_URL}} IMAGE_TAG=test CI_REGISTRY_IMAGE=${{env.CI_REGISTRY_IMAGE}} sh deploy.sh
|
|
33
|
-
- name: Deploy notification
|
|
34
|
-
if: always()
|
|
35
|
-
uses: adamkdean/simple-slack-notify@master
|
|
36
|
-
with:
|
|
37
|
-
channel: "#deployments"
|
|
38
|
-
status: ${{ job.status }}
|
|
39
|
-
success_text: "Version (#${{ github.event.release.tag_name }}) von <%= props.nameCamel %> wurde erfolgreich auf *Test* deployed."
|
|
40
|
-
failure_text: "Testversion (#${{ github.event.release.tag_name }}) von <%= props.nameCamel %> ist fehlgeschlagen."
|
|
41
|
-
cancelled_text: "Testversion (#${{ github.event.release.tag_name }}) von <%= props.nameCamel %> wurde abgebrochen."
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
name: Deploy
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
release:
|
|
5
|
-
types:
|
|
6
|
-
- released
|
|
7
|
-
|
|
8
|
-
env:
|
|
9
|
-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
|
|
10
|
-
|
|
11
|
-
jobs:
|
|
12
|
-
deploy:
|
|
13
|
-
runs-on: [self-hosted, docker-live-swaktiv]
|
|
14
|
-
env:
|
|
15
|
-
STACK_NAME: <%= props.nameCamel %>
|
|
16
|
-
APP_URL: <%= props.url %>
|
|
17
|
-
CI_REGISTRY_IMAGE: localhost:5000/<%= props.nameCamel %>
|
|
18
|
-
FILE_NAME: docker-compose.prod.yml
|
|
19
|
-
steps:
|
|
20
|
-
- uses: actions/checkout@v1
|
|
21
|
-
- name: Use Node.js 18
|
|
22
|
-
uses: actions/setup-node@v1
|
|
23
|
-
with:
|
|
24
|
-
node-version: 18
|
|
25
|
-
- name: Install
|
|
26
|
-
run: npm run init
|
|
27
|
-
- name: Build app
|
|
28
|
-
run: npm run build
|
|
29
|
-
- name: Build docker
|
|
30
|
-
run: STACK_NAME=${{env.STACK_NAME}} APP_URL=${{env.APP_URL}} IMAGE_TAG=latest CI_REGISTRY_IMAGE=${{env.CI_REGISTRY_IMAGE}} sh build-push.sh
|
|
31
|
-
- name: Deploy
|
|
32
|
-
run: FILE_NAME=${{env.FILE_NAME}} STACK_NAME=${{env.STACK_NAME}} APP_URL=${{env.APP_URL}} IMAGE_TAG=latest CI_REGISTRY_IMAGE=${{env.CI_REGISTRY_IMAGE}} sh deploy.sh
|
|
33
|
-
- name: Deploy notification
|
|
34
|
-
if: always()
|
|
35
|
-
uses: adamkdean/simple-slack-notify@master
|
|
36
|
-
with:
|
|
37
|
-
channel: "#deployments"
|
|
38
|
-
status: ${{ job.status }}
|
|
39
|
-
success_text: "Version (#${{ github.event.release.tag_name }}) von <%= props.nameCamel %> wurde erfolgreich auf *Live* deployed."
|
|
40
|
-
failure_text: "Release (#${{ github.event.release.tag_name }}) von <%= props.nameCamel %> ist fehlgeschlagen."
|
|
41
|
-
cancelled_text: "Release (#${{ github.event.release.tag_name }}) von <%= props.nameCamel %> wurde abgebrochen."
|
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
image: node:18-alpine
|
|
2
|
-
|
|
3
|
-
stages:
|
|
4
|
-
- install_dependencies
|
|
5
|
-
# - version_number
|
|
6
|
-
- build
|
|
7
|
-
- package
|
|
8
|
-
- deploy
|
|
9
|
-
|
|
10
|
-
variables:
|
|
11
|
-
APP_URL_PROD: <%= props.url %>
|
|
12
|
-
APP_URL_TEST: test.<%= props.url %>
|
|
13
|
-
STACK_NAME: $CI_PROJECT_NAME
|
|
14
|
-
FILE_NAME_PROD: docker-compose.prod.yml
|
|
15
|
-
FILE_NAME_TEST: docker-compose.test.yml
|
|
16
|
-
CI_NAME: 'gitlab'
|
|
17
|
-
CI_EMAIL: 'gitlab-ci@example.com'
|
|
18
|
-
|
|
19
|
-
install_dependencies:
|
|
20
|
-
stage: install_dependencies
|
|
21
|
-
cache:
|
|
22
|
-
key: $CI_PROJECT_DIR
|
|
23
|
-
paths:
|
|
24
|
-
- node_modules/
|
|
25
|
-
policy: push
|
|
26
|
-
script:
|
|
27
|
-
- npm ci
|
|
28
|
-
only:
|
|
29
|
-
refs:
|
|
30
|
-
- dev
|
|
31
|
-
- test
|
|
32
|
-
- release
|
|
33
|
-
- preview
|
|
34
|
-
- main
|
|
35
|
-
changes:
|
|
36
|
-
- package-lock.json
|
|
37
|
-
|
|
38
|
-
build_review:
|
|
39
|
-
stage: build
|
|
40
|
-
cache:
|
|
41
|
-
key: $CI_PROJECT_DIR
|
|
42
|
-
paths:
|
|
43
|
-
- node_modules/
|
|
44
|
-
policy: pull
|
|
45
|
-
artifacts:
|
|
46
|
-
paths:
|
|
47
|
-
- projects/api/dist/
|
|
48
|
-
- projects/app/dist/
|
|
49
|
-
expire_in: 5 minutes
|
|
50
|
-
script:
|
|
51
|
-
- npm run init
|
|
52
|
-
- npm run build
|
|
53
|
-
rules:
|
|
54
|
-
- if: $CI_MERGE_REQUEST_ID && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME != "test" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME != "release" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME != "preview" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME != "main"
|
|
55
|
-
|
|
56
|
-
build:prod:
|
|
57
|
-
stage: build
|
|
58
|
-
cache:
|
|
59
|
-
key: $CI_PROJECT_DIR
|
|
60
|
-
paths:
|
|
61
|
-
- node_modules/
|
|
62
|
-
policy: pull
|
|
63
|
-
artifacts:
|
|
64
|
-
paths:
|
|
65
|
-
- projects/api/dist/
|
|
66
|
-
- projects/app/dist/
|
|
67
|
-
expire_in: 5 minutes
|
|
68
|
-
script:
|
|
69
|
-
- npm run init
|
|
70
|
-
- npm run build
|
|
71
|
-
only:
|
|
72
|
-
- main
|
|
73
|
-
|
|
74
|
-
build:test:
|
|
75
|
-
stage: build
|
|
76
|
-
image: tarampampam/node:16-alpine
|
|
77
|
-
cache:
|
|
78
|
-
key: $CI_PROJECT_DIR
|
|
79
|
-
paths:
|
|
80
|
-
- node_modules/
|
|
81
|
-
policy: pull
|
|
82
|
-
artifacts:
|
|
83
|
-
paths:
|
|
84
|
-
- projects/api/dist/
|
|
85
|
-
- projects/app/dist/
|
|
86
|
-
expire_in: 5 minutes
|
|
87
|
-
script:
|
|
88
|
-
- npm run init
|
|
89
|
-
- npm run build:test
|
|
90
|
-
only:
|
|
91
|
-
- test
|
|
92
|
-
|
|
93
|
-
build:dev:
|
|
94
|
-
stage: build
|
|
95
|
-
cache:
|
|
96
|
-
key: $CI_PROJECT_DIR
|
|
97
|
-
paths:
|
|
98
|
-
- node_modules/
|
|
99
|
-
policy: pull
|
|
100
|
-
artifacts:
|
|
101
|
-
paths:
|
|
102
|
-
- projects/api/dist/
|
|
103
|
-
- projects/app/dist/
|
|
104
|
-
expire_in: 5 minutes
|
|
105
|
-
script:
|
|
106
|
-
- npm run init
|
|
107
|
-
- npm run build:dev
|
|
108
|
-
only:
|
|
109
|
-
- dev
|
|
110
|
-
|
|
111
|
-
#version_number:
|
|
112
|
-
# stage: version_number
|
|
113
|
-
# image: tarampampam/node:alpine
|
|
114
|
-
# script:
|
|
115
|
-
# - git config --global user.email $CI_EMAIL
|
|
116
|
-
# - git config --global user.name $CI_NAME
|
|
117
|
-
# - git config http.sslVerify "false"
|
|
118
|
-
# - npm install
|
|
119
|
-
# - git config receive.advertisePushOptions true
|
|
120
|
-
# - git checkout -B "$CI_COMMIT_REF_NAME" "$CI_COMMIT_SHA"
|
|
121
|
-
# - npm run release
|
|
122
|
-
# - git push -o ci.skip --no-verify https://${CI_USER}:${CI_ACCESS_TOKEN}@gitlab.lenne.tech/products/akademie/master-minds.git --follow-tags test:test
|
|
123
|
-
# - git fetch && git checkout dev
|
|
124
|
-
# - git merge test
|
|
125
|
-
# - git push -o ci.skip --no-verify https://${CI_USER}:${CI_ACCESS_TOKEN}@gitlab.lenne.tech/products/akademie/master-minds.git --follow-tags dev:dev
|
|
126
|
-
# only:
|
|
127
|
-
# - test
|
|
128
|
-
|
|
129
|
-
docker_build_push_test:
|
|
130
|
-
stage: package
|
|
131
|
-
image: tiangolo/docker-with-compose
|
|
132
|
-
services:
|
|
133
|
-
- docker:dind
|
|
134
|
-
before_script:
|
|
135
|
-
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
|
|
136
|
-
script:
|
|
137
|
-
- FILE_NAME=$FILE_NAME_TEST STACK_NAME=$STACK_NAME APP_URL=$APP_URL_TEST IMAGE_TAG=test CI_REGISTRY_IMAGE=$CI_REGISTRY_IMAGE sh ./scripts/build-push.sh
|
|
138
|
-
only:
|
|
139
|
-
- test
|
|
140
|
-
|
|
141
|
-
deploy_test:
|
|
142
|
-
stage: deploy
|
|
143
|
-
image: tiangolo/docker-with-compose
|
|
144
|
-
tags:
|
|
145
|
-
- <%= props.testRunner %>
|
|
146
|
-
before_script:
|
|
147
|
-
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
|
|
148
|
-
script:
|
|
149
|
-
- FILE_NAME=$FILE_NAME_TEST STACK_NAME=$STACK_NAME APP_URL=$APP_URL_TEST IMAGE_TAG=test CI_REGISTRY_IMAGE=$CI_REGISTRY_IMAGE sh ./scripts/deploy.sh
|
|
150
|
-
environment:
|
|
151
|
-
name: test
|
|
152
|
-
url: https://$APP_URL_TEST
|
|
153
|
-
only:
|
|
154
|
-
- test
|
|
155
|
-
|
|
156
|
-
docker_build_push_prod:
|
|
157
|
-
stage: package
|
|
158
|
-
image: tiangolo/docker-with-compose
|
|
159
|
-
dependencies:
|
|
160
|
-
- build:prod
|
|
161
|
-
before_script:
|
|
162
|
-
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
|
|
163
|
-
script:
|
|
164
|
-
- FILE_NAME=$FILE_NAME_PROD STACK_NAME=$STACK_NAME APP_URL=$APP_URL_PROD IMAGE_TAG=production CI_REGISTRY_IMAGE=$CI_REGISTRY_IMAGE sh ./scripts/build-push.sh
|
|
165
|
-
only:
|
|
166
|
-
- main
|
|
167
|
-
|
|
168
|
-
deploy_prod:
|
|
169
|
-
stage: deploy
|
|
170
|
-
image: tiangolo/docker-with-compose
|
|
171
|
-
tags:
|
|
172
|
-
- <%= props.prodRunner %>
|
|
173
|
-
before_script:
|
|
174
|
-
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
|
|
175
|
-
script:
|
|
176
|
-
- FILE_NAME=$FILE_NAME_PROD STACK_NAME=$STACK_NAME APP_URL=$APP_URL_PROD IMAGE_TAG=production CI_REGISTRY_IMAGE=$CI_REGISTRY_IMAGE sh ./scripts/deploy.sh
|
|
177
|
-
environment:
|
|
178
|
-
name: production
|
|
179
|
-
url: https://$APP_URL_PROD
|
|
180
|
-
only:
|
|
181
|
-
- main
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
FROM mhart/alpine-node:16.4.2
|
|
2
|
-
|
|
3
|
-
RUN mkdir -p /var/www/api
|
|
4
|
-
|
|
5
|
-
RUN apk --no-cache add curl
|
|
6
|
-
|
|
7
|
-
ADD ./projects/api/package.json /var/www/api/package.json
|
|
8
|
-
ADD ./projects/api/package-lock.json /var/www/api/package-lock.json
|
|
9
|
-
|
|
10
|
-
COPY ./projects/api/dist ./var/www/api
|
|
11
|
-
|
|
12
|
-
RUN cd /var/www/api && npm install && npm cache clean --force
|
|
13
|
-
|
|
14
|
-
HEALTHCHECK --interval=60s --retries=5 CMD curl --fail http://localhost:3000/meta/ || exit 1
|
|
15
|
-
|
|
16
|
-
WORKDIR /var/www/api
|
|
17
|
-
|
|
18
|
-
EXPOSE 3000
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
version: "3.7"
|
|
2
|
-
|
|
3
|
-
networks:
|
|
4
|
-
traefik-public:
|
|
5
|
-
external: true
|
|
6
|
-
overlay_mongo:
|
|
7
|
-
external: true
|
|
8
|
-
|
|
9
|
-
services:
|
|
10
|
-
api:
|
|
11
|
-
build:
|
|
12
|
-
context: .
|
|
13
|
-
dockerfile: Dockerfile
|
|
14
|
-
image: ${CI_REGISTRY_IMAGE?Variable not set}/api:${IMAGE_TAG?Variable not set}
|
|
15
|
-
restart: unless-stopped
|
|
16
|
-
container_name: swaktiv-api-${IMAGE_TAG?Variable not set}
|
|
17
|
-
networks:
|
|
18
|
-
- traefik-public
|
|
19
|
-
- overlay_mongo
|
|
20
|
-
deploy:
|
|
21
|
-
placement:
|
|
22
|
-
constraints:
|
|
23
|
-
- node.labels.traefik-public.traefik-public-certificates == true
|
|
24
|
-
update_config:
|
|
25
|
-
order: start-first
|
|
26
|
-
failure_action: rollback
|
|
27
|
-
delay: 10s
|
|
28
|
-
rollback_config:
|
|
29
|
-
parallelism: 0
|
|
30
|
-
order: stop-first
|
|
31
|
-
restart_policy:
|
|
32
|
-
condition: any
|
|
33
|
-
delay: 5s
|
|
34
|
-
max_attempts: 3
|
|
35
|
-
window: 120s
|
|
36
|
-
labels:
|
|
37
|
-
- traefik.enable=true
|
|
38
|
-
- traefik.docker.network=traefik-public
|
|
39
|
-
- traefik.constraint-label=traefik-public
|
|
40
|
-
- traefik.http.routers.${STACK_NAME?Variable not set}-${IMAGE_TAG}-api-http.rule=Host(`api.${APP_URL?Variable not set}`)
|
|
41
|
-
- traefik.http.routers.${STACK_NAME?Variable not set}-${IMAGE_TAG}-api-http.entrypoints=http
|
|
42
|
-
- traefik.http.routers.${STACK_NAME?Variable not set}-${IMAGE_TAG}-api-http.middlewares=https-redirect
|
|
43
|
-
- traefik.http.routers.${STACK_NAME?Variable not set}-${IMAGE_TAG}-api-https.rule=Host(`api.${APP_URL?Variable not set}`)
|
|
44
|
-
- traefik.http.routers.${STACK_NAME?Variable not set}-${IMAGE_TAG}-api-https.entrypoints=https
|
|
45
|
-
- traefik.http.routers.${STACK_NAME?Variable not set}-${IMAGE_TAG}-api-https.tls=true
|
|
46
|
-
- traefik.http.routers.${STACK_NAME?Variable not set}-${IMAGE_TAG}-api-https.tls.certresolver=le
|
|
47
|
-
- traefik.http.services.${STACK_NAME?Variable not set}-${IMAGE_TAG}-api.loadbalancer.server.port=3000
|
|
48
|
-
entrypoint: ["/bin/sh", "-c"]
|
|
49
|
-
command:
|
|
50
|
-
- |
|
|
51
|
-
npm run migrate:dev:up
|
|
52
|
-
NODE_ENV=dev node ./src/main.js
|
|
53
|
-
|
|
54
|
-
app:
|
|
55
|
-
build:
|
|
56
|
-
context: .
|
|
57
|
-
dockerfile: Dockerfile.app
|
|
58
|
-
image: ${CI_REGISTRY_IMAGE?Variable not set}/app-ssr:${IMAGE_TAG?Variable not set}
|
|
59
|
-
restart: unless-stopped
|
|
60
|
-
container_name: swaktiv-app-${IMAGE_TAG?Variable not set}
|
|
61
|
-
entrypoint: ["/bin/sh", "-c"]
|
|
62
|
-
networks:
|
|
63
|
-
- traefik-public
|
|
64
|
-
deploy:
|
|
65
|
-
placement:
|
|
66
|
-
constraints:
|
|
67
|
-
- node.labels.traefik-public.traefik-public-certificates == true
|
|
68
|
-
update_config:
|
|
69
|
-
order: start-first
|
|
70
|
-
failure_action: rollback
|
|
71
|
-
delay: 10s
|
|
72
|
-
rollback_config:
|
|
73
|
-
parallelism: 0
|
|
74
|
-
order: stop-first
|
|
75
|
-
restart_policy:
|
|
76
|
-
condition: any
|
|
77
|
-
delay: 5s
|
|
78
|
-
max_attempts: 3
|
|
79
|
-
window: 120s
|
|
80
|
-
labels:
|
|
81
|
-
- traefik.enable=true
|
|
82
|
-
- traefik.docker.network=traefik-public
|
|
83
|
-
- traefik.constraint-label=traefik-public
|
|
84
|
-
- traefik.http.routers.${STACK_NAME?Variable not set}-${IMAGE_TAG}-app-http.rule=Host(`${APP_URL?Variable not set}`, `www.${APP_URL?Variable not set}`)
|
|
85
|
-
- traefik.http.routers.${STACK_NAME?Variable not set}-${IMAGE_TAG}-app-http.entrypoints=http
|
|
86
|
-
- traefik.http.routers.${STACK_NAME?Variable not set}-${IMAGE_TAG}-app-http.middlewares=https-redirect
|
|
87
|
-
- traefik.http.routers.${STACK_NAME?Variable not set}-${IMAGE_TAG}-app-https.rule=Host(`${APP_URL?Variable not set}`, `www.${APP_URL?Variable not set}`)
|
|
88
|
-
- traefik.http.routers.${STACK_NAME?Variable not set}-${IMAGE_TAG}-app-https.entrypoints=https
|
|
89
|
-
- traefik.http.routers.${STACK_NAME?Variable not set}-${IMAGE_TAG}-app-https.tls=true
|
|
90
|
-
- traefik.http.routers.${STACK_NAME?Variable not set}-${IMAGE_TAG}-app-https.tls.certresolver=le
|
|
91
|
-
- traefik.http.middlewares.${STACK_NAME?Variable not set}-${IMAGE_TAG}-redirect.redirectregex.regex=^https?://www.${APP_URL}/(.*)
|
|
92
|
-
- traefik.http.middlewares.${STACK_NAME?Variable not set}-${IMAGE_TAG}-redirect.redirectregex.replacement=https://${APP_URL}/$${1}
|
|
93
|
-
- traefik.http.middlewares.${STACK_NAME?Variable not set}-${IMAGE_TAG}-redirect.redirectregex.permanent=true
|
|
94
|
-
- traefik.http.services.${STACK_NAME?Variable not set}-${IMAGE_TAG}-app.loadbalancer.server.port=4000
|
|
95
|
-
- traefik.http.routers.${STACK_NAME?Variable not set}-${IMAGE_TAG}-app-https.middlewares=${STACK_NAME?Variable not set}-${IMAGE_TAG}-redirect
|
|
96
|
-
|
|
97
|
-
command:
|
|
98
|
-
- |
|
|
99
|
-
NODE_ENV=dev node dist/app/server/main.js
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
version: "3.7"
|
|
2
|
-
|
|
3
|
-
networks:
|
|
4
|
-
traefik-public:
|
|
5
|
-
external: true
|
|
6
|
-
overlay_mongo:
|
|
7
|
-
external: true
|
|
8
|
-
|
|
9
|
-
services:
|
|
10
|
-
api:
|
|
11
|
-
build:
|
|
12
|
-
context: .
|
|
13
|
-
dockerfile: Dockerfile
|
|
14
|
-
image: ${CI_REGISTRY_IMAGE?Variable not set}/api:${IMAGE_TAG?Variable not set}
|
|
15
|
-
restart: unless-stopped
|
|
16
|
-
container_name: <%= props.nameCamel %>-api-${IMAGE_TAG?Variable not set}
|
|
17
|
-
networks:
|
|
18
|
-
- traefik-public
|
|
19
|
-
- overlay_mongo
|
|
20
|
-
deploy:
|
|
21
|
-
update_config:
|
|
22
|
-
order: start-first
|
|
23
|
-
failure_action: rollback
|
|
24
|
-
delay: 10s
|
|
25
|
-
rollback_config:
|
|
26
|
-
parallelism: 0
|
|
27
|
-
order: stop-first
|
|
28
|
-
restart_policy:
|
|
29
|
-
condition: any
|
|
30
|
-
delay: 5s
|
|
31
|
-
max_attempts: 3
|
|
32
|
-
window: 120s
|
|
33
|
-
labels:
|
|
34
|
-
- traefik.enable=true
|
|
35
|
-
- traefik.docker.network=traefik-public
|
|
36
|
-
- traefik.constraint-label=traefik-public
|
|
37
|
-
- traefik.http.routers.${STACK_NAME?Variable not set}-${IMAGE_TAG}-api-http.rule=Host(`api.${APP_URL?Variable not set}`)
|
|
38
|
-
- traefik.http.routers.${STACK_NAME?Variable not set}-${IMAGE_TAG}-api-http.entrypoints=http
|
|
39
|
-
- traefik.http.routers.${STACK_NAME?Variable not set}-${IMAGE_TAG}-api-http.middlewares=https-redirect
|
|
40
|
-
- traefik.http.routers.${STACK_NAME?Variable not set}-${IMAGE_TAG}-api-https.rule=Host(`api.${APP_URL?Variable not set}`)
|
|
41
|
-
- traefik.http.routers.${STACK_NAME?Variable not set}-${IMAGE_TAG}-api-https.entrypoints=https
|
|
42
|
-
- traefik.http.routers.${STACK_NAME?Variable not set}-${IMAGE_TAG}-api-https.tls=true
|
|
43
|
-
- traefik.http.routers.${STACK_NAME?Variable not set}-${IMAGE_TAG}-api-https.tls.certresolver=le
|
|
44
|
-
- traefik.http.services.${STACK_NAME?Variable not set}-${IMAGE_TAG}-api.loadbalancer.server.port=3000
|
|
45
|
-
entrypoint: ["/bin/sh", "-c"]
|
|
46
|
-
command:
|
|
47
|
-
- |
|
|
48
|
-
npm run migrate:prod:up
|
|
49
|
-
NODE_ENV=production node ./src/main.js
|
|
50
|
-
|
|
51
|
-
app:
|
|
52
|
-
build:
|
|
53
|
-
context: .
|
|
54
|
-
dockerfile: Dockerfile.app
|
|
55
|
-
image: ${CI_REGISTRY_IMAGE?Variable not set}/app-ssr:${IMAGE_TAG?Variable not set}
|
|
56
|
-
restart: unless-stopped
|
|
57
|
-
container_name: <%= props.nameCamel %>-app-${IMAGE_TAG?Variable not set}
|
|
58
|
-
entrypoint: ["/bin/sh", "-c"]
|
|
59
|
-
networks:
|
|
60
|
-
- traefik-public
|
|
61
|
-
deploy:
|
|
62
|
-
update_config:
|
|
63
|
-
order: start-first
|
|
64
|
-
failure_action: rollback
|
|
65
|
-
delay: 10s
|
|
66
|
-
rollback_config:
|
|
67
|
-
parallelism: 0
|
|
68
|
-
order: stop-first
|
|
69
|
-
restart_policy:
|
|
70
|
-
condition: any
|
|
71
|
-
delay: 5s
|
|
72
|
-
max_attempts: 3
|
|
73
|
-
window: 120s
|
|
74
|
-
labels:
|
|
75
|
-
- traefik.enable=true
|
|
76
|
-
- traefik.docker.network=traefik-public
|
|
77
|
-
- traefik.constraint-label=traefik-public
|
|
78
|
-
- traefik.http.routers.${STACK_NAME?Variable not set}-${IMAGE_TAG}-app-http.rule=Host(`${APP_URL?Variable not set}`, `www.${APP_URL?Variable not set}`)
|
|
79
|
-
- traefik.http.routers.${STACK_NAME?Variable not set}-${IMAGE_TAG}-app-http.entrypoints=http
|
|
80
|
-
- traefik.http.routers.${STACK_NAME?Variable not set}-${IMAGE_TAG}-app-http.middlewares=https-redirect
|
|
81
|
-
- traefik.http.routers.${STACK_NAME?Variable not set}-${IMAGE_TAG}-app-https.rule=Host(`${APP_URL?Variable not set}`, `www.${APP_URL?Variable not set}`)
|
|
82
|
-
- traefik.http.routers.${STACK_NAME?Variable not set}-${IMAGE_TAG}-app-https.entrypoints=https
|
|
83
|
-
- traefik.http.routers.${STACK_NAME?Variable not set}-${IMAGE_TAG}-app-https.tls=true
|
|
84
|
-
- traefik.http.routers.${STACK_NAME?Variable not set}-${IMAGE_TAG}-app-https.tls.certresolver=le
|
|
85
|
-
- traefik.http.middlewares.${STACK_NAME?Variable not set}-${IMAGE_TAG}-redirect.redirectregex.regex=^https?://www.${APP_URL}/(.*)
|
|
86
|
-
- traefik.http.middlewares.${STACK_NAME?Variable not set}-${IMAGE_TAG}-redirect.redirectregex.replacement=https://${APP_URL}/$${1}
|
|
87
|
-
- traefik.http.middlewares.${STACK_NAME?Variable not set}-${IMAGE_TAG}-redirect.redirectregex.permanent=true
|
|
88
|
-
- traefik.http.services.${STACK_NAME?Variable not set}-${IMAGE_TAG}-app.loadbalancer.server.port=4000
|
|
89
|
-
- traefik.http.routers.${STACK_NAME?Variable not set}-${IMAGE_TAG}-app-https.middlewares=${STACK_NAME?Variable not set}-${IMAGE_TAG}-redirect
|
|
90
|
-
command:
|
|
91
|
-
- |
|
|
92
|
-
NODE_ENV=production node dist/app/server/main.js
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
version: "3.7"
|
|
2
|
-
|
|
3
|
-
networks:
|
|
4
|
-
traefik-public:
|
|
5
|
-
external: true
|
|
6
|
-
overlay_mongo:
|
|
7
|
-
external: true
|
|
8
|
-
|
|
9
|
-
services:
|
|
10
|
-
api:
|
|
11
|
-
build:
|
|
12
|
-
context: .
|
|
13
|
-
dockerfile: Dockerfile
|
|
14
|
-
image: ${CI_REGISTRY_IMAGE?Variable not set}/api:${IMAGE_TAG?Variable not set}
|
|
15
|
-
restart: unless-stopped
|
|
16
|
-
container_name: <%= props.nameCamel %>-api-${IMAGE_TAG?Variable not set}
|
|
17
|
-
networks:
|
|
18
|
-
- traefik-public
|
|
19
|
-
- overlay_mongo
|
|
20
|
-
deploy:
|
|
21
|
-
placement:
|
|
22
|
-
constraints:
|
|
23
|
-
- node.labels.traefik-public.traefik-public-certificates == true
|
|
24
|
-
update_config:
|
|
25
|
-
order: start-first
|
|
26
|
-
failure_action: rollback
|
|
27
|
-
delay: 10s
|
|
28
|
-
rollback_config:
|
|
29
|
-
parallelism: 0
|
|
30
|
-
order: stop-first
|
|
31
|
-
restart_policy:
|
|
32
|
-
condition: any
|
|
33
|
-
delay: 5s
|
|
34
|
-
max_attempts: 3
|
|
35
|
-
window: 120s
|
|
36
|
-
labels:
|
|
37
|
-
- traefik.enable=true
|
|
38
|
-
- traefik.docker.network=traefik-public
|
|
39
|
-
- traefik.constraint-label=traefik-public
|
|
40
|
-
- traefik.http.routers.${STACK_NAME?Variable not set}-${IMAGE_TAG}-api-http.rule=Host(`api.${APP_URL?Variable not set}`)
|
|
41
|
-
- traefik.http.routers.${STACK_NAME?Variable not set}-${IMAGE_TAG}-api-http.entrypoints=http
|
|
42
|
-
- traefik.http.routers.${STACK_NAME?Variable not set}-${IMAGE_TAG}-api-http.middlewares=https-redirect
|
|
43
|
-
- traefik.http.routers.${STACK_NAME?Variable not set}-${IMAGE_TAG}-api-https.rule=Host(`api.${APP_URL?Variable not set}`)
|
|
44
|
-
- traefik.http.routers.${STACK_NAME?Variable not set}-${IMAGE_TAG}-api-https.entrypoints=https
|
|
45
|
-
- traefik.http.routers.${STACK_NAME?Variable not set}-${IMAGE_TAG}-api-https.tls=true
|
|
46
|
-
- traefik.http.routers.${STACK_NAME?Variable not set}-${IMAGE_TAG}-api-https.tls.certresolver=le
|
|
47
|
-
- traefik.http.services.${STACK_NAME?Variable not set}-${IMAGE_TAG}-api.loadbalancer.server.port=3000
|
|
48
|
-
entrypoint: ["/bin/sh", "-c"]
|
|
49
|
-
command:
|
|
50
|
-
- |
|
|
51
|
-
npm run migrate:test:up
|
|
52
|
-
NODE_ENV=test node ./src/main.js
|
|
53
|
-
|
|
54
|
-
app:
|
|
55
|
-
build:
|
|
56
|
-
context: .
|
|
57
|
-
dockerfile: Dockerfile.app
|
|
58
|
-
image: ${CI_REGISTRY_IMAGE?Variable not set}/app-ssr:${IMAGE_TAG?Variable not set}
|
|
59
|
-
restart: unless-stopped
|
|
60
|
-
container_name: <%= props.nameCamel %>-app-${IMAGE_TAG?Variable not set}
|
|
61
|
-
entrypoint: ["/bin/sh", "-c"]
|
|
62
|
-
networks:
|
|
63
|
-
- traefik-public
|
|
64
|
-
deploy:
|
|
65
|
-
placement:
|
|
66
|
-
constraints:
|
|
67
|
-
- node.labels.traefik-public.traefik-public-certificates == true
|
|
68
|
-
update_config:
|
|
69
|
-
order: start-first
|
|
70
|
-
failure_action: rollback
|
|
71
|
-
delay: 10s
|
|
72
|
-
rollback_config:
|
|
73
|
-
parallelism: 0
|
|
74
|
-
order: stop-first
|
|
75
|
-
restart_policy:
|
|
76
|
-
condition: any
|
|
77
|
-
delay: 5s
|
|
78
|
-
max_attempts: 3
|
|
79
|
-
window: 120s
|
|
80
|
-
labels:
|
|
81
|
-
- traefik.enable=true
|
|
82
|
-
- traefik.docker.network=traefik-public
|
|
83
|
-
- traefik.constraint-label=traefik-public
|
|
84
|
-
- traefik.http.routers.${STACK_NAME?Variable not set}-${IMAGE_TAG}-app-http.rule=Host(`${APP_URL?Variable not set}`, `www.${APP_URL?Variable not set}`)
|
|
85
|
-
- traefik.http.routers.${STACK_NAME?Variable not set}-${IMAGE_TAG}-app-http.entrypoints=http
|
|
86
|
-
- traefik.http.routers.${STACK_NAME?Variable not set}-${IMAGE_TAG}-app-http.middlewares=https-redirect
|
|
87
|
-
- traefik.http.routers.${STACK_NAME?Variable not set}-${IMAGE_TAG}-app-https.rule=Host(`${APP_URL?Variable not set}`, `www.${APP_URL?Variable not set}`)
|
|
88
|
-
- traefik.http.routers.${STACK_NAME?Variable not set}-${IMAGE_TAG}-app-https.entrypoints=https
|
|
89
|
-
- traefik.http.routers.${STACK_NAME?Variable not set}-${IMAGE_TAG}-app-https.tls=true
|
|
90
|
-
- traefik.http.routers.${STACK_NAME?Variable not set}-${IMAGE_TAG}-app-https.tls.certresolver=le
|
|
91
|
-
- traefik.http.middlewares.${STACK_NAME?Variable not set}-${IMAGE_TAG}-redirect.redirectregex.regex=^https?://www.${APP_URL}/(.*)
|
|
92
|
-
- traefik.http.middlewares.${STACK_NAME?Variable not set}-${IMAGE_TAG}-redirect.redirectregex.replacement=https://${APP_URL}/$${1}
|
|
93
|
-
- traefik.http.middlewares.${STACK_NAME?Variable not set}-${IMAGE_TAG}-redirect.redirectregex.permanent=true
|
|
94
|
-
- traefik.http.services.${STACK_NAME?Variable not set}-${IMAGE_TAG}-app.loadbalancer.server.port=4000
|
|
95
|
-
- traefik.http.routers.${STACK_NAME?Variable not set}-${IMAGE_TAG}-app-https.middlewares=${STACK_NAME?Variable not set}-${IMAGE_TAG}-redirect
|
|
96
|
-
command:
|
|
97
|
-
- |
|
|
98
|
-
NODE_ENV=test node dist/app/server/main.js
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
#! /usr/bin/env sh
|
|
2
|
-
|
|
3
|
-
# Exit in case of error
|
|
4
|
-
set -e
|
|
5
|
-
|
|
6
|
-
STACK_NAME=${STACK_NAME?Variable not set} \
|
|
7
|
-
APP_URL=${APP_URL?Variable not set} \
|
|
8
|
-
IMAGE_TAG=${IMAGE_TAG?Variable not set} \
|
|
9
|
-
CI_REGISTRY_IMAGE=${CI_REGISTRY_IMAGE?Variable not set} \
|
|
10
|
-
docker compose \
|
|
11
|
-
-f ${FILE_NAME?Variable not set} \
|
|
12
|
-
build
|
|
13
|
-
|
|
14
|
-
STACK_NAME=${STACK_NAME?Variable not set} \
|
|
15
|
-
APP_URL=${APP_URL?Variable not set} \
|
|
16
|
-
IMAGE_TAG=${IMAGE_TAG?Variable not set} \
|
|
17
|
-
CI_REGISTRY_IMAGE=${CI_REGISTRY_IMAGE?Variable not set} \
|
|
18
|
-
docker compose \
|
|
19
|
-
-f ${FILE_NAME?Variable not set} \
|
|
20
|
-
push
|