Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Engel Simulator 2020
Engel Simulator 2020
Commits
ba9e0b92
Commit
ba9e0b92
authored
Dec 30, 2020
by
Rahix
🦀
Browse files
Merge 'ci: Atomically deploy updates'
See merge request
!47
parents
c8a886d8
06643b1e
Changes
2
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
ba9e0b92
...
...
@@ -59,7 +59,7 @@ deploy:
tags
:
-
local
script
:
-
"
cp
-r
www/dist
/*
/var/www
/game"
-
./ci/deploy.sh
www/dist /var/www
only
:
-
master
-
tags
ci/deploy.sh
0 → 100755
View file @
ba9e0b92
#!/bin/bash
set
-e
INDIR
=
"
$1
"
OUTDIR
=
"
$2
"
if
!
test
-h
"
$OUTDIR
/game"
&&
test
-d
"
$OUTDIR
/game"
;
then
echo
"Removing legacy deployment directory ..."
rm
-r
"
$OUTDIR
/game"
fi
if
!
test
-d
"
$OUTDIR
/versions"
;
then
echo
"Creating versions directory ..."
mkdir
"
$OUTDIR
/versions"
fi
VERSION
=
"
$(
git
-C
"
$INDIR
"
describe
--always
--long
)
"
echo
"Copying to
$OUTDIR
/versions/
$VERSION
..."
cp
-rT
"
$INDIR
"
"
$OUTDIR
/versions/
$VERSION
"
echo
"Atomically updating symlink ..."
ln
-nsf
"
$OUTDIR
/versions/
$VERSION
"
"
$OUTDIR
/new-game"
mv
-T
"
$OUTDIR
/new-game"
"
$OUTDIR
/game"
echo
"WE ARE LIVE!"
echo
"Cleaning up previous deployments ..."
for
PREVIOUS
in
"
$OUTDIR
/versions"
/
*
;
do
if
!
[
"
$PREVIOUS
"
=
"
$OUTDIR
/versions/
$VERSION
"
]
;
then
echo
" - Removing
$PREVIOUS
..."
rm
-r
"
$PREVIOUS
"
fi
done
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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