Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

Jenkinsfile 1.6 KB

You have to be logged in to leave a comment. Sign In
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
  1. pipeline {
  2. agent any
  3. environment {
  4. ECR_REPOSITORY = credentials('ECR_REPOSITORY')
  5. AWS_ACCOUNT_ID = credentials('AWS_ACCOUNT_ID')
  6. AWS_ACCESS_KEY_ID = credentials('AWS_ACCESS_KEY_ID')
  7. AWS_SECRET_ACCESS_KEY = credentials('AWS_SECRET_ACCESS_KEY')
  8. }
  9. stages {
  10. stage('Continuous Integration') {
  11. steps {
  12. script {
  13. echo "Linting repository"
  14. echo "Running unit tests"
  15. }
  16. }
  17. }
  18. stage('Login to ECR') {
  19. steps {
  20. script {
  21. sh 'aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin ${AWS_ACCOUNT_ID}.dkr.ecr.us-east-1.amazonaws.com'
  22. }
  23. }
  24. }
  25. stage('Build Image') {
  26. steps {
  27. script {
  28. sh 'docker build -t ${ECR_REPOSITORY}:latest .'
  29. }
  30. }
  31. }
  32. stage('Push Image') {
  33. steps {
  34. script {
  35. sh 'docker push ${ECR_REPOSITORY}:latest'
  36. }
  37. }
  38. }
  39. stage('Continuous Deployment') {
  40. steps {
  41. sshagent(['ssh_key']) {
  42. sh "ssh -o StrictHostKeyChecking=no -l ubuntu 44.215.220.137 'cd /home/ubuntu/ && wget
  43. https://raw.githubusercontent.com/ReshmaChikate5/Chest-Disease-Classification-From-Chest-CT-Scan/main/docker-compose.yml && export IMAGE_NAME=${ECR_REPOSITORY}:latest && aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin ${AWS_ACCOUNT_ID}.dkr.ecr.us-east-1.amazonaws.com && docker compose up -d '"
  44. }
  45. }
  46. }
  47. }
  48. post {
  49. always {
  50. sh 'docker system prune -f'
  51. }
  52. }
  53. }
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...