Added Jenkinsfile 9
This commit is contained in:
10
Jenkinsfile
vendored
10
Jenkinsfile
vendored
@@ -23,14 +23,14 @@ THE SOFTWARE.
|
|||||||
node {
|
node {
|
||||||
|
|
||||||
sh 'git rev-parse --verify HEAD > GIT_COMMIT'
|
sh 'git rev-parse --verify HEAD > GIT_COMMIT'
|
||||||
sh 'cat GIT_COMMIT'
|
env.GIT_COMMIT = readFile('GIT_COMMIT').trim().substring(0, 10)
|
||||||
git_commit = readFile('GIT_COMMIT').trim().substring(0, 10)
|
|
||||||
env.GIT_COMMIT = git_commit
|
|
||||||
sh 'rm GIT_COMMIT'
|
sh 'rm GIT_COMMIT'
|
||||||
|
def jobName = env.JOB_NAME.tokenize('/')
|
||||||
|
print env.jobName
|
||||||
|
|
||||||
env.NODEJS_HOME = "${tool 'node14'}"
|
env.NODEJS_HOME = "${tool 'node14'}"
|
||||||
env.PATH="${env.NODEJS_HOME}/bin:${env.PATH}"
|
env.PATH="${env.NODEJS_HOME}/bin:${env.PATH}"
|
||||||
env.DOCKER_NAME="web/wannistesvorbei:${env.BRANCH_NAME}-${env.GIT_COMMIT}"
|
env.DOCKER_NAME="${jobName[0]}/${jobName[1]}:${env.BRANCH_NAME}-${env.GIT_COMMIT}"
|
||||||
|
|
||||||
def customImage
|
def customImage
|
||||||
|
|
||||||
@@ -65,7 +65,7 @@ node {
|
|||||||
stage('Deploy'){
|
stage('Deploy'){
|
||||||
|
|
||||||
echo 'Push to Repo'
|
echo 'Push to Repo'
|
||||||
docker.withRegistry('https://docker.sebse.de', 'docker-registry-robot') {
|
docker.withRegistry('https://docker.sebse.de', 'docker-registry-robot-web-development') {
|
||||||
|
|
||||||
/* Push the container to the custom Registry */
|
/* Push the container to the custom Registry */
|
||||||
customImage.push()
|
customImage.push()
|
||||||
|
|||||||
Reference in New Issue
Block a user