forked from LaconicNetwork/kompose
Functional Testing
Shell scripts to test k8s and os conversion which can be ran by following command in root dir `./script/test/cmd/tests.sh`
This commit is contained in:
+14
@@ -0,0 +1,14 @@
|
||||
## 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.
|
||||
@@ -0,0 +1,25 @@
|
||||
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
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
DB_HOST=mariadb
|
||||
ROOT_PASS=wordpress
|
||||
DB_NAME=wordpress
|
||||
DB_PASS=wordpress
|
||||
DB_USER=wordpress
|
||||
DB_PORT=3306
|
||||
+180
@@ -0,0 +1,180 @@
|
||||
{
|
||||
"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": "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": {}
|
||||
}
|
||||
}
|
||||
{
|
||||
"kind": "Deployment",
|
||||
"apiVersion": "extensions/v1beta1",
|
||||
"metadata": {
|
||||
"name": "mariadb",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "mariadb"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"replicas": 1,
|
||||
"selector": {
|
||||
"matchLabels": {
|
||||
"service": "mariadb"
|
||||
}
|
||||
},
|
||||
"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": "Deployment",
|
||||
"apiVersion": "extensions/v1beta1",
|
||||
"metadata": {
|
||||
"name": "wordpress",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "wordpress"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"replicas": 1,
|
||||
"selector": {
|
||||
"matchLabels": {
|
||||
"service": "wordpress"
|
||||
}
|
||||
},
|
||||
"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": {}
|
||||
}
|
||||
+184
@@ -0,0 +1,184 @@
|
||||
{
|
||||
"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": {}
|
||||
}
|
||||
}
|
||||
{
|
||||
"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": "DeploymentConfig",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "wordpress",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "wordpress"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"strategy": {
|
||||
"resources": {}
|
||||
},
|
||||
"triggers": null,
|
||||
"replicas": 1,
|
||||
"test": false,
|
||||
"selector": {
|
||||
"service": "wordpress"
|
||||
},
|
||||
"template": {
|
||||
"metadata": {
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "wordpress"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"containers": [
|
||||
{
|
||||
"name": "wordpress",
|
||||
"image": "wordpress",
|
||||
"ports": [
|
||||
{
|
||||
"containerPort": 80,
|
||||
"protocol": "TCP"
|
||||
}
|
||||
],
|
||||
"env": [
|
||||
{
|
||||
"name": "WORDPRESS_DB_NAME",
|
||||
"value": "wordpress"
|
||||
},
|
||||
{
|
||||
"name": "WORDPRESS_DB_PASSWORD",
|
||||
"value": "wordpress"
|
||||
},
|
||||
{
|
||||
"name": "WORDPRESS_DB_USER",
|
||||
"value": "wordpress"
|
||||
},
|
||||
{
|
||||
"name": "WORDPRESS_DB_HOST",
|
||||
"value": "mariadb:3306"
|
||||
}
|
||||
],
|
||||
"resources": {}
|
||||
}
|
||||
],
|
||||
"restartPolicy": "Always"
|
||||
}
|
||||
}
|
||||
},
|
||||
"status": {}
|
||||
}
|
||||
{
|
||||
"kind": "DeploymentConfig",
|
||||
"apiVersion": "v1",
|
||||
"metadata": {
|
||||
"name": "mariadb",
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "mariadb"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"strategy": {
|
||||
"resources": {}
|
||||
},
|
||||
"triggers": null,
|
||||
"replicas": 1,
|
||||
"test": false,
|
||||
"selector": {
|
||||
"service": "mariadb"
|
||||
},
|
||||
"template": {
|
||||
"metadata": {
|
||||
"creationTimestamp": null,
|
||||
"labels": {
|
||||
"service": "mariadb"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"containers": [
|
||||
{
|
||||
"name": "mariadb",
|
||||
"image": "centos/mariadb",
|
||||
"ports": [
|
||||
{
|
||||
"containerPort": 3306,
|
||||
"protocol": "TCP"
|
||||
}
|
||||
],
|
||||
"env": [
|
||||
{
|
||||
"name": "MYSQL_ROOT_PASSWORD",
|
||||
"value": "wordpress"
|
||||
},
|
||||
{
|
||||
"name": "MYSQL_USER",
|
||||
"value": "wordpress"
|
||||
},
|
||||
{
|
||||
"name": "MYSQL_DATABASE",
|
||||
"value": "wordpress"
|
||||
},
|
||||
{
|
||||
"name": "MYSQL_PASSWORD",
|
||||
"value": "wordpress"
|
||||
}
|
||||
],
|
||||
"resources": {}
|
||||
}
|
||||
],
|
||||
"restartPolicy": "Always"
|
||||
}
|
||||
}
|
||||
},
|
||||
"status": {}
|
||||
}
|
||||
Reference in New Issue
Block a user