Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
subugoe
ahiqar
ahiqar-tido
Commits
ae9f77df
Commit
ae9f77df
authored
Sep 03, 2021
by
Mathias Goebel
Browse files
ci: refine deployment script
parent
35a2a037
Changes
1
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
ae9f77df
...
...
@@ -11,6 +11,24 @@
-
mkdir -p ~/.ssh
-
chmod 700 ~/.ssh
.deloyment
:
&deploy
# set entry point for develop
-
sed -i "s ahikar.*\.sub $SERVER.sub g" tido/dist/index.html
# arabic-karshuni
## remove old version
-
ssh -o 'StrictHostKeyChecking no' $SSH_USER@$SSH_IP "rm -rf ~/$TARGET/frontend/arabic-karshuni/*"
## upload new version
-
scp -o 'StrictHostKeyChecking no' -r tido/dist/* $SSH_USER@$SSH_IP:~/$TARGET/frontend/arabic-karshuni/
# syriac
## remove old version
-
sed -i 's textapi/ahikar/arabic-karshuni textapi /ahikar/syriac/' tido/dist/index.html
-
ssh -o 'StrictHostKeyChecking no' $SSH_USER@$SSH_IP "rm -rf ~/$TARGET/frontend/syriac/*"
## upload new version
-
scp -o 'StrictHostKeyChecking no' -r tido/dist/* $SSH_USER@$SSH_IP:~/$TARGET/frontend/syriac/
# upload css
-
scp -o 'StrictHostKeyChecking no' ahikar.css $SSH_USER@$SSH_IP:~/$TARGET/frontend/
## GLOBAL VARIABLES
variables
:
# ↓ needed to handle concurrency
...
...
@@ -61,57 +79,36 @@ build:
-
ahikar.css
update_backend-test
:
stage
:
update-backend
image
:
rsamban/scp-resource:latest
variables
:
TARGET="test"
SERVER="ahikar-test"
script
:
-
*ssh
-
*deploy
update_backend-develop
:
stage
:
update-backend
image
:
rsamban/scp-resource:latest
only
:
-
develop
variables
:
TARGET="develop"
SERVER="ahikar-dev"
script
:
-
*ssh
# set entry point for develop
-
sed -i "s ahikar.*\.sub ahikar-dev.sub g" tido/dist/index.html
# arabic-karshuni
## remove old version
-
ssh -o 'StrictHostKeyChecking no' $SSH_USER@$SSH_IP "rm -rf ~/$CI_COMMIT_REF_NAME/frontend/arabic-karshuni/*"
-
ssh -o 'StrictHostKeyChecking no' $SSH_USER@$SSH_IP "rm -rf ~/test/frontend/arabic-karshuni/*"
## upload new version
-
scp -o 'StrictHostKeyChecking no' -r tido/dist/* $SSH_USER@$SSH_IP:~/$CI_COMMIT_REF_NAME/frontend/arabic-karshuni/
-
ssh -o 'StrictHostKeyChecking no' $SSH_USER@$SSH_IP "cp -r ~/$CI_COMMIT_REF_NAME/frontend/arabic-karshuni/* ~/test/frontend/arabic-karshuni/"
## set entry point for test
-
ssh -o 'StrictHostKeyChecking no' $SSH_USER@$SSH_IP "sed -i 's ahikar-dev.*\.sub ahikar-test.sub g' ~/test/frontend/arabic-karshuni/index.html"
# syriac
## remove old version
-
sed -i 's/textapi\/ahikar\/arabic-karshuni/textapi\/ahikar\/syriac/' tido/dist/index.html
-
ssh -o 'StrictHostKeyChecking no' $SSH_USER@$SSH_IP "rm -rf ~/$CI_COMMIT_REF_NAME/frontend/syriac/*"
-
ssh -o 'StrictHostKeyChecking no' $SSH_USER@$SSH_IP "rm -rf ~/test/frontend/syriac/*"
## upload new version
-
scp -o 'StrictHostKeyChecking no' -r tido/dist/* $SSH_USER@$SSH_IP:~/$CI_COMMIT_REF_NAME/frontend/syriac/
-
ssh -o 'StrictHostKeyChecking no' $SSH_USER@$SSH_IP "cp -r ~/$CI_COMMIT_REF_NAME/frontend/arabic-karshuni/* ~/test/frontend/syriac/"
## set entry point for test
-
ssh -o 'StrictHostKeyChecking no' $SSH_USER@$SSH_IP "sed -i 's ahikar-dev.*\.sub ahikar-test.sub g' ~/test/frontend/syriac/index.html"
# upload css
-
scp -o 'StrictHostKeyChecking no' ahikar.css $SSH_USER@$SSH_IP:~/$CI_COMMIT_REF_NAME/frontend/
-
scp -o 'StrictHostKeyChecking no' ahikar.css $SSH_USER@$SSH_IP:~/test/frontend/
-
*deploy
update_backend-main
:
stage
:
update-backend
image
:
rsamban/scp-resource:latest
only
:
-
main
variables
:
TARGET="main"
SERVER="ahikar"
script
:
-
*ssh
-
sed -i "s ahikar.*\.sub ahikar.sub g" tido/dist/index.html
# arabic-karshuni
## remove old version
-
ssh -o 'StrictHostKeyChecking no' $SSH_USER@$SSH_IP "rm -rf ~/$CI_COMMIT_REF_NAME/frontend/arabic-karshuni/*"
## upload new version
-
scp -o 'StrictHostKeyChecking no' -r tido/dist/* $SSH_USER@$SSH_IP:~/$CI_COMMIT_REF_NAME/frontend/arabic-karshuni/
# syriac
## remove old version
-
sed -i 's/textapi\/ahikar\/arabic-karshuni/textapi\/ahikar\/syriac/' tido/dist/index.html
-
ssh -o 'StrictHostKeyChecking no' $SSH_USER@$SSH_IP "rm -rf ~/$CI_COMMIT_REF_NAME/frontend/syriac/*"
## upload new version
-
scp -o 'StrictHostKeyChecking no' -r tido/dist/* $SSH_USER@$SSH_IP:~/$CI_COMMIT_REF_NAME/frontend/syriac/
# upload css
-
scp -o 'StrictHostKeyChecking no' ahikar.css $SSH_USER@$SSH_IP:~/$CI_COMMIT_REF_NAME/frontend/
-
*deploy
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment