Skip to content
This repository has been archived by the owner on Oct 19, 2020. It is now read-only.

Commit

Permalink
Update jenkinsfile naming (#1)
Browse files Browse the repository at this point in the history
Change image env name
add build-image target

Co-authored-by: osher cohen <[email protected]>
  • Loading branch information
oshercc and osher cohen authored Aug 12, 2020
1 parent 5edcbd2 commit b7c1107
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
14 changes: 7 additions & 7 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
pipeline {
environment {
GENERATOR_IMAGE = 'quay.io/ocpmetal/assisted-ignition-generator'
GENERATOR = 'quay.io/ocpmetal/assisted-ignition-generator'
}
agent {
node {
label 'host'
label 'centos_worker'
}

}
stages {
stage('build') {
steps {
sh 'skipper make'
sh 'make build-image'
}
}

Expand All @@ -26,10 +26,10 @@ pipeline {
sh '''docker login quay.io -u $USER -p $PASS'''
}

sh '''docker tag ${GENERATOR_IMAGE} ${GENERATOR_IMAGE}:latest'''
sh '''docker tag ${GENERATOR_IMAGE} ${GENERATOR_IMAGE}:${GIT_COMMIT}'''
sh '''docker push ${GENERATOR_IMAGE}:latest'''
sh '''docker push ${GENERATOR_IMAGE}:${GIT_COMMIT}'''
sh '''docker tag ${GENERATOR} ${GENERATOR}:latest'''
sh '''docker tag ${GENERATOR} ${GENERATOR}:${GIT_COMMIT}'''
sh '''docker push ${GENERATOR}:latest'''
sh '''docker push ${GENERATOR}:${GIT_COMMIT}'''
}

}
Expand Down
11 changes: 7 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
SERVICE := $(or ${SERVICE},quay.io/ocpmetal/assisted-ignition-generator:latest)
GENERATOR := $(or ${GENERATOR},quay.io/ocpmetal/assisted-ignition-generator:latest)


all: pep8 pylint build

build:
skipper build assisted-ignition-generator
skipper build assisted-ignition-generator

build-image:
docker build -f Dockerfile.assisted-ignition-generator . -t $(GENERATOR)

update: build
GIT_REVISION=${GIT_REVISION} docker build --pull --build-arg GIT_REVISION -t $(SERVICE) -f Dockerfile.assisted-ignition-generator .
docker push $(SERVICE)
GIT_REVISION=${GIT_REVISION} docker build --pull --build-arg GIT_REVISION -t $(GENERATOR) -f Dockerfile.assisted-ignition-generator .
docker push $(GENERATOR)

.DEFAULT:
skipper -v $(MAKE) $@

0 comments on commit b7c1107

Please sign in to comment.