提交 4944dd8c 作者: zhenjie

Merge branch 'develop' of ssh://git.mmcuav.cn:8222/iuav/cms into develop

......@@ -7,13 +7,13 @@ on:
env:
REGION_ID: cn-shenzhen
REGISTRY: mmc-registry.cn-shenzhen.cr.aliyuncs.com
NAMESPACE: sharefly
NAMESPACE: sharefly-dev
IMAGE: cms
TAG: ${{ github.sha }}
ACR_EE_REGISTRY: mmc-registry.cn-shenzhen.cr.aliyuncs.com
ACR_EE_INSTANCE_ID: cri-yhk5zgfc2v1sia6l
ACR_EE_NAMESPACE: sharefly
ACR_EE_NAMESPACE: sharefly-dev
ACR_EE_IMAGE: cms
ACR_EE_TAG: ${{ github.sha }}
JAVA_VERSION: '8'
......
name: Build and Push to ACR
on:
push:
### Production
branches: [ "master" ]
env:
REGION_ID: cn-shenzhen
REGISTRY: mmc-registry.cn-shenzhen.cr.aliyuncs.com
NAMESPACE: sharefly
IMAGE: cms
TAG: ${{ github.sha }}
ACR_EE_REGISTRY: mmc-registry.cn-shenzhen.cr.aliyuncs.com
ACR_EE_INSTANCE_ID: cri-yhk5zgfc2v1sia6l
ACR_EE_NAMESPACE: sharefly
ACR_EE_IMAGE: cms
ACR_EE_TAG: ${{ github.sha }}
JAVA_VERSION: '8'
GITLAB_URL: https://oauth2:MjVJKxB7m4tCy7symBzn@git.mmcuav.cn/iuav/cms.git
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
### Production
environment: prod
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK 8
uses: actions/setup-java@v1
with:
java-version: ${{env.JAVA_VERSION}}
- name: Login to ACR EE with the AccessKey pair
uses: aliyun/acr-login@v1
with:
login-server: "https://${{ env.ACR_EE_REGISTRY }}"
region-id: "${{ env.REGION_ID }}"
username: "QD--KeBiTeHangKong@1354706964800968"
password: "MMC@2023&ACR"
instance-id: "${{ env.ACR_EE_INSTANCE_ID }}"
- name: Build and push image to ACR EE
run: |
mvn clean package
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"
### Production
- name: Kustomize Set Image
run: |-
cd kustomization/overlays/prod
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
### Production
- name: Commit and Push
run: |
git config user.name "Chuck"
git config user.email "Chuck@users.noreply.github.com"
git remote set-url origin "$GITLAB_URL"
git commit -am "generated Image update"
git push origin master
\ No newline at end of file
......@@ -7,4 +7,4 @@ target
.settings
.idea
*.iml
*/application.yml
*/application.yml
\ No newline at end of file
......@@ -18,7 +18,7 @@ spec:
image: REGISTRY/NAMESPACE/IMAGE:TAG
resources:
limits:
memory: 1024Mi
memory: 4096Mi
cpu: 100m
ports:
- containerPort: 35150
......
......@@ -10,8 +10,11 @@ commonAnnotations:
note: This is dev!
patches:
- path: ./configMap.yaml
- path: ./service.yaml
- path: ./service-patch.yaml
target:
kind: Service
name: cms-svc
images:
- name: REGISTRY/NAMESPACE/IMAGE:TAG
newName: mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly/cms
newTag: 2d8d287d92e920c1c1d03ef85780d062dbfd69ad
newName: mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/cms
newTag: e402bc290402990cc80bec28d48fbe394792debc
- op: replace
path: /spec/ports/0/nodePort
value: 30151
\ No newline at end of file
apiVersion: v1
kind: Service
metadata:
name: cms-svc
namespace: default
spec:
selector:
app: cms
type: NodePort
ports:
- protocol: TCP
port: 35150
nodePort: 30150
\ No newline at end of file
......@@ -3,4 +3,4 @@ kind: ConfigMap
metadata:
name: cms-map
data:
SPRING_PROFILES_ACTIVE: prod
\ No newline at end of file
SPRING_PROFILES_ACTIVE: dev
\ No newline at end of file
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../base
- ../../base
namespace: prod
#namePrefix: prod-
commonLabels:
......@@ -9,4 +9,12 @@ commonLabels:
commonAnnotations:
note: This is prod!
patches:
- configMap.yaml
\ No newline at end of file
- path: configMap.yaml
- path: service-patch.yaml
target:
kind: Service
name: cms-svc
images:
- name: REGISTRY/NAMESPACE/IMAGE:TAG
newName: mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly/cms
newTag: 9ffd6700ab759bdb2deb9e5a78a3cf277c8dccbd
- op: replace
path: /spec/ports/0/nodePort
value: 30150
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论