Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
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
Michael Black
OpenXG-RAN
Commits
640e3ce8
Commit
640e3ce8
authored
Oct 11, 2021
by
hardy
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/ci_push_dockerhub' into integration_2021_wk41
parents
0276ec0c
929cfef8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
101 additions
and
0 deletions
+101
-0
ci-scripts/Jenkinsfile-GitLab-Container
ci-scripts/Jenkinsfile-GitLab-Container
+15
-0
ci-scripts/Jenkinsfile-push-registry
ci-scripts/Jenkinsfile-push-registry
+86
-0
No files found.
ci-scripts/Jenkinsfile-GitLab-Container
View file @
640e3ce8
...
@@ -220,6 +220,21 @@ pipeline {
...
@@ -220,6 +220,21 @@ pipeline {
}
}
}
}
}
}
stage
(
"Images Push to Registries"
)
{
when
{
expression
{
"PUSH"
.
equals
(
env
.
gitlabActionType
)}
}
steps
{
script
{
triggerSlaveJob
(
'RAN-DockerHub-Push'
,
'Push-to-Docker-Hub'
)
}
post
{
failure
{
script
{
currentBuild
.
result
=
'FAILURE'
}
}
}
}
}
}
}
post
{
post
{
always
{
always
{
...
...
ci-scripts/Jenkinsfile-push-registry
0 → 100644
View file @
640e3ce8
#
!
/bin/
groovy
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
// Location of the python executor node shall be in the same subnet as the others servers
def
nodeExecutor
=
params
.
nodeExecutor
// Name of the phone resource
def
ciServerResource
=
params
.
serverResource
pipeline
{
agent
{
label
nodeExecutor
}
options
{
disableConcurrentBuilds
()
ansiColor
(
'xterm'
)
lock
(
ciServerResource
)
}
stages
{
stage
(
"Verify Parameters"
)
{
steps
{
script
{
echo
'\u2705 \u001B[32mVerify Parameters\u001B[0m'
def
allParametersPresent
=
true
// It is already to late to check it
if
(
params
.
nodeExecutor
!=
null
)
{
echo
"Docker Push executor node : ${nodeExecutor}"
}
if
(
params
.
serverResource
==
null
)
{
allParametersPresent
=
false
}
}
}
}
stage
(
"Push to DockerHub"
)
{
steps
{
script
{
WEEK_TAG
=
sh
returnStdout:
true
,
script:
'date +"%Y.w%U"'
WEEK_TAG
=
WEEK_TAG
.
trim
()
withCredentials
([
[
$class
:
'UsernamePasswordMultiBinding'
,
credentialsId:
"${params.DH_Credentials}"
,
usernameVariable:
'DH_Username'
,
passwordVariable:
'DH_Password'
]
])
{
def
listOfImages
=
[
"oai-enb"
,
"oai-gnb"
,
"oai-lte-ue"
,
"oai-nr-ue"
]
sh
"docker login -u ${DH_Username} -p ${DH_Password} > /dev/null 2>&1"
listOfImages
.
eachWithIndex
{
item
,
iindex
->
sh
"docker image tag ${item}:develop ${DH_Username}/${item}:develop"
sh
"docker image tag ${item}:develop ${DH_Username}/${item}:${WEEK_TAG}"
sh
"docker push --quiet ${DH_Username}/${item}:${WEEK_TAG}"
sh
"docker push --quiet ${DH_Username}/${item}:develop"
sh
"docker rmi ${DH_Username}/${item}:${WEEK_TAG} ${DH_Username}/${item}:develop"
}
sh
"docker logout > /dev/null 2>&1"
}
}
}
}
}
post
{
always
{
script
{
echo
"End of Registry Push"
}
}
}
}
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