forked from LaconicNetwork/kompose
Merge pull request #110 from surajssd/tests-check
Fix output comparison for cmd tests
This commit is contained in:
commit
cc9531abaf
@ -69,8 +69,8 @@ function convert::match_output() {
|
||||
|
||||
match=$(jq --argfile a $TEMP_STDOUT --argfile b $expected_output -n 'def post_recurse(f): def r: (f | select(. != null) | r), .; r; def post_recurse: post_recurse(.[]?); ($a | (post_recurse | arrays) |= sort) as $a | ($b | (post_recurse | arrays) |= sort) as $b | $a == $b')
|
||||
|
||||
if [ "$match" = false ]; then FAIL_MSGS=$FAIL_MSGS"converted output does not match\n"; return 1;
|
||||
else SUCCESS_MSGS=$SUCCESS_MSGS"converted output matches\n"; return 0; fi
|
||||
if [ "$match" = true ]; then SUCCESS_MSGS=$SUCCESS_MSGS"converted output matches\n"; return 0;
|
||||
else FAIL_MSGS=$FAIL_MSGS"converted output does not match\n"; return 1; fi
|
||||
}
|
||||
readonly -f convert::match_output
|
||||
|
||||
|
||||
@ -17,13 +17,6 @@ convert::expect_success_and_warning "kompose convert --stdout -f $KOMPOSE_ROOT/s
|
||||
convert::expect_success_and_warning "kompose convert --stdout --dc -f $KOMPOSE_ROOT/script/test/fixtures/etherpad/docker-compose.yml" "$KOMPOSE_ROOT/script/test/fixtures/etherpad/output-os.json" "Unsupported key depends_on - ignoring"
|
||||
unset $(cat $KOMPOSE_ROOT/script/test/fixtures/etherpad/envs | cut -d'=' -f1)
|
||||
|
||||
######
|
||||
# Tests related to docker-compose file in script/test/fixtures/flask-redis
|
||||
# kubernetes test
|
||||
convert::expect_success_and_warning "kompose convert --stdout -f $KOMPOSE_ROOT/script/test/fixtures/flask-redis/docker-compose.yml" "$KOMPOSE_ROOT/script/test/fixtures/flask-redis/output-k8s.json" "Unsupported key depends_on - ignoring"
|
||||
# openshift test
|
||||
convert::expect_success_and_warning "kompose convert --stdout --dc -f $KOMPOSE_ROOT/script/test/fixtures/flask-redis/docker-compose.yml" "$KOMPOSE_ROOT/script/test/fixtures/flask-redis/output-os.json" "Unsupported key depends_on - ignoring"
|
||||
|
||||
######
|
||||
# Tests related to docker-compose file in /script/test/fixtures/gitlab
|
||||
convert::expect_failure "kompose convert --stdout -f $KOMPOSE_ROOT/script/test/fixtures/gitlab/docker-compose.yml"
|
||||
@ -41,17 +34,5 @@ convert::expect_success_and_warning "kompose convert --stdout -f $KOMPOSE_ROOT/s
|
||||
# openshift test
|
||||
convert::expect_success_and_warning "kompose convert --stdout --dc -f $KOMPOSE_ROOT/script/test/fixtures/ngnix-node-redis/docker-compose.yml" "$KOMPOSE_ROOT/script/test/fixtures/ngnix-node-redis/output-os.json" "Unsupported key build - ignoring"
|
||||
|
||||
|
||||
######
|
||||
# Tests related to docker-compose file in /script/test/fixtures/wordpress
|
||||
convert::expect_failure "kompose convert --stdout -f $KOMPOSE_ROOT/script/test/fixtures/wordpress/docker-compose.yml"
|
||||
export $(cat $KOMPOSE_ROOT/script/test/fixtures/wordpress/envs)
|
||||
# kubernetes test
|
||||
convert::expect_success_and_warning "kompose convert --stdout -f $KOMPOSE_ROOT/script/test/fixtures/wordpress/docker-compose.yml" "$KOMPOSE_ROOT/script/test/fixtures/wordpress/output-k8s.json" "Unsupported key depends_on - ignoring"
|
||||
# openshift test
|
||||
convert::expect_success_and_warning "kompose convert --stdout -f $KOMPOSE_ROOT/script/test/fixtures/wordpress/docker-compose.yml" "$KOMPOSE_ROOT/script/test/fixtures/wordpress/output-os.json" "Unsupported key depends_on - ignoring"
|
||||
unset $(cat $KOMPOSE_ROOT/script/test/fixtures/wordpress/envs | cut -d'=' -f1)
|
||||
|
||||
|
||||
exit $EXIT_STATUS
|
||||
|
||||
|
||||
182
script/test/fixtures/etherpad/output-k8s.json
vendored
182
script/test/fixtures/etherpad/output-k8s.json
vendored
@ -3,98 +3,12 @@
|
||||
"apiVersion": "v1",
|
||||
"metadata": {},
|
||||
"items": [
|
||||
{
|
||||
"kind": "Deployment",
|
||||
"apiVersion": "extensions/v1beta1",
|
||||
"metadata": {
|
||||
"name": "etherpad",
|
||||
"creationTimestamp": null,
|
||||
},
|
||||
"spec": {
|
||||
"replicas": 1,
|
||||
"template": {
|
||||
"metadata": {
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "etherpad"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"containers": [
|
||||
{
|
||||
"name": "etherpad",
|
||||
"image": "centos/etherpad",
|
||||
"ports": [
|
||||
{
|
||||
"containerPort": 9001,
|
||||
"protocol": "TCP"
|
||||
}
|
||||
],
|
||||
"env": [
|
||||
{
|
||||
"name": "DB_DBID",
|
||||
"value": "etherpad"
|
||||
},
|
||||
{
|
||||
"name": "DB_HOST",
|
||||
"value": "mariadb"
|
||||
},
|
||||
{
|
||||
"name": "DB_PASS",
|
||||
"value": "etherpad"
|
||||
},
|
||||
{
|
||||
"name": "DB_PORT",
|
||||
"value": "3306"
|
||||
},
|
||||
{
|
||||
"name": "DB_USER",
|
||||
"value": "etherpad"
|
||||
}
|
||||
],
|
||||
"resources": {}
|
||||
}
|
||||
],
|
||||
"restartPolicy": "Always"
|
||||
}
|
||||
},
|
||||
"strategy": {}
|
||||
},
|
||||
"status": {}
|
||||
},
|
||||
{
|
||||
"kind": "Service",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "etherpad",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "etherpad"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"ports": [
|
||||
{
|
||||
"name": "80",
|
||||
"protocol": "TCP",
|
||||
"port": 80,
|
||||
"targetPort": 9001
|
||||
}
|
||||
],
|
||||
"selector": {
|
||||
"service": "etherpad"
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"loadBalancer": {}
|
||||
}
|
||||
},
|
||||
{
|
||||
"kind": "Deployment",
|
||||
"apiVersion": "extensions/v1beta1",
|
||||
"metadata": {
|
||||
"name": "mariadb",
|
||||
"creationTimestamp": null,
|
||||
"creationTimestamp": null
|
||||
},
|
||||
"spec": {
|
||||
"replicas": 1,
|
||||
@ -117,10 +31,6 @@
|
||||
}
|
||||
],
|
||||
"env": [
|
||||
{
|
||||
"name": "MYSQL_USER",
|
||||
"value": "etherpad"
|
||||
},
|
||||
{
|
||||
"name": "MYSQL_DATABASE",
|
||||
"value": "etherpad"
|
||||
@ -132,6 +42,10 @@
|
||||
{
|
||||
"name": "MYSQL_ROOT_PASSWORD",
|
||||
"value": "etherpad"
|
||||
},
|
||||
{
|
||||
"name": "MYSQL_USER",
|
||||
"value": "etherpad"
|
||||
}
|
||||
],
|
||||
"resources": {}
|
||||
@ -170,6 +84,92 @@
|
||||
"status": {
|
||||
"loadBalancer": {}
|
||||
}
|
||||
},
|
||||
{
|
||||
"kind": "Deployment",
|
||||
"apiVersion": "extensions/v1beta1",
|
||||
"metadata": {
|
||||
"name": "etherpad",
|
||||
"creationTimestamp": null
|
||||
},
|
||||
"spec": {
|
||||
"replicas": 1,
|
||||
"template": {
|
||||
"metadata": {
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "etherpad"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"containers": [
|
||||
{
|
||||
"name": "etherpad",
|
||||
"image": "centos/etherpad",
|
||||
"ports": [
|
||||
{
|
||||
"containerPort": 9001,
|
||||
"protocol": "TCP"
|
||||
}
|
||||
],
|
||||
"env": [
|
||||
{
|
||||
"name": "DB_USER",
|
||||
"value": "etherpad"
|
||||
},
|
||||
{
|
||||
"name": "DB_DBID",
|
||||
"value": "etherpad"
|
||||
},
|
||||
{
|
||||
"name": "DB_HOST",
|
||||
"value": "mariadb"
|
||||
},
|
||||
{
|
||||
"name": "DB_PASS",
|
||||
"value": "etherpad"
|
||||
},
|
||||
{
|
||||
"name": "DB_PORT",
|
||||
"value": "3306"
|
||||
}
|
||||
],
|
||||
"resources": {}
|
||||
}
|
||||
],
|
||||
"restartPolicy": "Always"
|
||||
}
|
||||
},
|
||||
"strategy": {}
|
||||
},
|
||||
"status": {}
|
||||
},
|
||||
{
|
||||
"kind": "Service",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "etherpad",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "etherpad"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"ports": [
|
||||
{
|
||||
"name": "80",
|
||||
"protocol": "TCP",
|
||||
"port": 80,
|
||||
"targetPort": 9001
|
||||
}
|
||||
],
|
||||
"selector": {
|
||||
"service": "etherpad"
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"loadBalancer": {}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
10
script/test/fixtures/flask-redis/README.md
vendored
10
script/test/fixtures/flask-redis/README.md
vendored
@ -1,10 +0,0 @@
|
||||
## Flask and Redis
|
||||
|
||||
For running this app
|
||||
|
||||
|
||||
```bash
|
||||
mkdir /opt/redis
|
||||
sudo chcon -Rt svirt_sandbox_file_t /opt/redis
|
||||
docker-compose up
|
||||
```
|
||||
@ -1,20 +0,0 @@
|
||||
version: "2"
|
||||
|
||||
services:
|
||||
redis:
|
||||
image: dharmit/redis
|
||||
command: redis-server
|
||||
ports:
|
||||
- "6379"
|
||||
volumes:
|
||||
- /opt/redis:/redis
|
||||
|
||||
flask:
|
||||
image: dharmit/flask
|
||||
ports:
|
||||
- "31000:5000"
|
||||
depends_on:
|
||||
- redis
|
||||
environment:
|
||||
REDIS_PORT: 6379
|
||||
REDIS_HOST: redis
|
||||
159
script/test/fixtures/flask-redis/output-k8s.json
vendored
159
script/test/fixtures/flask-redis/output-k8s.json
vendored
@ -1,159 +0,0 @@
|
||||
{
|
||||
"kind": "List",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {},
|
||||
"items": [
|
||||
{
|
||||
"kind": "Deployment",
|
||||
"apiVersion": "extensions/v1beta1",
|
||||
"metadata": {
|
||||
"name": "flask",
|
||||
"creationTimestamp": null,
|
||||
},
|
||||
"spec": {
|
||||
"replicas": 1,
|
||||
"template": {
|
||||
"metadata": {
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "flask"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"containers": [
|
||||
{
|
||||
"name": "flask",
|
||||
"image": "dharmit/flask",
|
||||
"ports": [
|
||||
{
|
||||
"containerPort": 5000,
|
||||
"protocol": "TCP"
|
||||
}
|
||||
],
|
||||
"env": [
|
||||
{
|
||||
"name": "REDIS_HOST",
|
||||
"value": "redis"
|
||||
},
|
||||
{
|
||||
"name": "REDIS_PORT",
|
||||
"value": "6379"
|
||||
}
|
||||
],
|
||||
"resources": {}
|
||||
}
|
||||
],
|
||||
"restartPolicy": "Always"
|
||||
}
|
||||
},
|
||||
"strategy": {}
|
||||
},
|
||||
"status": {}
|
||||
},
|
||||
{
|
||||
"kind": "Service",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "flask",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "flask"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"ports": [
|
||||
{
|
||||
"name": "31000",
|
||||
"protocol": "TCP",
|
||||
"port": 31000,
|
||||
"targetPort": 5000
|
||||
}
|
||||
],
|
||||
"selector": {
|
||||
"service": "flask"
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"loadBalancer": {}
|
||||
}
|
||||
},
|
||||
{
|
||||
"kind": "Deployment",
|
||||
"apiVersion": "extensions/v1beta1",
|
||||
"metadata": {
|
||||
"name": "redis",
|
||||
"creationTimestamp": null,
|
||||
},
|
||||
"spec": {
|
||||
"replicas": 1,
|
||||
"template": {
|
||||
"metadata": {
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "redis"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"volumes": [
|
||||
{
|
||||
"name": "fpllngzieyoh43e0133o",
|
||||
"hostPath": {
|
||||
"path": "/opt/redis"
|
||||
}
|
||||
}
|
||||
],
|
||||
"containers": [
|
||||
{
|
||||
"name": "redis",
|
||||
"image": "dharmit/redis",
|
||||
"ports": [
|
||||
{
|
||||
"containerPort": 6379,
|
||||
"protocol": "TCP"
|
||||
}
|
||||
],
|
||||
"resources": {},
|
||||
"volumeMounts": [
|
||||
{
|
||||
"name": "fpllngzieyoh43e0133o",
|
||||
"mountPath": "/redis"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"restartPolicy": "Always"
|
||||
}
|
||||
},
|
||||
"strategy": {}
|
||||
},
|
||||
"status": {}
|
||||
},
|
||||
{
|
||||
"kind": "Service",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "redis",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "redis"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"ports": [
|
||||
{
|
||||
"name": "6379",
|
||||
"protocol": "TCP",
|
||||
"port": 6379,
|
||||
"targetPort": 6379
|
||||
}
|
||||
],
|
||||
"selector": {
|
||||
"service": "redis"
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"loadBalancer": {}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
179
script/test/fixtures/flask-redis/output-os.json
vendored
179
script/test/fixtures/flask-redis/output-os.json
vendored
@ -1,179 +0,0 @@
|
||||
{
|
||||
"kind": "List",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {},
|
||||
"items": [
|
||||
{
|
||||
"kind": "DeploymentConfig",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "flask",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "flask"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"strategy": {
|
||||
"resources": {}
|
||||
},
|
||||
"triggers": null,
|
||||
"replicas": 1,
|
||||
"test": false,
|
||||
"selector": {
|
||||
"service": "flask"
|
||||
},
|
||||
"template": {
|
||||
"metadata": {
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "flask"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"containers": [
|
||||
{
|
||||
"name": "flask",
|
||||
"image": "dharmit/flask",
|
||||
"ports": [
|
||||
{
|
||||
"containerPort": 5000,
|
||||
"protocol": "TCP"
|
||||
}
|
||||
],
|
||||
"env": [
|
||||
{
|
||||
"name": "REDIS_HOST",
|
||||
"value": "redis"
|
||||
},
|
||||
{
|
||||
"name": "REDIS_PORT",
|
||||
"value": "6379"
|
||||
}
|
||||
],
|
||||
"resources": {}
|
||||
}
|
||||
],
|
||||
"restartPolicy": "Always"
|
||||
}
|
||||
}
|
||||
},
|
||||
"status": {}
|
||||
},
|
||||
{
|
||||
"kind": "Service",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "flask",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "flask"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"ports": [
|
||||
{
|
||||
"name": "31000",
|
||||
"protocol": "TCP",
|
||||
"port": 31000,
|
||||
"targetPort": 5000
|
||||
}
|
||||
],
|
||||
"selector": {
|
||||
"service": "flask"
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"loadBalancer": {}
|
||||
}
|
||||
},
|
||||
{
|
||||
"kind": "DeploymentConfig",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "redis",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "redis"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"strategy": {
|
||||
"resources": {}
|
||||
},
|
||||
"triggers": null,
|
||||
"replicas": 1,
|
||||
"test": false,
|
||||
"selector": {
|
||||
"service": "redis"
|
||||
},
|
||||
"template": {
|
||||
"metadata": {
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "redis"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"volumes": [
|
||||
{
|
||||
"name": "fpllngzieyoh43e0133o",
|
||||
"hostPath": {
|
||||
"path": "/opt/redis"
|
||||
}
|
||||
}
|
||||
],
|
||||
"containers": [
|
||||
{
|
||||
"name": "redis",
|
||||
"image": "dharmit/redis",
|
||||
"ports": [
|
||||
{
|
||||
"containerPort": 6379,
|
||||
"protocol": "TCP"
|
||||
}
|
||||
],
|
||||
"resources": {},
|
||||
"volumeMounts": [
|
||||
{
|
||||
"name": "fpllngzieyoh43e0133o",
|
||||
"mountPath": "/redis"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"restartPolicy": "Always"
|
||||
}
|
||||
}
|
||||
},
|
||||
"status": {}
|
||||
},
|
||||
{
|
||||
"kind": "Service",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "redis",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "redis"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"ports": [
|
||||
{
|
||||
"name": "6379",
|
||||
"protocol": "TCP",
|
||||
"port": 6379,
|
||||
"targetPort": 6379
|
||||
}
|
||||
],
|
||||
"selector": {
|
||||
"service": "redis"
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"loadBalancer": {}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
248
script/test/fixtures/gitlab/output-k8s.json
vendored
248
script/test/fixtures/gitlab/output-k8s.json
vendored
@ -3,130 +3,12 @@
|
||||
"apiVersion": "v1",
|
||||
"metadata": {},
|
||||
"items": [
|
||||
{
|
||||
"kind": "Deployment",
|
||||
"apiVersion": "extensions/v1beta1",
|
||||
"metadata": {
|
||||
"name": "gitlab",
|
||||
"creationTimestamp": null,
|
||||
},
|
||||
"spec": {
|
||||
"replicas": 1,
|
||||
"template": {
|
||||
"metadata": {
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "gitlab"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"containers": [
|
||||
{
|
||||
"name": "gitlab",
|
||||
"image": "swordphilic/gitlab",
|
||||
"ports": [
|
||||
{
|
||||
"containerPort": 80,
|
||||
"protocol": "TCP"
|
||||
},
|
||||
{
|
||||
"containerPort": 443,
|
||||
"protocol": "TCP"
|
||||
},
|
||||
{
|
||||
"containerPort": 22,
|
||||
"protocol": "TCP"
|
||||
}
|
||||
],
|
||||
"env": [
|
||||
{
|
||||
"name": "DB_HOST",
|
||||
"value": "postgresql"
|
||||
},
|
||||
{
|
||||
"name": "DB_NAME",
|
||||
"value": "gitlab"
|
||||
},
|
||||
{
|
||||
"name": "DB_PASS",
|
||||
"value": "gitlab"
|
||||
},
|
||||
{
|
||||
"name": "DB_PORT",
|
||||
"value": "5432"
|
||||
},
|
||||
{
|
||||
"name": "DB_TYPE",
|
||||
"value": "postgres"
|
||||
},
|
||||
{
|
||||
"name": "DB_USER",
|
||||
"value": "gitlab"
|
||||
},
|
||||
{
|
||||
"name": "REDIS_HOST",
|
||||
"value": "redis"
|
||||
},
|
||||
{
|
||||
"name": "REDIS_PORT",
|
||||
"value": "6379"
|
||||
}
|
||||
],
|
||||
"resources": {}
|
||||
}
|
||||
],
|
||||
"restartPolicy": "Always"
|
||||
}
|
||||
},
|
||||
"strategy": {}
|
||||
},
|
||||
"status": {}
|
||||
},
|
||||
{
|
||||
"kind": "Service",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "gitlab",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "gitlab"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"ports": [
|
||||
{
|
||||
"name": "30000",
|
||||
"protocol": "TCP",
|
||||
"port": 30000,
|
||||
"targetPort": 80
|
||||
},
|
||||
{
|
||||
"name": "30001",
|
||||
"protocol": "TCP",
|
||||
"port": 30001,
|
||||
"targetPort": 443
|
||||
},
|
||||
{
|
||||
"name": "30002",
|
||||
"protocol": "TCP",
|
||||
"port": 30002,
|
||||
"targetPort": 22
|
||||
}
|
||||
],
|
||||
"selector": {
|
||||
"service": "gitlab"
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"loadBalancer": {}
|
||||
}
|
||||
},
|
||||
{
|
||||
"kind": "Deployment",
|
||||
"apiVersion": "extensions/v1beta1",
|
||||
"metadata": {
|
||||
"name": "postgresql",
|
||||
"creationTimestamp": null,
|
||||
"creationTimestamp": null
|
||||
},
|
||||
"spec": {
|
||||
"replicas": 1,
|
||||
@ -149,10 +31,6 @@
|
||||
}
|
||||
],
|
||||
"env": [
|
||||
{
|
||||
"name": "DB_PASS",
|
||||
"value": "gitlab"
|
||||
},
|
||||
{
|
||||
"name": "DB_USER",
|
||||
"value": "gitlab"
|
||||
@ -160,6 +38,10 @@
|
||||
{
|
||||
"name": "DB_NAME",
|
||||
"value": "gitlab"
|
||||
},
|
||||
{
|
||||
"name": "DB_PASS",
|
||||
"value": "gitlab"
|
||||
}
|
||||
],
|
||||
"resources": {}
|
||||
@ -204,7 +86,7 @@
|
||||
"apiVersion": "extensions/v1beta1",
|
||||
"metadata": {
|
||||
"name": "redis",
|
||||
"creationTimestamp": null,
|
||||
"creationTimestamp": null
|
||||
},
|
||||
"spec": {
|
||||
"replicas": 1,
|
||||
@ -262,6 +144,124 @@
|
||||
"status": {
|
||||
"loadBalancer": {}
|
||||
}
|
||||
},
|
||||
{
|
||||
"kind": "Deployment",
|
||||
"apiVersion": "extensions/v1beta1",
|
||||
"metadata": {
|
||||
"name": "gitlab",
|
||||
"creationTimestamp": null
|
||||
},
|
||||
"spec": {
|
||||
"replicas": 1,
|
||||
"template": {
|
||||
"metadata": {
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "gitlab"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"containers": [
|
||||
{
|
||||
"name": "gitlab",
|
||||
"image": "swordphilic/gitlab",
|
||||
"ports": [
|
||||
{
|
||||
"containerPort": 80,
|
||||
"protocol": "TCP"
|
||||
},
|
||||
{
|
||||
"containerPort": 443,
|
||||
"protocol": "TCP"
|
||||
},
|
||||
{
|
||||
"containerPort": 22,
|
||||
"protocol": "TCP"
|
||||
}
|
||||
],
|
||||
"env": [
|
||||
{
|
||||
"name": "DB_TYPE",
|
||||
"value": "postgres"
|
||||
},
|
||||
{
|
||||
"name": "DB_USER",
|
||||
"value": "gitlab"
|
||||
},
|
||||
{
|
||||
"name": "REDIS_HOST",
|
||||
"value": "redis"
|
||||
},
|
||||
{
|
||||
"name": "REDIS_PORT",
|
||||
"value": "6379"
|
||||
},
|
||||
{
|
||||
"name": "DB_HOST",
|
||||
"value": "postgresql"
|
||||
},
|
||||
{
|
||||
"name": "DB_NAME",
|
||||
"value": "gitlab"
|
||||
},
|
||||
{
|
||||
"name": "DB_PASS",
|
||||
"value": "gitlab"
|
||||
},
|
||||
{
|
||||
"name": "DB_PORT",
|
||||
"value": "5432"
|
||||
}
|
||||
],
|
||||
"resources": {}
|
||||
}
|
||||
],
|
||||
"restartPolicy": "Always"
|
||||
}
|
||||
},
|
||||
"strategy": {}
|
||||
},
|
||||
"status": {}
|
||||
},
|
||||
{
|
||||
"kind": "Service",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "gitlab",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "gitlab"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"ports": [
|
||||
{
|
||||
"name": "30000",
|
||||
"protocol": "TCP",
|
||||
"port": 30000,
|
||||
"targetPort": 80
|
||||
},
|
||||
{
|
||||
"name": "30001",
|
||||
"protocol": "TCP",
|
||||
"port": 30001,
|
||||
"targetPort": 443
|
||||
},
|
||||
{
|
||||
"name": "30002",
|
||||
"protocol": "TCP",
|
||||
"port": 30002,
|
||||
"targetPort": 22
|
||||
}
|
||||
],
|
||||
"selector": {
|
||||
"service": "gitlab"
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"loadBalancer": {}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
"apiVersion": "extensions/v1beta1",
|
||||
"metadata": {
|
||||
"name": "node2",
|
||||
"creationTimestamp": null,
|
||||
"creationTimestamp": null
|
||||
},
|
||||
"spec": {
|
||||
"replicas": 1,
|
||||
@ -71,7 +71,7 @@
|
||||
"apiVersion": "extensions/v1beta1",
|
||||
"metadata": {
|
||||
"name": "node3",
|
||||
"creationTimestamp": null,
|
||||
"creationTimestamp": null
|
||||
},
|
||||
"spec": {
|
||||
"replicas": 1,
|
||||
@ -134,7 +134,7 @@
|
||||
"apiVersion": "extensions/v1beta1",
|
||||
"metadata": {
|
||||
"name": "redis",
|
||||
"creationTimestamp": null,
|
||||
"creationTimestamp": null
|
||||
},
|
||||
"spec": {
|
||||
"replicas": 1,
|
||||
@ -198,7 +198,7 @@
|
||||
"apiVersion": "extensions/v1beta1",
|
||||
"metadata": {
|
||||
"name": "nginx",
|
||||
"creationTimestamp": null,
|
||||
"creationTimestamp": null
|
||||
},
|
||||
"spec": {
|
||||
"replicas": 1,
|
||||
@ -261,7 +261,7 @@
|
||||
"apiVersion": "extensions/v1beta1",
|
||||
"metadata": {
|
||||
"name": "node1",
|
||||
"creationTimestamp": null,
|
||||
"creationTimestamp": null
|
||||
},
|
||||
"spec": {
|
||||
"replicas": 1,
|
||||
|
||||
14
script/test/fixtures/wordpress/README.md
vendored
14
script/test/fixtures/wordpress/README.md
vendored
@ -1,14 +0,0 @@
|
||||
## Docker Compose Wordpress
|
||||
|
||||
Wordpress and Mariadb
|
||||
|
||||
### Usage
|
||||
|
||||
The simplest thing to do:
|
||||
|
||||
```bash
|
||||
export $(cat envs)
|
||||
docker-compose up
|
||||
```
|
||||
|
||||
To customize the values edit `envs` file.
|
||||
@ -1,25 +0,0 @@
|
||||
version: "2"
|
||||
|
||||
services:
|
||||
mariadb:
|
||||
image: centos/mariadb
|
||||
ports:
|
||||
- "$DB_PORT"
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: $ROOT_PASS
|
||||
MYSQL_DATABASE: $DB_NAME
|
||||
MYSQL_PASSWORD: $DB_PASS
|
||||
MYSQL_USER: $DB_USER
|
||||
|
||||
wordpress:
|
||||
image: wordpress
|
||||
ports:
|
||||
- "8080:80"
|
||||
depends_on:
|
||||
- mariadb
|
||||
restart: always
|
||||
environment:
|
||||
WORDPRESS_DB_HOST: $DB_HOST:$DB_PORT
|
||||
WORDPRESS_DB_NAME: $DB_NAME
|
||||
WORDPRESS_DB_PASSWORD: $DB_PASS
|
||||
WORDPRESS_DB_USER: $DB_USER
|
||||
6
script/test/fixtures/wordpress/envs
vendored
6
script/test/fixtures/wordpress/envs
vendored
@ -1,6 +0,0 @@
|
||||
DB_HOST=mariadb
|
||||
ROOT_PASS=wordpress
|
||||
DB_NAME=wordpress
|
||||
DB_PASS=wordpress
|
||||
DB_USER=wordpress
|
||||
DB_PORT=3306
|
||||
171
script/test/fixtures/wordpress/output-k8s.json
vendored
171
script/test/fixtures/wordpress/output-k8s.json
vendored
@ -1,171 +0,0 @@
|
||||
{
|
||||
"kind": "List",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {},
|
||||
"items": [
|
||||
{
|
||||
"kind": "Deployment",
|
||||
"apiVersion": "extensions/v1beta1",
|
||||
"metadata": {
|
||||
"name": "mariadb",
|
||||
"creationTimestamp": null,
|
||||
},
|
||||
"spec": {
|
||||
"replicas": 1,
|
||||
"template": {
|
||||
"metadata": {
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "mariadb"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"containers": [
|
||||
{
|
||||
"name": "mariadb",
|
||||
"image": "centos/mariadb",
|
||||
"ports": [
|
||||
{
|
||||
"containerPort": 3306,
|
||||
"protocol": "TCP"
|
||||
}
|
||||
],
|
||||
"env": [
|
||||
{
|
||||
"name": "MYSQL_PASSWORD",
|
||||
"value": "wordpress"
|
||||
},
|
||||
{
|
||||
"name": "MYSQL_ROOT_PASSWORD",
|
||||
"value": "wordpress"
|
||||
},
|
||||
{
|
||||
"name": "MYSQL_USER",
|
||||
"value": "wordpress"
|
||||
},
|
||||
{
|
||||
"name": "MYSQL_DATABASE",
|
||||
"value": "wordpress"
|
||||
}
|
||||
],
|
||||
"resources": {}
|
||||
}
|
||||
],
|
||||
"restartPolicy": "Always"
|
||||
}
|
||||
},
|
||||
"strategy": {}
|
||||
},
|
||||
"status": {}
|
||||
},
|
||||
{
|
||||
"kind": "Service",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "mariadb",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "mariadb"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"ports": [
|
||||
{
|
||||
"name": "3306",
|
||||
"protocol": "TCP",
|
||||
"port": 3306,
|
||||
"targetPort": 3306
|
||||
}
|
||||
],
|
||||
"selector": {
|
||||
"service": "mariadb"
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"loadBalancer": {}
|
||||
}
|
||||
},
|
||||
{
|
||||
"kind": "Deployment",
|
||||
"apiVersion": "extensions/v1beta1",
|
||||
"metadata": {
|
||||
"name": "wordpress",
|
||||
"creationTimestamp": null,
|
||||
},
|
||||
"spec": {
|
||||
"replicas": 1,
|
||||
"template": {
|
||||
"metadata": {
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "wordpress"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"containers": [
|
||||
{
|
||||
"name": "wordpress",
|
||||
"image": "wordpress",
|
||||
"ports": [
|
||||
{
|
||||
"containerPort": 80,
|
||||
"protocol": "TCP"
|
||||
}
|
||||
],
|
||||
"env": [
|
||||
{
|
||||
"name": "WORDPRESS_DB_HOST",
|
||||
"value": "mariadb:3306"
|
||||
},
|
||||
{
|
||||
"name": "WORDPRESS_DB_NAME",
|
||||
"value": "wordpress"
|
||||
},
|
||||
{
|
||||
"name": "WORDPRESS_DB_PASSWORD",
|
||||
"value": "wordpress"
|
||||
},
|
||||
{
|
||||
"name": "WORDPRESS_DB_USER",
|
||||
"value": "wordpress"
|
||||
}
|
||||
],
|
||||
"resources": {}
|
||||
}
|
||||
],
|
||||
"restartPolicy": "Always"
|
||||
}
|
||||
},
|
||||
"strategy": {}
|
||||
},
|
||||
"status": {}
|
||||
},
|
||||
{
|
||||
"kind": "Service",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "wordpress",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "wordpress"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"ports": [
|
||||
{
|
||||
"name": "8080",
|
||||
"protocol": "TCP",
|
||||
"port": 8080,
|
||||
"targetPort": 80
|
||||
}
|
||||
],
|
||||
"selector": {
|
||||
"service": "wordpress"
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"loadBalancer": {}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
171
script/test/fixtures/wordpress/output-os.json
vendored
171
script/test/fixtures/wordpress/output-os.json
vendored
@ -1,171 +0,0 @@
|
||||
{
|
||||
"kind": "List",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {},
|
||||
"items": [
|
||||
{
|
||||
"kind": "Deployment",
|
||||
"apiVersion": "extensions/v1beta1",
|
||||
"metadata": {
|
||||
"name": "mariadb",
|
||||
"creationTimestamp": null,
|
||||
},
|
||||
"spec": {
|
||||
"replicas": 1,
|
||||
"template": {
|
||||
"metadata": {
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "mariadb"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"containers": [
|
||||
{
|
||||
"name": "mariadb",
|
||||
"image": "centos/mariadb",
|
||||
"ports": [
|
||||
{
|
||||
"containerPort": 3306,
|
||||
"protocol": "TCP"
|
||||
}
|
||||
],
|
||||
"env": [
|
||||
{
|
||||
"name": "MYSQL_USER",
|
||||
"value": "wordpress"
|
||||
},
|
||||
{
|
||||
"name": "MYSQL_DATABASE",
|
||||
"value": "wordpress"
|
||||
},
|
||||
{
|
||||
"name": "MYSQL_PASSWORD",
|
||||
"value": "wordpress"
|
||||
},
|
||||
{
|
||||
"name": "MYSQL_ROOT_PASSWORD",
|
||||
"value": "wordpress"
|
||||
}
|
||||
],
|
||||
"resources": {}
|
||||
}
|
||||
],
|
||||
"restartPolicy": "Always"
|
||||
}
|
||||
},
|
||||
"strategy": {}
|
||||
},
|
||||
"status": {}
|
||||
},
|
||||
{
|
||||
"kind": "Service",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "mariadb",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "mariadb"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"ports": [
|
||||
{
|
||||
"name": "3306",
|
||||
"protocol": "TCP",
|
||||
"port": 3306,
|
||||
"targetPort": 3306
|
||||
}
|
||||
],
|
||||
"selector": {
|
||||
"service": "mariadb"
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"loadBalancer": {}
|
||||
}
|
||||
},
|
||||
{
|
||||
"kind": "Deployment",
|
||||
"apiVersion": "extensions/v1beta1",
|
||||
"metadata": {
|
||||
"name": "wordpress",
|
||||
"creationTimestamp": null,
|
||||
},
|
||||
"spec": {
|
||||
"replicas": 1,
|
||||
"template": {
|
||||
"metadata": {
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "wordpress"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"containers": [
|
||||
{
|
||||
"name": "wordpress",
|
||||
"image": "wordpress",
|
||||
"ports": [
|
||||
{
|
||||
"containerPort": 80,
|
||||
"protocol": "TCP"
|
||||
}
|
||||
],
|
||||
"env": [
|
||||
{
|
||||
"name": "WORDPRESS_DB_HOST",
|
||||
"value": "mariadb:3306"
|
||||
},
|
||||
{
|
||||
"name": "WORDPRESS_DB_NAME",
|
||||
"value": "wordpress"
|
||||
},
|
||||
{
|
||||
"name": "WORDPRESS_DB_PASSWORD",
|
||||
"value": "wordpress"
|
||||
},
|
||||
{
|
||||
"name": "WORDPRESS_DB_USER",
|
||||
"value": "wordpress"
|
||||
}
|
||||
],
|
||||
"resources": {}
|
||||
}
|
||||
],
|
||||
"restartPolicy": "Always"
|
||||
}
|
||||
},
|
||||
"strategy": {}
|
||||
},
|
||||
"status": {}
|
||||
},
|
||||
{
|
||||
"kind": "Service",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "wordpress",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "wordpress"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"ports": [
|
||||
{
|
||||
"name": "8080",
|
||||
"protocol": "TCP",
|
||||
"port": 8080,
|
||||
"targetPort": 80
|
||||
}
|
||||
],
|
||||
"selector": {
|
||||
"service": "wordpress"
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"loadBalancer": {}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user