diff --git a/Jenkinsfile-K8s-Deploy b/Jenkinsfile-K8s-Deploy index ecc22ee..0655fa9 100644 --- a/Jenkinsfile-K8s-Deploy +++ b/Jenkinsfile-K8s-Deploy @@ -1,65 +1,28 @@ pipeline { - agent any - environment { - //once you sign up for Docker hub, use that user_id here - registry = "ananthkannan/mypython-app-may20" - //- update your credentials ID after creating credentials for connecting to Docker Hub - registryCredential = 'dockerhub' - dockerImage = '' - } - stages { +agent any - stage ('checkout') { - steps { - checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[url: 'https://github.com/akannan1087/myPythonDockerRepo']]]) - } - } - - stage ('Build docker image') { - steps { - script { - dockerImage = docker.build registry + ":$BUILD_NUMBER" - //dockerImage = docker.build registry + ":$BUILD_NUMBER" +environment { + // Once you sign up for Docker Hub, use that user ID here + registry = "richiyo26/richiyo26myphp" - } - } - } - - // Uploading Docker images into Docker Hub - stage('Upload Image') { - steps{ - script { - docker.withRegistry( '', registryCredential ) { - dockerImage.push() - } - } - } - } + // Jenkins credentials ID for Docker Hub + registryCredential = '7e654cd6-0f01-499f-9b11-58023ed1c877' - stage('Remove Unused docker image') { - steps{ - sh "docker rmi $registry:$BUILD_NUMBER" - } - } - - stage ('K8S Deploy') { + dockerImage = '' +} + +stages { + stage('checkout') { steps { - script { - kubernetesDeploy( - configs: 'k8s-deployment.yaml', - kubeconfigId: 'K8S', - enableConfigSubstitution: true - ) - - } + checkout scmGit( + branches: [[name: '*/master']], + extensions: [], + userRemoteConfigs: [[ + url: 'https://github.com/Richiyo07/myPythonDockerRepo' + ]] + ) } } - - } } -always { - // remove built docker image and prune system - print 'Cleaning up the Docker system.' - sh 'docker system prune -f' } diff --git a/mychart/values.yaml b/mychart/values.yaml index 0a8a529..7c8d8fd 100644 --- a/mychart/values.yaml +++ b/mychart/values.yaml @@ -5,7 +5,7 @@ replicaCount: 1 image: - repository: 211223789150.dkr.ecr.us-east-1.amazonaws.com/my-docker-repo + repository: 136356824322.dkr.ecr.us-east-2.amazonaws.com/mybuilder/dodo/repo:latest pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. tag: "" diff --git a/templates/index.html b/templates/index.html index 5435f6a..7aeaacf 100644 --- a/templates/index.html +++ b/templates/index.html @@ -3,7 +3,7 @@