Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
R
red-ci-cd
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
red-group-test
red-ci-cd
Commits
5303a7b2
Commit
5303a7b2
authored
Apr 06, 2020
by
John Red Medrano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
initial
parent
3636480f
Pipeline
#282
failed
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
22 deletions
+45
-22
.gitlab-ci.yml
.gitlab-ci.yml
+45
-22
No files found.
.gitlab-ci.yml
View file @
5303a7b2
stages
:
stages
:
-
initial_repo
-
initial_repo
-
build
-
clean_initial_repo
-
cleanup_build
-
rebuild_dev
-
clean_rebuild_dev
-
build_sit
-
rebuild_sit
in
tial_dev
:
in
itial_repo
:
stage
:
initial_repo
stage
:
initial_repo
image
:
ubuntu
image
:
ubuntu
rules
:
rules
:
-
if
:
'
$CI_COMMIT_MESSAGE
=~
/initial/'
-
if
:
'
$CI_COMMIT_MESSAGE
=~
/initial/
&&
$CI_MERGE_REQUEST_TARGET_BRANCH_NAME
==
"red-develop"
'
when
:
always
when
:
always
# except:
# except:
# variables:
# variables:
...
@@ -43,12 +46,28 @@ intial_dev:
...
@@ -43,12 +46,28 @@ intial_dev:
-
echo "Successfully build dev environment"
-
echo "Successfully build dev environment"
-
echo "Closed"
-
echo "Closed"
buid_dev
:
clean_initial_repo
:
stage
:
build
stage
:
clean_initial_repo
image
:
ubuntu
image
:
ubuntu
script
:
-
echo "this is a clean up for clean_initial_repo"
-
'
which
ssh-agent
||
(
apt-get
update
-y
&&
apt-get
install
openssh-client
-y)'
-
eval $(ssh-agent -s)
-
mkdir -p ~/.ssh
-
chmod 700 ~/.ssh
-
echo "$CENTOS_SERVER" | ssh-add - > ~/.ssh/id_rsa
-
'
[[
-f
/.dockerenv
]]
&&
echo
-e
"Host
*\n\tStrictHostKeyChecking
no\n\n"
>
~/.ssh/config'
-
ssh -tt centos@13.251.192.208 "sudo rm -rf /var/www/gitlab_variable_red/dev"
rules
:
rules
:
-
if
:
'
$CI_COMMIT_MESSAGE
!~
/initial/'
-
if
:
'
$CI_COMMIT_MESSAGE
=~
/initial/
&&
$CI_MERGE_REQUEST_TARGET_BRANCH_NAME
==
"red-develop"'
when
:
always
when
:
on_failure
rebuild_dev
:
stage
:
rebuild_dev
image
:
ubuntu
rules
:
-
if
:
'
$CI_COMMIT_MESSAGE
!~
/initial/
&&
$CI_MERGE_REQUEST_TARGET_BRANCH_NAME
==
"red-develop"'
when
:
always
# only:
# only:
# refs:
# refs:
# - red-develop
# - red-develop
...
@@ -75,24 +94,28 @@ buid_dev:
...
@@ -75,24 +94,28 @@ buid_dev:
-
echo "Closed"
-
echo "Closed"
cleanup_build_dev
:
clean_rebuild_dev
:
stage
:
cleanup_build
stage
:
clean_rebuild_dev
image
:
ubuntu
image
:
ubuntu
script
:
script
:
-
'
which
ssh-agent
||
(
apt-get
update
-y
&&
apt-get
install
openssh-client
-y)'
-
echo "this is a clean up for clean_rebuild_dev"
-
eval $(ssh-agent -s)
-
'
which
ssh-agent
||
(
apt-get
update
-y
&&
apt-get
install
openssh-client
-y)'
-
mkdir -p ~/.ssh
-
eval $(ssh-agent -s)
-
chmod 700 ~/.ssh
-
mkdir -p ~/.ssh
-
echo "$CENTOS_SERVER" | ssh-add - > ~/.ssh/id_rsa
-
chmod 700 ~/.ssh
-
'
[[
-f
/.dockerenv
]]
&&
echo
-e
"Host
*\n\tStrictHostKeyChecking
no\n\n"
>
~/.ssh/config'
-
echo "$CENTOS_SERVER" | ssh-add - > ~/.ssh/id_rsa
-
ssh -tt centos@13.251.192.208 "sudo rm -rf /var/www/gitlab_variable_red/dev"
-
'
[[
-f
/.dockerenv
]]
&&
echo
-e
"Host
*\n\tStrictHostKeyChecking
no\n\n"
>
~/.ssh/config'
when
:
on_failure
-
ssh -tt centos@13.251.192.208 "sudo rm -rf /var/www/gitlab_variable_red/dev"
rules
:
-
if
:
'
$CI_COMMIT_MESSAGE
=~
/initial/
&&
$CI_MERGE_REQUEST_TARGET_BRANCH_NAME
==
"red-develop"'
when
:
on_failure
build sit
:
build sit
:
stage
:
build
stage
:
build
_sit
image
:
ubuntu
image
:
ubuntu
rules
:
rules
:
-
if
:
'
$CI_MERGE_REQUEST_TARGET_BRANCH_NAME
==
"red-test-sit"'
-
if
:
'
$CI_MERGE_REQUEST_TARGET_BRANCH_NAME
==
"red-test-sit"'
...
...
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