Skip to content

Commit 7236319

Browse files
author
zvercodebender
committed
start ci
1 parent 15e6f53 commit 7236319

File tree

5 files changed

+62
-10
lines changed

5 files changed

+62
-10
lines changed

.github/workflows/build.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Demo-Hello-Python
2+
on:
3+
push:
4+
tags:
5+
- '*'
6+
jobs:
7+
demo-hello-python-version:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- run: echo "PetPortalHosts is at version ${{ steps.tagkit.outputs.tag }}"
11+
- uses: actions/checkout@v2
12+
- name: build
13+
env:
14+
TAG: ${GITHUB_SHA::8}
15+
REPO: rbroker/hello-py
16+
XLD_USER: ${{ secrets.XLD_USER }}
17+
XLD_PASSWD: ${{ secrets.XLD_PASSWD }}
18+
XLD_URL: "http://xld.rbroker.linkpc.net"
19+
GET_LOCAL: "N"
20+
run: ./build.sh

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
REPO ?= danberg/hello-py
1+
REPO ?= rbroker/hello-py
22
TAG ?= $(shell git rev-parse --short HEAD)
33
IMAGE := $(REPO):$(TAG)
44
LATEST_IMAGE := $(REPO):latest

build.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env bash
2+
3+
export CLI_VERSION="10.0.0"
4+
export REPO="rbroker/hello-py"
5+
#export VERSION="3.1.1"
6+
if [ -z "${TAG}" ]
7+
then
8+
echo "VERSION not set"
9+
exit -1
10+
fi
11+
echo "Version = ${TAG}"
12+
IMAGE="${REPO}:${TAG}"
13+
14+
echo "docker build ${IMAGE} -f Dockerfile ."
15+
docker build ${IMAGE} -f Dockerfile .
16+
echo "docker push ${IMAGE}"
17+
docker push ${IMAGE}
18+
sed "s/{{image_tag}}/${TAG}/g" kubernetes/deployment.yaml > kubernetes/hello-python.yaml
19+
20+
if [ -z "${GET_LOCAL}" ]
21+
then
22+
xl apply --file dai-deploy/hello-python-deploy.yaml --values version=$TAG
23+
else
24+
curl -LO https://dist.xebialabs.com/public/xl-cli/$CLI_VERSION/linux-amd64/xl
25+
chmod +x xl
26+
./xl apply --xl-deploy-url=$XLD_URL --xl-deploy-username=$XLD_USER --xl-deploy-password=$XLD_PASSWD --file dai-deploy/hello-python-deploy.yaml --values version=$VERSION
27+
rm xl
28+
fi
29+
#rm x.yaml
30+
rm kubernetes/hello-python.yaml

dai-deploy/hello-python-deploy.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
apiVersion: xl-deploy/v1
33
kind: Applications
44
spec:
5-
- name: Applications/HelloPy
5+
- name: Applications/Paycom/HelloPy
66
type: udm.Application
77
children:
8-
- name: d120bb2
8+
- name: !format Applications/Paycom/HelloPy/%version%
99
type: udm.DeploymentPackage
1010
deployables:
1111
- name: hello-py-deploy.yaml
1212
type: k8s.ResourcesFile
1313
placeholders:
14-
- image_tag
14+
- image_tag
1515
- ingress_host
1616
fileEncodings:
1717
".+\\.properties": ISO-8859-1
@@ -24,4 +24,4 @@ spec:
2424
displayResourceOnLogs: "false"
2525
showContainerLogs: "false"
2626
bytesToReadFromContainerLogs: "4000"
27-
file: !file "../kubernetes/deployment.yaml"
27+
file: !file "../kubernetes/hello-python.yaml"

kubernetes/deployment.yaml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ spec:
1010
port: 6000
1111
targetPort: 5000
1212
type: ClusterIP
13+
1314
---
1415
apiVersion: apps/v1
1516
kind: Deployment
@@ -33,23 +34,24 @@ spec:
3334
app: hello-py
3435
spec:
3536
containers:
36-
- image: "{{image_name}}:{{image_tag}}"
37+
- image: "rbroker/hello-py:{{image_tag}}"
3738
name: hello-py
3839
ports:
3940
- containerPort: 5000
41+
4042
---
4143
apiVersion: networking.k8s.io/v1
4244
kind: Ingress
4345
metadata:
4446
name: hello-py-ingress
45-
annotations:
46-
nginx.ingress.kubernetes.io/rewrite-target: /$2
47+
labels:
48+
app: hello-py
4749
spec:
4850
rules:
49-
- host: "{{ingress_host}}"
51+
- host: {{ingress_host}}
5052
http:
5153
paths:
52-
- path: /hellopy(/|$)(.*)
54+
- path: /
5355
pathType: Prefix
5456
backend:
5557
service:

0 commit comments

Comments
 (0)