Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
courses
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
R3
school
courses
Commits
325e30c4
Verified
Commit
325e30c4
authored
4 years ago
by
Laurent Heirendt
Browse files
Options
Downloads
Patches
Plain Diff
swap version
parent
111b75cc
No related branches found
No related tags found
1 merge request
!80
Regular merge of develop
Pipeline
#29246
passed
4 years ago
Stage: build
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.ci/deploy.sh
+9
-1
9 additions, 1 deletion
.ci/deploy.sh
.gitlab-ci.yml
+1
-11
1 addition, 11 deletions
.gitlab-ci.yml
with
10 additions
and
12 deletions
.ci/deploy.sh
+
9
−
1
View file @
325e30c4
...
...
@@ -9,6 +9,14 @@ echo $rootDir
rm
-rf
$rootDir
/public
mkdir
$rootDir
/public
if
[[
$CI_COMMIT_BRANCH
==
"develop"
]]
;
then
version
=
"latest"
;
elif
[[
$CI_COMMIT_BRANCH
==
"master"
]]
;
then
version
=
"stable"
;
else
version
=
"unstable"
;
fi
# loop through all the presentations
nBlades
=
0
for
d
in
$(
find
.
-maxdepth
1
-type
d
)
...
...
@@ -44,7 +52,7 @@ do
yarn
install
grunt dist
mv
public/
*
$rootDir
/public/
$BLADE
/.
mv
public/
*
$rootDir
/public/
$BLADE
/
$version
/
.
echo
" > latest built for file set
${
BLADE
}
"
...
...
This diff is collapsed.
Click to expand it.
.gitlab-ci.yml
+
1
−
11
View file @
325e30c4
...
...
@@ -25,14 +25,6 @@ production:
stage
:
deploy
image
:
alpine:3.1
before_script
:
# define the branch
-
if [[ $CI_COMMIT_BRANCH == "develop" ]]; then
version="latest";
elif [[ $CI_COMMIT_BRANCH == "master" ]]; then
version="stable";
else
version="unstable";
fi
-
'
which
ssh-agent
||
(
apk
add
--update
openssh
)'
-
eval $(ssh-agent -s)
-
echo "$B64SSHPRIVKEY" | base64 -d | tr -d '\r' | ssh-add - > /dev/null
...
...
@@ -43,6 +35,4 @@ production:
rules
:
-
if
:
'
$CI_COMMIT_BRANCH
==
"develop"'
script
:
-
ssh -p $SSHPORT $SSHCONNECT "rm -rf ~/web/latest/*"
-
ssh -p $SSHPORT $SSHCONNECT "mkdir ~/web/latest/$version"
-
scp -P $SSHPORT -r public/* $SSHCONNECT:~/web/latest/$version
-
scp -P $SSHPORT -r public/* $SSHCONNECT:~/web/latest
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment