Added Jenkinsfile 12
This commit is contained in:
8
Jenkinsfile
vendored
8
Jenkinsfile
vendored
@@ -28,6 +28,7 @@ node {
|
||||
def jobName = env.JOB_NAME.tokenize('/')
|
||||
print env.jobName
|
||||
env.DOCKER_NAME="${jobName[0]}/${jobName[1]}:${env.BRANCH_NAME}-${env.GIT_COMMIT}"
|
||||
env.DOCKER_REGISTRY="docker.sebse.de"
|
||||
|
||||
env.NODEJS_HOME = "${tool 'node14'}"
|
||||
env.PATH="${env.NODEJS_HOME}/bin:${env.PATH}"
|
||||
@@ -65,7 +66,7 @@ node {
|
||||
|
||||
sh 'node -v'
|
||||
sh 'npm prune'
|
||||
sh 'npm install -DP'
|
||||
sh 'npm install -D -P'
|
||||
sh './node_modules/.bin/tsc'
|
||||
sh 'rm node_modules -rf'
|
||||
sh 'npm install --only=production'
|
||||
@@ -79,7 +80,7 @@ node {
|
||||
stage('Deploy'){
|
||||
|
||||
echo 'Push to Repo'
|
||||
docker.withRegistry('https://docker.sebse.de', 'docker-registry-robot-web-development') {
|
||||
docker.withRegistry("https://${DOCKER_REGISTRY}", 'docker-registry-robot-web-development') {
|
||||
|
||||
/* Push the container to the custom Registry */
|
||||
customImage.push()
|
||||
@@ -95,6 +96,9 @@ node {
|
||||
echo 'prune and cleanup'
|
||||
sh 'npm prune'
|
||||
sh 'rm node_modules -rf'
|
||||
sh "docker rmi ${env.DOCKER_NAME} ${DOCKER_REGISTRY}/${env.DOCKER_NAME}"
|
||||
sh 'docker image prune'
|
||||
sh 'docker rmi $(docker images -a | grep "<none>" | awk "{print \$3}") &2>/del/null || exit 0'
|
||||
|
||||
/*mail body: 'project build successful',
|
||||
from: 'xxxx@yyyyy.com',
|
||||
|
||||
1207
package-lock.json
generated
1207
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user