Skip to content
GitLab
Next
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Primary navigation
Search or go to…
Project
A
apilab
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
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
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
Privacy statement
Keyboard shortcuts
?
What's new
4
Snippets
Groups
Projects
Show more breadcrumbs
GitLab.org
apilab
Commits
4c884367
There was a problem fetching the pipeline summary.
Commit
4c884367
authored
8 years ago
by
Eric Eastwood
Browse files
Options
Downloads
Patches
Plain Diff
Update gitlab-ci for deployment v1
parent
e771253e
No related branches found
No related tags found
No related merge requests found
Pipeline
#
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+31
-5
31 additions, 5 deletions
.gitlab-ci.yml
with
31 additions
and
5 deletions
.gitlab-ci.yml
+
31
−
5
View file @
4c884367
...
...
@@ -12,6 +12,22 @@ stages:
before_script
:
-
node --version
-
npm --version
# See https://docs.gitlab.com/ee/ci/ssh_keys/README.html
# -----------------------------------------------------------
# Install ssh-agent if not already installed, it is required by Docker.
# (change apt-get to yum if you use a CentOS-based image)
-
'
which
ssh-agent
||
(
apt-get
update
-y
&&
apt-get
install
openssh-client
-y
)'
# Run ssh-agent (inside the build environment)
-
eval $(ssh-agent -s)
# Add the SSH key stored in SSH_PRIVATE_KEY variable to the agent store
-
ssh-add <(echo "$SSH_PRIVATE_KEY")
# For Docker builds disable host key checking. Be aware that by adding that
# you are suspectible to man-in-the-middle attacks.
# WARNING: Use this only with the Docker executor, if you use it with shell
# you will overwrite your user's SSH config.
-
mkdir -p ~/.ssh
-
'
[[
-f
/.dockerenv
]]
&&
echo
-e
"Host
*\n\tStrictHostKeyChecking
no\n\n"
>
~/.ssh/config'
build
:
stage
:
build
...
...
@@ -20,9 +36,9 @@ build:
artifacts
:
paths
:
-
node_modules/
#- dist/ # Generated during the server startup
tags
:
-
nodejs-app
-
docker
-
shared
test
:
...
...
@@ -30,12 +46,22 @@ test:
script
:
-
npm run lint
tags
:
-
nodejs-app
-
docker
-
shared
deploy
:
stage
:
deploy
script
:
-
'
echo
"TODO:
Deploy"'
-
rsync -r --delete-after --quiet . $SSH_USER@$DEPLOY_HOST::/var/www/apilab
-
ssh $SSH_USER@$DEPLOY_HOST <<EOF
pm2 restart apilab
EOF
environment
:
name
:
production
url
:
https://apilab.gitlab.org
only
:
-
master
tags
:
-
nodejs-app
-
docker
-
shared
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