Skip to content

Commit 04dafc1

Browse files
committed
added env file support and also added other svc requirements
1 parent 67f4c3b commit 04dafc1

File tree

9 files changed

+431
-12
lines changed

9 files changed

+431
-12
lines changed

Makefile

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,10 @@ test-all: test-unit
3939
test-unit:
4040
go test ./pkg/pipeline
4141

42-
test-integration: make-binary-file-for-nil-check
43-
export INTEGRATION_TEST_ENV_ID=$(docker run --env TEST_BRANCH=$TEST_BRANCH --env LATEST_HASH=$LATEST_HASH --privileged -d --name dind-test -v $PWD/tests/integrationTesting/:/tmp/ docker:dind)
44-
docker exec ${INTEGRATION_TEST_ENV_ID} sh /tmp/create-test-env.sh
45-
docker exec ${INTEGRATION_TEST_ENV_ID} sh /tests/integrationTesting/run-integration-test.sh
46-
47-
make-binary-file-for-nil-check:
48-
./runTimeMainScript.sh
49-
42+
test-integration:
43+
export INTEGRATION_TEST_ENV_ID=$(docker run --env --privileged -d --name dind-test -v $PWD/:/test/ docker:dind)
44+
docker exec ${INTEGRATION_TEST_ENV_ID} sh -c "cd test && ./tests/integrationTesting/create-test-env.sh"
45+
docker exec ${INTEGRATION_TEST_ENV_ID} sh -c "cd test && ./tests/integrationTesting/run-integration-test.sh"
5046
run: build
5147
./devtron
5248

tests/integrationTesting/create-test-env.sh

100644100755
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ kubectl create ns devtron-cd
1818
kubectl create ns devtron-ci
1919
kubectl -n devtroncd apply -f $PWD/tests/integrationTesting/postgresql-secret.yaml
2020
kubectl -ndevtroncd apply -f $PWD/tests/integrationTesting/postgresql.yaml
21+
kubectl -n devtroncd apply -f $PWD/tests/integrationTesting/devtron-secret.yaml
22+
kubectl -n devtroncd apply -f $PWD/tests/integrationTesting/nats-server.yaml
23+
kubectl -n devtroncd apply -f $PWD/tests/integrationTesting/devtron-nats-nodeport.yaml
2124
yq '(select(.metadata.name == "postgresql-migrate-devtron") | .spec.template.spec.containers[0].env[0].value) = env(TEST_BRANCH)' $PWD/tests/integrationTesting/migrator.yaml -i
2225
yq '(select(.metadata.name == "postgresql-migrate-devtron") | .spec.template.spec.containers[0].env[9].value) = env(LATEST_HASH)' $PWD/tests/integrationTesting/migrator.yaml -i
2326
kubectl -ndevtroncd apply -f $PWD/tests/integrationTesting/migrator.yaml
@@ -50,4 +53,6 @@ helm dependency up
5053
helm template devtron . --set installer.modules={cicd} -s templates/workflow.yaml >./argo_wf.yaml
5154
kubectl apply -f ./argo_wf.yaml
5255
while [ ! $(kubectl -n argo get deployment workflow-controller -o jsonpath="{.status.readyReplicas}") ]; do sleep 10; done
53-
cd $PWD
56+
export NATS_SERVER_HOST=nats://$(kubectl get node --no-headers -o custom-columns=INTERNAL-IP:status.addresses[0].address):30236
57+
export PG_ADDR=$(kubectl get node --no-headers -o custom-columns=INTERNAL-IP:status.addresses[0].address)
58+
cd $PWD
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: devtron-nats-for-nodeport
5+
namespace: devtroncd
6+
spec:
7+
ports:
8+
- name: client
9+
nodePort: 30236
10+
port: 4222
11+
protocol: TCP
12+
targetPort: 4222
13+
- name: cluster
14+
port: 6222
15+
protocol: TCP
16+
targetPort: 6222
17+
- name: monitor
18+
port: 8222
19+
protocol: TCP
20+
targetPort: 8222
21+
- name: metrics
22+
port: 7777
23+
protocol: TCP
24+
targetPort: 7777
25+
- name: leafnodes
26+
port: 7422
27+
protocol: TCP
28+
targetPort: 7422
29+
- name: gateways
30+
port: 7522
31+
protocol: TCP
32+
targetPort: 7522
33+
selector:
34+
app.kubernetes.io/instance: devtron-nats
35+
app.kubernetes.io/name: nats
36+
sessionAffinity: None
37+
type: NodePort
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
apiVersion: v1
2+
data:
3+
PG_PASSWORD: c2hhcmVkLWRldnRyb24tcGc=
4+
kind: Secret
5+
metadata:
6+
annotations:
7+
meta.helm.sh/release-name: orchestrator-oss-shared-cd-dcd
8+
meta.helm.sh/release-namespace: devtroncd
9+
creationTimestamp: "2024-03-19T13:58:54Z"
10+
labels:
11+
app.kubernetes.io/managed-by: Helm
12+
name: devtron-secret
13+
namespace: devtroncd
14+
type: Opaque

tests/integrationTesting/migrator.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ spec:
2828
- name: MIGRATE_TO_VERSION
2929
value: "0"
3030
- name: GIT_HASH
31-
value: be7da471e45a501eba19eaa5f8d08dfe5601598d
31+
value: 606a33bc5e9b15d8b1c404f0dfbd1c70b21b4063
3232
envFrom:
3333
- secretRef:
3434
name: postgresql-migrator

0 commit comments

Comments
 (0)