WORKS: .gitlab-ci
Signed-off-by: Marcin Woźniak <y0rune@aol.com>
This commit is contained in:
parent
5185315e9a
commit
38e28ea536
@ -1,6 +1,5 @@
|
|||||||
stages:
|
stages:
|
||||||
- build
|
- build
|
||||||
- test
|
|
||||||
- deploy
|
- deploy
|
||||||
|
|
||||||
build:
|
build:
|
||||||
@ -8,9 +7,8 @@ build:
|
|||||||
image: node
|
image: node
|
||||||
script:
|
script:
|
||||||
- echo "Start building App"
|
- echo "Start building App"
|
||||||
- npm install typescript eslint
|
- yarn
|
||||||
- npm install
|
- CI= yarn run build
|
||||||
- npm run build
|
|
||||||
- echo "Build successfully!"
|
- echo "Build successfully!"
|
||||||
artifacts:
|
artifacts:
|
||||||
expire_in: 1 hour
|
expire_in: 1 hour
|
||||||
@ -18,19 +16,19 @@ build:
|
|||||||
- build
|
- build
|
||||||
- node_modules/
|
- node_modules/
|
||||||
|
|
||||||
test:
|
|
||||||
stage: test
|
|
||||||
image: node
|
|
||||||
script:
|
|
||||||
- echo "Testing App"
|
|
||||||
- CI=true npm test --passWithNoTests
|
|
||||||
- echo "Test successfully!"
|
|
||||||
|
|
||||||
deploy_production:
|
deploy_production:
|
||||||
stage: deploy
|
stage: deploy
|
||||||
|
before_script:
|
||||||
|
- apt-get update
|
||||||
|
- apt-get --yes --force-yes install rsync
|
||||||
script:
|
script:
|
||||||
|
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
|
||||||
|
- eval $(ssh-agent -s)
|
||||||
|
- ssh-add <(echo "$SSH_PRIVATE_KEY")
|
||||||
|
- mkdir -p ~/.ssh
|
||||||
|
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
|
||||||
- echo "Deploying to server"
|
- echo "Deploying to server"
|
||||||
- rsync --progress -r build/* --delete root@35.207.132.68:/var/www/plannaplan.pl
|
- rsync --progress -r build/* --delete website@wmi-frontend.pl:/var/www/plannaplan.pl
|
||||||
- echo "Deployed"
|
- echo "Deployed"
|
||||||
only:
|
only:
|
||||||
- master
|
- master
|
||||||
|
Loading…
Reference in New Issue
Block a user