Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
reactjs-ci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Bùi Bá Trường
reactjs-ci
Commits
7568502f
Commit
7568502f
authored
Aug 01, 2019
by
Bùi Bá Trường
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
truongbb - test email
parent
7c24f1f1
Pipeline
#495
failed with stages
in 11 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
81 additions
and
47 deletions
+81
-47
.gitlab-ci.yml
.gitlab-ci.yml
+24
-38
.gitlab-ci_bk.yml
.gitlab-ci_bk.yml
+57
-0
build.sh
build.sh
+0
-9
No files found.
.gitlab-ci.yml
View file @
7568502f
image
:
node:latest
before_script
:
# Setup SSH deploy keys
-
'
which
ssh-agent
||
(
yum
install
-qq
openssh-client
)'
-
eval $(ssh-agent -s)
-
echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
...
...
@@ -11,30 +10,14 @@ before_script:
-
'
[[
-f
/.dockerenv
]]
&&
echo
-e
"Host
*\n\tStrictHostKeyChecking
no\n\n"
>
~/.ssh/config'
-
whoami
-
unset SSH_ASKPASS
# Cache node modules - speeds up future builds
# cache:
# paths:
# - node_modules
# variables:
# PUBLIC_URL: /reactjs-ci
stages
:
# - tes
t
-
checkou
t
-
build
-
send_email
# test:
# stage: test
# script:
# - npm install
# - npm test
# artifacts:
# paths:
# - dist/
# - send_email
build
:
stage
:
build
checkout
:
stage
:
checkout
only
:
-
master
# - merge_requests
...
...
@@ -46,29 +29,32 @@ build:
-
git config --global user.name 'truongbb96'
-
git config --global user.email 'truongbb@itsol.vn'
-
git clone https://truongbb96:hoanghuynh0801@git.myitsol.com/truongbb96/reactjs-ci.git
-
cd ./reactjs-ci
build
:
stage
:
build
only
:
-
master
# - merge_requests
script
:
-
cd /root/GitlabRunner/repo/reactjs-ci
-
sh ./build.sh
-
ls
# - ssh -o StrictHostKeyChecking=no root@192.168.1.201 "cd /root/GitlabRunner/repo/ && ls && rm -rf ./ci"
# - ssh -o StrictHostKeyChecking=no root@192.168.1.201 "cd /root/GitlabRunner/repo && unset SSH_ASKPASS && git config --global user.name 'truongbb96' && git config --global user.email 'truongbb@itsol.vn' && git clone https://truongbb96:hoanghuynh0801@git.myitsol.com/truongbb96/ci.git"
# - ssh -o StrictHostKeyChecking=no root@192.168.1.201 "cd /root/GitlabRunner/repo/ci && npm install && npm start"
# - ssh -o StrictHostKeyChecking=no root@192.168.1.201 "cd /root/GitlabRunner/repo/ci && docker-compose -p app -f docker-compose.yml down && echo '-------------' && docker-compose -p app -f docker-compose.yml build && echo '-------------' && docker-compose -p app -f docker-compose.yml up"
# - ssh -o StrictHostKeyChecking=no root@192.168.1.201 "cd /root/GitlabRunner/repo/ci && sh ./build.sh"
# - ssh -o StrictHostKeyChecking=no root@192.168.1.201 "ls" # test command
artifacts
:
paths
:
-
public
# The built files for Gitlab Pages to serve
-
public
send_email
:
stage
:
send_email
only
:
-
master
# - merge_requests
script
:
-
curl --request POST
--url https://api.sendgrid.com/v3/mail/send
--header 'Authorization:Bearer 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'
--header 'Content-Type:application/json'
--data '{"personalizations":[{"to":[{"email":"truongbb96@gmail.com"}]}],"from":{"email":"truongbb@itsol.vn"},"subject":"CI pipeline result","content":[{"type":"text/plain","value":"CI pipeline done!"}]}'
\ No newline at end of file
# send_email:
# stage: send_email
# only:
# - master
# # - merge_requests
# script:
# - curl --request POST
# --url https://api.sendgrid.com/v3/mail/send
# --header 'Authorization:Bearer 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'
# --header 'Content-Type:application/json'
# --data '{"personalizations":[{"to":[{"email":"truongbb96@gmail.com"}]}],"from":{"email":"truongbb@itsol.vn"},"subject":"CI pipeline result","content":[{"type":"text/plain","value":"CI pipeline done!"}]}'
\ No newline at end of file
.gitlab-ci_bk.yml
0 → 100644
View file @
7568502f
image
:
node:latest
before_script
:
# Setup SSH deploy keys
-
'
which
ssh-agent
||
(
yum
install
-qq
openssh-client
)'
-
eval $(ssh-agent -s)
-
echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
-
mkdir -p ~/.ssh
-
chmod 700 ~/.ssh
-
ssh-keyscan -t rsa 192.168.1.201 >> ~/.ssh/known_hosts
-
'
[[
-f
/.dockerenv
]]
&&
echo
-e
"Host
*\n\tStrictHostKeyChecking
no\n\n"
>
~/.ssh/config'
-
whoami
-
unset SSH_ASKPASS
stages
:
-
build
-
send_email
build
:
stage
:
build
only
:
-
master
# - merge_requests
script
:
# - ssh -o StrictHostKeyChecking=no root#@192.168.1.201 "ls" # test command
-
ls
-
cd /root/GitlabRunner/repo/ && ls
-
rm -rf ./ci
-
git config --global user.name 'truongbb96'
-
git config --global user.email 'truongbb@itsol.vn'
-
git clone https://truongbb96:hoanghuynh0801@git.myitsol.com/truongbb96/reactjs-ci.git
-
cd ./reactjs-ci
-
sh ./build.sh
-
ls
# - ssh -o StrictHostKeyChecking=no root@192.168.1.201 "cd /root/GitlabRunner/repo/ && ls && rm -rf ./ci"
# - ssh -o StrictHostKeyChecking=no root@192.168.1.201 "cd /root/GitlabRunner/repo && unset SSH_ASKPASS && git config --global user.name 'truongbb96' && git config --global user.email 'truongbb@itsol.vn' && git clone https://truongbb96:hoanghuynh0801@git.myitsol.com/truongbb96/ci.git"
# - ssh -o StrictHostKeyChecking=no root@192.168.1.201 "cd /root/GitlabRunner/repo/ci && npm install && npm start"
# - ssh -o StrictHostKeyChecking=no root@192.168.1.201 "cd /root/GitlabRunner/repo/ci && docker-compose -p app -f docker-compose.yml down && echo '-------------' && docker-compose -p app -f docker-compose.yml build && echo '-------------' && docker-compose -p app -f docker-compose.yml up"
# - ssh -o StrictHostKeyChecking=no root@192.168.1.201 "cd /root/GitlabRunner/repo/ci && sh ./build.sh"
# - ssh -o StrictHostKeyChecking=no root@192.168.1.201 "ls" # test command
artifacts
:
paths
:
-
public
send_email
:
stage
:
send_email
only
:
-
master
# - merge_requests
script
:
-
curl --request POST
--url https://api.sendgrid.com/v3/mail/send
--header 'Authorization:Bearer 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'
--header 'Content-Type:application/json'
--data '{"personalizations":[{"to":[{"email":"truongbb96@gmail.com"}]}],"from":{"email":"truongbb@itsol.vn"},"subject":"CI pipeline result","content":[{"type":"text/plain","value":"CI pipeline done!"}]}'
\ No newline at end of file
build.sh
View file @
7568502f
#!/bin/bash
# echo "Revert source code!"
# git checkout src
# git checkout public
# echo "Done!"
# echo "Pulling new source version!"
# git pull
# echo "Done!"
echo
"-------------------------Shut down all!-------------------------"
docker-compose
-p
app
-f
docker-compose.yml down
...
...
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