Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
ejercicio2-framework-front
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
Josue
ejercicio2-framework-front
Commits
bf4440ee
Commit
bf4440ee
authored
Mar 08, 2021
by
Marco Ortiz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
aff54663
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
66 deletions
+56
-66
Jenkinsfile
Jenkinsfile
+56
-66
No files found.
Jenkinsfile
View file @
bf4440ee
...
...
@@ -5,7 +5,7 @@ pipeline {
tag_name
=
"192.168.27.148:5000"
credentials
=
"admin-docker-hub"
dockerImage
=
''
PACKAGE_VERSION
=
'.
'
PACKAGE_VERSION
=
sh
returnStdout:
true
,
script:
'''grep 'version' package.json | cut -d '"' -f4 | tr '\n' '\0'''
'
}
agent
any
parameters
{
...
...
@@ -16,77 +16,67 @@ pipeline {
steps
{
echo
"Branch is ${env.BRANCH_NAME}..."
nodejs
(
nodeJSInstallationName:
'NodeJS13'
,
configId:
'77600a18-f968-4cca-83e4-a9f76d165336'
)
{
echo
"Current package version: $PACKAGE_VERSION"
sh
'PACKAGE_VERSION=$(node -p -e "require(\'./package.json\').version")'
echo
"Branch1112211 is ${PACKAGE_VERSION}"
echo
"Branch1112211 is $PACKAGE_VERSION"
// sh 'npm config ls'
// sh 'npm install'
// sh 'npm i -D typescript@3.4.3'
sh
'npm config ls'
sh
'npm install'
sh
'npm i -D typescript@3.4.3'
}
echo
"Branch
11111
is ${PACKAGE_VERSION}..."
echo
"Branch is ${PACKAGE_VERSION}..."
}
}
stage
(
'Install2'
)
{
stage
(
'Test'
)
{
parallel
{
stage
(
'Static code analysis'
)
{
steps
{
nodejs
(
nodeJSInstallationName:
'NodeJS13'
,
configId:
'77600a18-f968-4cca-83e4-a9f76d165336'
)
{
sh
'npm run-script lint'
}
}
}
}
}
stage
(
'Build'
)
{
steps
{
echo
"Branch is ${PACKAGE_VERSION}..."
nodejs
(
nodeJSInstallationName:
'NodeJS13'
,
configId:
'77600a18-f968-4cca-83e4-a9f76d165336'
)
{
sh
'ng build'
}
}
}
// stage('Test') {
// parallel {
// stage('Static code analysis') {
// steps {
// nodejs(nodeJSInstallationName: 'NodeJS13', configId: '77600a18-f968-4cca-83e4-a9f76d165336') {
// sh 'npm run-script lint'
// }
// }
// }
// }
// }
// stage('Build') {
// steps {
// nodejs(nodeJSInstallationName: 'NodeJS13', configId: '77600a18-f968-4cca-83e4-a9f76d165336') {
// sh 'ng build'
// }
// }
// }
// stage('Build Docker Image') {
// when {
// expression { params.include_docker == 'yes' }
// }
// steps {
// nodejs(nodeJSInstallationName: 'NodeJS13', configId: '77600a18-f968-4cca-83e4-a9f76d165336') {
// sh 'PACKAGE_VERSION=$(node -p -e "require(\'./package.json\').version")'
// }
// script {
// dockerImage = docker.build imagename
// }
// }
// }
// stage('Deploy Image') {
// when {
// expression { params.include_docker == 'yes' }
// }
// steps{
// script {
// docker.withRegistry(url, credentials ) {
// dockerImage.push("$PACKAGE_VERSION")
// dockerImage.push('latest')
// }
// }
// }
// }
// stage('Remove Unused docker image') {
// when {
// expression { params.include_docker == 'yes' }
// }
// steps{
// sh "docker rmi $tag_name/$imagename:$PACKAGE_VERSION"
// sh "docker rmi $tag_name/$imagename:latest"
// }
// }
}
stage
(
'Build Docker Image'
)
{
when
{
expression
{
params
.
include_docker
==
'yes'
}
}
steps
{
nodejs
(
nodeJSInstallationName:
'NodeJS13'
,
configId:
'77600a18-f968-4cca-83e4-a9f76d165336'
)
{
sh
'PACKAGE_VERSION=$(node -p -e "require(\'./package.json\').version")'
}
script
{
dockerImage
=
docker
.
build
imagename
}
}
}
stage
(
'Deploy Image'
)
{
when
{
expression
{
params
.
include_docker
==
'yes'
}
}
steps
{
script
{
docker
.
withRegistry
(
url
,
credentials
)
{
dockerImage
.
push
(
"$PACKAGE_VERSION"
)
dockerImage
.
push
(
'latest'
)
}
}
}
}
stage
(
'Remove Unused docker image'
)
{
when
{
expression
{
params
.
include_docker
==
'yes'
}
}
steps
{
sh
"docker rmi $tag_name/$imagename:$PACKAGE_VERSION"
sh
"docker rmi $tag_name/$imagename:latest"
}
}
}
}
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