tests: Use Nginx instead of yarn start
This commit is contained in:
parent
d551c1065e
commit
bd24a936fb
@ -31,26 +31,27 @@ steps:
|
|||||||
- sed -i 's/{{ DEPLOY_SSH_KEY_PASSPHRASE }}/'"$DEPLOY_SSH_KEY_PASSPHRASE"'/g' ./.ansible-items/inventory
|
- sed -i 's/{{ DEPLOY_SSH_KEY_PASSPHRASE }}/'"$DEPLOY_SSH_KEY_PASSPHRASE"'/g' ./.ansible-items/inventory
|
||||||
- sed -i 's/{{ DEPLOY_USER }}/'"$DEPLOY_USER"'/g' ./.ansible-items/inventory
|
- sed -i 's/{{ DEPLOY_USER }}/'"$DEPLOY_USER"'/g' ./.ansible-items/inventory
|
||||||
|
|
||||||
- name: install frontend dependencies
|
- name: install dependencies and build frontend
|
||||||
image: node:lts-alpine3.14
|
image: node:lts-alpine3.14
|
||||||
commands:
|
commands:
|
||||||
- node -v
|
- node -v
|
||||||
- npm -v
|
- npm -v
|
||||||
- yarn --version
|
- yarn --version
|
||||||
- yarn --cwd ./items/frontend install
|
- yarn --cwd ./items/frontend install
|
||||||
|
- yarn --cwd ./items/frontend build --pure-lockfile
|
||||||
|
- rm -rf ./items/api/public/static/*
|
||||||
|
- cp ./items/frontend/build/* ./items/api/public
|
||||||
|
- rm ./items/api/public/index.html
|
||||||
depends_on:
|
depends_on:
|
||||||
- replace hosts and user variables
|
- replace hosts and user variables
|
||||||
|
|
||||||
- name: frontend
|
- name: frontend
|
||||||
image: node:lts-alpine3.14
|
image: nginx:1.21.4-alpine
|
||||||
commands:
|
commands:
|
||||||
- node -v
|
- cp ./items/frontend/build/* /usr/share/nginx/html
|
||||||
- npm -v
|
|
||||||
- yarn --version
|
|
||||||
- yarn --cwd ./items/frontend start
|
|
||||||
detach: true
|
detach: true
|
||||||
depends_on:
|
depends_on:
|
||||||
- install frontend dependencies
|
- install dependencies and build frontend
|
||||||
|
|
||||||
- name: test frontend
|
- name: test frontend
|
||||||
image: cypress/browsers:node16.5.0-chrome94-ff93
|
image: cypress/browsers:node16.5.0-chrome94-ff93
|
||||||
@ -60,25 +61,7 @@ steps:
|
|||||||
- yarn --version
|
- yarn --version
|
||||||
- yarn --cwd ./items/frontend cy:run
|
- yarn --cwd ./items/frontend cy:run
|
||||||
depends_on:
|
depends_on:
|
||||||
- install frontend dependencies
|
- install dependencies and build frontend
|
||||||
|
|
||||||
- name: build frontend
|
|
||||||
image: node:lts-alpine3.14
|
|
||||||
commands:
|
|
||||||
- node -v
|
|
||||||
- npm -v
|
|
||||||
- yarn --version
|
|
||||||
- yarn --cwd ./items/frontend build --pure-lockfile
|
|
||||||
- rm -rf ./items/api/public/static/*
|
|
||||||
- mv ./items/frontend/build/* ./items/api/public
|
|
||||||
- rm ./items/api/public/index.html
|
|
||||||
depends_on:
|
|
||||||
- test frontend
|
|
||||||
when:
|
|
||||||
branch:
|
|
||||||
- main
|
|
||||||
- master
|
|
||||||
- development
|
|
||||||
|
|
||||||
- name: check ansible syntax
|
- name: check ansible syntax
|
||||||
image: plugins/ansible:3
|
image: plugins/ansible:3
|
||||||
@ -111,8 +94,7 @@ steps:
|
|||||||
SPT_ITEMS_PATH:
|
SPT_ITEMS_PATH:
|
||||||
from_secret: deploy_path
|
from_secret: deploy_path
|
||||||
depends_on:
|
depends_on:
|
||||||
- check ansible syntax
|
- test frontend
|
||||||
- build frontend
|
|
||||||
when:
|
when:
|
||||||
branch:
|
branch:
|
||||||
- master
|
- master
|
||||||
|
@ -31,26 +31,27 @@ steps:
|
|||||||
- sed -i 's/{{ DEPLOY_SSH_KEY_PASSPHRASE }}/'"$DEPLOY_SSH_KEY_PASSPHRASE"'/g' ./.ansible-items/inventory
|
- sed -i 's/{{ DEPLOY_SSH_KEY_PASSPHRASE }}/'"$DEPLOY_SSH_KEY_PASSPHRASE"'/g' ./.ansible-items/inventory
|
||||||
- sed -i 's/{{ DEPLOY_USER }}/'"$DEPLOY_USER"'/g' ./.ansible-items/inventory
|
- sed -i 's/{{ DEPLOY_USER }}/'"$DEPLOY_USER"'/g' ./.ansible-items/inventory
|
||||||
|
|
||||||
- name: install frontend dependencies
|
- name: install dependencies and build frontend
|
||||||
image: node:lts-alpine3.14
|
image: node:lts-alpine3.14
|
||||||
commands:
|
commands:
|
||||||
- node -v
|
- node -v
|
||||||
- npm -v
|
- npm -v
|
||||||
- yarn --version
|
- yarn --version
|
||||||
- yarn --cwd ./items/frontend install
|
- yarn --cwd ./items/frontend install
|
||||||
|
- yarn --cwd ./items/frontend build --pure-lockfile
|
||||||
|
- rm -rf ./items/api/public/static/*
|
||||||
|
- cp ./items/frontend/build/* ./items/api/public
|
||||||
|
- rm ./items/api/public/index.html
|
||||||
depends_on:
|
depends_on:
|
||||||
- replace hosts and user variables
|
- replace hosts and user variables
|
||||||
|
|
||||||
- name: frontend
|
- name: frontend
|
||||||
image: node:lts-alpine3.14
|
image: nginx:1.21.4-alpine
|
||||||
commands:
|
commands:
|
||||||
- node -v
|
- cp ./items/frontend/build/* /usr/share/nginx/html
|
||||||
- npm -v
|
|
||||||
- yarn --version
|
|
||||||
- yarn --cwd ./items/frontend start
|
|
||||||
detach: true
|
detach: true
|
||||||
depends_on:
|
depends_on:
|
||||||
- install frontend dependencies
|
- install dependencies and build frontend
|
||||||
|
|
||||||
- name: test frontend
|
- name: test frontend
|
||||||
image: cypress/browsers:node16.5.0-chrome94-ff93
|
image: cypress/browsers:node16.5.0-chrome94-ff93
|
||||||
@ -60,25 +61,7 @@ steps:
|
|||||||
- yarn --version
|
- yarn --version
|
||||||
- yarn --cwd ./items/frontend cy:run
|
- yarn --cwd ./items/frontend cy:run
|
||||||
depends_on:
|
depends_on:
|
||||||
- install frontend dependencies
|
- install dependencies and build frontend
|
||||||
|
|
||||||
- name: build frontend
|
|
||||||
image: node:lts-alpine3.14
|
|
||||||
commands:
|
|
||||||
- node -v
|
|
||||||
- npm -v
|
|
||||||
- yarn --version
|
|
||||||
- yarn --cwd ./items/frontend build --pure-lockfile
|
|
||||||
- rm -rf ./items/api/public/static/*
|
|
||||||
- mv ./items/frontend/build/* ./items/api/public
|
|
||||||
- rm ./items/api/public/index.html
|
|
||||||
depends_on:
|
|
||||||
- test frontend
|
|
||||||
when:
|
|
||||||
branch:
|
|
||||||
- main
|
|
||||||
- master
|
|
||||||
- development
|
|
||||||
|
|
||||||
- name: check ansible syntax
|
- name: check ansible syntax
|
||||||
image: plugins/ansible:3
|
image: plugins/ansible:3
|
||||||
@ -111,8 +94,7 @@ steps:
|
|||||||
SPT_ITEMS_PATH:
|
SPT_ITEMS_PATH:
|
||||||
from_secret: deploy_path
|
from_secret: deploy_path
|
||||||
depends_on:
|
depends_on:
|
||||||
- check ansible syntax
|
- test frontend
|
||||||
- build frontend
|
|
||||||
when:
|
when:
|
||||||
branch:
|
branch:
|
||||||
- master
|
- master
|
||||||
|
Loading…
x
Reference in New Issue
Block a user