diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ccc9fd9 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.DS_Store \ No newline at end of file diff --git a/Jenkinsfile-4 b/Jenkinsfile-4 index e977d91..caeb0dd 100644 --- a/Jenkinsfile-4 +++ b/Jenkinsfile-4 @@ -1,25 +1,25 @@ def timeInMillis = currentBuild.timeInMillis -def imageTag = "darinpope/alpine:" + timeInMillis +def imageTag = "ugurkocak1980/alpine" + timeInMillis @Library("shared-library") _ pipeline { agent any environment { - DH_CREDS=credentials('dh-creds') + UK_CREDS=credentials('uk-creds') } stages { stage('Hello') { steps { sh """ echo "FROM alpine:latest" > Dockerfile - docker build -t ${imageTag} . + docker build -t ${imageTag} . """ sh ''' - echo $DH_CREDS_PSW | docker login --username=$DH_CREDS_USR --password-stdin - ''' + echo $UK_CREDS_PSW | docker login --username=$UK_CREDS_USR --password-stdin + ''' script { def sha256 = sh(returnStdout: true, script:"docker push ${imageTag} | grep sha256 | awk -F':' '{print \$4}' | awk '{print \$1}'").trim() echo sha256 - def url = "https://hub.docker.com/layers/" + env.DH_CREDS_USR + "/alpine/" + timeInMillis + "/images/sha256-" + sha256 + "?context=explore" + def url = "https://hub.docker.com/layers/" + env.UK_CREDS_USR + "/alpine" + timeInMillis + "/latest/images/sha256-" + sha256 + "?context=explore" addSidebarLink(url:url,text:"Image on Docker Hub",icon:"star.gif") } } @@ -30,4 +30,4 @@ pipeline { } } } -} +} \ No newline at end of file