Skip to content
This repository has been archived by the owner on Nov 23, 2021. It is now read-only.

Commit

Permalink
Merge pull request #6 from soulseen/master
Browse files Browse the repository at this point in the history
fix typo
  • Loading branch information
Zhuxiaoyang authored Apr 25, 2019
2 parents 39a9b98 + e9dae72 commit 64b4fc4
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 21 deletions.
File renamed without changes.
16 changes: 8 additions & 8 deletions Jenkinsfile → Jenkinsfile-on-prem
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pipeline {
HARBOR_CREDENTIAL_ID = 'harbor-id'
GITLAB_CREDENTIAL_ID = 'gitlab-id'
KUBECONFIG_CREDENTIAL_ID = 'demo-kubeconfig'
REDISTRY = 'harbor.devops.kubesphere.local:30280'
REGISTRY = 'harbor.devops.kubesphere.local:30280'
HARBOR_NAMESPACE = 'library'
GITLAB_ACCOUNT = 'admin1'
APP_NAME = 'devops-java-sample'
Expand Down Expand Up @@ -54,10 +54,10 @@ pipeline {
steps {
container ('maven') {
sh 'mvn -o -Dmaven.test.skip=true -gs `pwd`/configuration/settings.xml clean package'
sh 'docker build -t $REDISTRY/$HARBOR_NAMESPACE/$APP_NAME:SNAPSHOT-$BRANCH_NAME-$BUILD_NUMBER .'
sh 'docker build -f Dockerfile-on-prem -t $REGISTRY/$HARBOR_NAMESPACE/$APP_NAME:SNAPSHOT-$BRANCH_NAME-$BUILD_NUMBER .'
withCredentials([usernamePassword(passwordVariable : 'DOCKER_PASSWORD' ,usernameVariable : 'DOCKER_USERNAME' ,credentialsId : "$HARBOR_CREDENTIAL_ID" ,)]) {
sh 'echo "$DOCKER_PASSWORD" | docker login $REDISTRY -u "$DOCKER_USERNAME" --password-stdin'
sh 'docker push $REDISTRY/$HARBOR_NAMESPACE/$APP_NAME:SNAPSHOT-$BRANCH_NAME-$BUILD_NUMBER'
sh 'echo "$DOCKER_PASSWORD" | docker login $REGISTRY -u "$DOCKER_USERNAME" --password-stdin'
sh 'docker push $REGISTRY/$HARBOR_NAMESPACE/$APP_NAME:SNAPSHOT-$BRANCH_NAME-$BUILD_NUMBER'
}
}
}
Expand All @@ -69,8 +69,8 @@ pipeline {
}
steps{
container ('maven') {
sh 'docker tag $REDISTRY/$HARBOR_NAMESPACE/$APP_NAME:SNAPSHOT-$BRANCH_NAME-$BUILD_NUMBER $REDISTRY/$HARBOR_NAMESPACE/$APP_NAME:latest '
sh 'docker push $REDISTRY/$HARBOR_NAMESPACE/$APP_NAME:latest '
sh 'docker tag $REGISTRY/$HARBOR_NAMESPACE/$APP_NAME:SNAPSHOT-$BRANCH_NAME-$BUILD_NUMBER $REGISTRY/$HARBOR_NAMESPACE/$APP_NAME:latest '
sh 'docker push $REGISTRY/$HARBOR_NAMESPACE/$APP_NAME:latest '
}
}
}
Expand Down Expand Up @@ -99,8 +99,8 @@ pipeline {
sh 'git tag -a $TAG_NAME -m "$TAG_NAME" '
sh 'git push http://$GIT_USERNAME:$GIT_PASSWORD@gitlab.devops.kubesphere.local:30080/$GITLAB_ACCOUNT/devops-java-sample.git --tags'
}
sh 'docker tag $REDISTRY/$HARBOR_NAMESPACE/$APP_NAME:SNAPSHOT-$BRANCH_NAME-$BUILD_NUMBER $REDISTRY/$HARBOR_NAMESPACE/$APP_NAME:$TAG_NAME '
sh 'docker push $REDISTRY/$HARBOR_NAMESPACE/$APP_NAME:$TAG_NAME '
sh 'docker tag $REGISTRY/$HARBOR_NAMESPACE/$APP_NAME:SNAPSHOT-$BRANCH_NAME-$BUILD_NUMBER $REGISTRY/$HARBOR_NAMESPACE/$APP_NAME:$TAG_NAME '
sh 'docker push $REGISTRY/$HARBOR_NAMESPACE/$APP_NAME:$TAG_NAME '
}
}
}
Expand Down
16 changes: 8 additions & 8 deletions Jenkinsfile-online
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pipeline {
DOCKER_CREDENTIAL_ID = 'dockerhub-id'
GITHUB_CREDENTIAL_ID = 'github-id'
KUBECONFIG_CREDENTIAL_ID = 'demo-kubeconfig'
REDISTRY = 'docker.io'
REGISTRY = 'docker.io'
DOCKERHUB_NAMESPACE = 'docker_username'
GITHUB_ACCOUNT = 'kubesphere'
APP_NAME = 'devops-java-sample'
Expand Down Expand Up @@ -54,10 +54,10 @@ pipeline {
steps {
container ('maven') {
sh 'mvn -o -Dmaven.test.skip=true -gs `pwd`/configuration/settings.xml clean package'
sh 'docker build -f Dockerfile-online -t $REDISTRY/$DOCKERHUB_NAMESPACE/$APP_NAME:SNAPSHOT-$BRANCH_NAME-$BUILD_NUMBER .'
sh 'docker build -f Dockerfile-online -t $REGISTRY/$DOCKERHUB_NAMESPACE/$APP_NAME:SNAPSHOT-$BRANCH_NAME-$BUILD_NUMBER .'
withCredentials([usernamePassword(passwordVariable : 'DOCKER_PASSWORD' ,usernameVariable : 'DOCKER_USERNAME' ,credentialsId : "$DOCKER_CREDENTIAL_ID" ,)]) {
sh 'echo "$DOCKER_PASSWORD" | docker login $REDISTRY -u "$DOCKER_USERNAME" --password-stdin'
sh 'docker push $REDISTRY/$DOCKERHUB_NAMESPACE/$APP_NAME:SNAPSHOT-$BRANCH_NAME-$BUILD_NUMBER'
sh 'echo "$DOCKER_PASSWORD" | docker login $REGISTRY -u "$DOCKER_USERNAME" --password-stdin'
sh 'docker push $REGISTRY/$DOCKERHUB_NAMESPACE/$APP_NAME:SNAPSHOT-$BRANCH_NAME-$BUILD_NUMBER'
}
}
}
Expand All @@ -69,8 +69,8 @@ pipeline {
}
steps{
container ('maven') {
sh 'docker tag $REDISTRY/$DOCKERHUB_NAMESPACE/$APP_NAME:SNAPSHOT-$BRANCH_NAME-$BUILD_NUMBER $REDISTRY/$DOCKERHUB_NAMESPACE/$APP_NAME:latest '
sh 'docker push $REDISTRY/$DOCKERHUB_NAMESPACE/$APP_NAME:latest '
sh 'docker tag $REGISTRY/$DOCKERHUB_NAMESPACE/$APP_NAME:SNAPSHOT-$BRANCH_NAME-$BUILD_NUMBER $REGISTRY/$DOCKERHUB_NAMESPACE/$APP_NAME:latest '
sh 'docker push $REGISTRY/$DOCKERHUB_NAMESPACE/$APP_NAME:latest '
}
}
}
Expand Down Expand Up @@ -99,8 +99,8 @@ pipeline {
sh 'git tag -a $TAG_NAME -m "$TAG_NAME" '
sh 'git push http://$GIT_USERNAME:$GIT_PASSWORD@github.com/$GITHUB_ACCOUNT/devops-java-sample.git --tags'
}
sh 'docker tag $REDISTRY/$DOCKERHUB_NAMESPACE/$APP_NAME:SNAPSHOT-$BRANCH_NAME-$BUILD_NUMBER $REDISTRY/$DOCKERHUB_NAMESPACE/$APP_NAME:$TAG_NAME '
sh 'docker push $REDISTRY/$DOCKERHUB_NAMESPACE/$APP_NAME:$TAG_NAME '
sh 'docker tag $REGISTRY/$DOCKERHUB_NAMESPACE/$APP_NAME:SNAPSHOT-$BRANCH_NAME-$BUILD_NUMBER $REGISTRY/$DOCKERHUB_NAMESPACE/$APP_NAME:$TAG_NAME '
sh 'docker push $REGISTRY/$DOCKERHUB_NAMESPACE/$APP_NAME:$TAG_NAME '
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion deploy/dev-ol/devops-sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
value: js|html
- name: CACHE_PUBLIC_EXPIRATION
value: 3d
image: $REDISTRY/$DOCKERHUB_NAMESPACE/$APP_NAME:SNAPSHOT-$BRANCH_NAME-$BUILD_NUMBER
image: $REGISTRY/$DOCKERHUB_NAMESPACE/$APP_NAME:SNAPSHOT-$BRANCH_NAME-$BUILD_NUMBER
readinessProbe:
httpGet:
path: /
Expand Down
2 changes: 1 addition & 1 deletion deploy/dev/devops-sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
value: js|html
- name: CACHE_PUBLIC_EXPIRATION
value: 3d
image: $REDISTRY/$HARBOR_NAMESPACE/$APP_NAME:SNAPSHOT-$BRANCH_NAME-$BUILD_NUMBER
image: $REGISTRY/$HARBOR_NAMESPACE/$APP_NAME:SNAPSHOT-$BRANCH_NAME-$BUILD_NUMBER
readinessProbe:
httpGet:
path: /
Expand Down
2 changes: 1 addition & 1 deletion deploy/no-branch-dev/devops-sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ spec:
tier: backend
spec:
containers:
- image: $REDISTRY/$DOCKERHUB_NAMESPACE/$APP_NAME:SNAPSHOT-$BUILD_NUMBER
- image: $REGISTRY/$DOCKERHUB_NAMESPACE/$APP_NAME:SNAPSHOT-$BUILD_NUMBER
imagePullPolicy: Always
name: ks-sample
readinessProbe:
Expand Down
2 changes: 1 addition & 1 deletion deploy/prod-ol/devops-sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ spec:
value: js|html
- name: CACHE_PUBLIC_EXPIRATION
value: 3d
image: $REDISTRY/$DOCKERHUB_NAMESPACE/$APP_NAME:$TAG_NAME
image: $REGISTRY/$DOCKERHUB_NAMESPACE/$APP_NAME:$TAG_NAME
readinessProbe:
httpGet:
path: /
Expand Down
2 changes: 1 addition & 1 deletion deploy/prod/devops-sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ spec:
value: js|html
- name: CACHE_PUBLIC_EXPIRATION
value: 3d
image: $REDISTRY/$HARBOR_NAMESPACE/$APP_NAME:$TAG_NAME
image: $REGISTRY/$HARBOR_NAMESPACE/$APP_NAME:$TAG_NAME
readinessProbe:
httpGet:
path: /
Expand Down

0 comments on commit 64b4fc4

Please sign in to comment.