-
Notifications
You must be signed in to change notification settings - Fork 43
/
Jenkinsfile
36 lines (34 loc) · 881 Bytes
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
pipeline {
agent any
environment {
GHCR_REGISTRY = "ghcr.io"
GHCR_TOKEN = credentials('ghcr-login')
BLAH2_NAME = "30hours/blah2"
}
stages {
stage('Checkout') {
steps {
checkout scm
}
}
stage('Build') {
steps {
echo 'Building the project'
sh 'docker build -t $BLAH2_NAME .'
}
}
stage('Test') {
steps {
echo 'Running tests'
}
}
stage('Push') {
steps {
sh 'echo $GHCR_TOKEN_PSW | docker login ghcr.io -u $GHCR_TOKEN_USR --password-stdin'
sh 'docker tag $BLAH2_NAME ghcr.io/$BLAH2_NAME'
sh 'docker push ghcr.io/$BLAH2_NAME'
sh 'docker logout'
}
}
}
}