Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
WebFront
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
websystem
WebFront
Commits
033c577e
Commit
033c577e
authored
7 months ago
by
심재엽
Browse files
Options
Downloads
Patches
Plain Diff
chore: 원격 서버에 디렉토리 생성 및 권한 설정
parent
1686214d
No related branches found
No related tags found
No related merge requests found
Pipeline
#10731
passed
7 months ago
Stage: build
Stage: deploy
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+4
-1
4 additions, 1 deletion
.gitlab-ci.yml
with
4 additions
and
1 deletion
.gitlab-ci.yml
+
4
−
1
View file @
033c577e
...
...
@@ -25,8 +25,11 @@ deploy:
-
echo "$SSH_PEM_KEY_BASE64" | base64 -d > ~/.ssh/id_rsa.pem
-
chmod 600 ~/.ssh/id_rsa.pem
script
:
# EC2에 파일 업로드 및 Nginx 재시작
# 원격 서버에 디렉토리 생성 및 권한 설정
-
ssh -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa.pem $SSH_USER@$EC2_HOST "sudo mkdir -p /var/www/html && sudo chown -R $SSH_USER:$SSH_USER /var/www/html"
# 파일 업로드
-
scp -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa.pem -r build/* $SSH_USER@$EC2_HOST:/var/www/html
# Nginx 재시작
-
ssh -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa.pem $SSH_USER@$EC2_HOST "sudo systemctl reload nginx"
only
:
-
main
# main 브랜치에 푸시될 때만 실행
\ No newline at end of file
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