提交 5d63b993 作者: 余乾开

Merge branch 'master' into develop

...@@ -2,7 +2,8 @@ name: Build and Push to ACR ...@@ -2,7 +2,8 @@ name: Build and Push to ACR
on: on:
push: push:
branches: [ "develop" ] ### Production
branches: [ "master" ]
env: env:
REGION_ID: cn-shenzhen REGION_ID: cn-shenzhen
...@@ -25,7 +26,8 @@ permissions: ...@@ -25,7 +26,8 @@ permissions:
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
environment: dev ### Production
environment: prod
steps: steps:
- name: Checkout - name: Checkout
...@@ -50,17 +52,18 @@ jobs: ...@@ -50,17 +52,18 @@ jobs:
mvn clean package mvn clean package
docker build -t "$ACR_EE_REGISTRY/$ACR_EE_NAMESPACE/$ACR_EE_IMAGE:$TAG" . docker build -t "$ACR_EE_REGISTRY/$ACR_EE_NAMESPACE/$ACR_EE_IMAGE:$TAG" .
docker push "$ACR_EE_REGISTRY/$ACR_EE_NAMESPACE/$ACR_EE_IMAGE:$TAG" docker push "$ACR_EE_REGISTRY/$ACR_EE_NAMESPACE/$ACR_EE_IMAGE:$TAG"
### Production
- name: Kustomize Set Image - name: Kustomize Set Image
run: |- run: |-
cd kustomization/overlays/dev cd kustomization/overlays/prod
curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash /dev/stdin 3.8.6 curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash /dev/stdin 3.8.6
./kustomize edit set image REGISTRY/NAMESPACE/IMAGE:TAG=$REGISTRY/$NAMESPACE/$IMAGE:$TAG ./kustomize edit set image REGISTRY/NAMESPACE/IMAGE:TAG=$REGISTRY/$NAMESPACE/$IMAGE:$TAG
### Production
- name: Commit and Push - name: Commit and Push
run: | run: |
git config user.name "Chuck" git config user.name "Chuck"
git config user.email "Chuck@users.noreply.github.com" git config user.email "Chuck@users.noreply.github.com"
git remote set-url origin "$GITLAB_URL" git remote set-url origin "$GITLAB_URL"
git commit -am "generated Image update" git add .
git push origin develop git commit -m "Generated Image New Tag"
\ No newline at end of file git push origin master
\ No newline at end of file
...@@ -6,4 +6,4 @@ target ...@@ -6,4 +6,4 @@ target
.settings .settings
.idea .idea
*.iml *.iml
*/application.yml */application.yml
\ No newline at end of file
...@@ -2,7 +2,7 @@ apiVersion: v1 ...@@ -2,7 +2,7 @@ apiVersion: v1
kind: Service kind: Service
metadata: metadata:
name: ims-svc name: ims-svc
namespace: default namespace: dev
spec: spec:
selector: selector:
app: ims app: ims
...@@ -10,4 +10,4 @@ spec: ...@@ -10,4 +10,4 @@ spec:
ports: ports:
- protocol: TCP - protocol: TCP
port: 10001 port: 10001
nodePort: 30001 nodePort: 30002
\ No newline at end of file \ No newline at end of file
apiVersion: kustomize.config.k8s.io/v1beta1 apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
resources: resources:
- ../../base - ../../base
namespace: prod namespace: prod
#namePrefix: prod- #namePrefix: prod-
commonLabels: commonLabels:
...@@ -9,4 +9,12 @@ commonLabels: ...@@ -9,4 +9,12 @@ commonLabels:
commonAnnotations: commonAnnotations:
note: This is prod! note: This is prod!
patches: patches:
- configMap.yaml - path: configMap.yaml
\ No newline at end of file - path: service-patch.yaml
target:
kind: Service
name: ims-svc
images:
- name: REGISTRY/NAMESPACE/IMAGE:TAG
newName: mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly/ims
newTag: 1f36751b7a432aa3c1a6f21bef45f5427af38788
- op: replace
path: /spec/ports/0/nodePort
value: 30001
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论