-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
45 lines (45 loc) · 1.4 KB
/
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
37
38
39
40
41
42
43
44
45
pipeline {
agent any
environment {
env_vars_fe = credentials("env_vars_fe")
aws_ecr_pass = credentials("aws_ecr_pass")
}
stages {
stage('Clone repository') {
steps {
git 'https://github.com/vitaliy-pavlyshyn/pixelistic_fe.git'
}
}
stage('Download .env file') {
steps {
withCredentials([file(credentialsId: 'env_vars_fe', variable: 'envfile')]) {
sh "cp $envfile .env"
}
}
}
stage('Build a container') {
steps {
withCredentials([string(credentialsId: 'aws_ecr_pass', variable: 'PW')]) {
sh "sudo docker login --username AWS --password $PW public.ecr.aws/t0q9r0m9 \
&& sudo docker build -t pixelistic_fe ."
}
}
}
stage('Push to registry') {
steps {
sh "sudo docker tag pixelistic_fe:latest public.ecr.aws/t0q9r0m9/pixelistic_fe:latest && sudo docker push public.ecr.aws/t0q9r0m9/pixelistic_fe:latest"
}
}
// stage('Apply changes to k8s cluster') {
// steps {
// sh "kubectl delete -f fe.yaml"
// sh "kubectl apply -f fe.yaml"
// }
// }
}
post {
always {
cleanWs()
}
}
}