diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 00000000..551cfa4b --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,58 @@ +workflow: + name: "Test CI/CD pipeline" + +stages: + - build + - test + - docker + - deploy + +build_job: + stage: build + script: + - echo "Building the application..." + # Add your build commands here + tags: + - docker + +test_job: + stage: test + script: + - echo "Running tests..." + # Add your test commands here + tags: + - docker + +docker_build_job: + stage: docker + script: + - echo "Building Docker image..." + # Add your Docker build commands here + tags: + - docker +docker_test_job: + stage: docker + needs: [docker_build_job] + script: + - echo "Testing Docker image..." + # Add your Docker test commands here + tags: + - docker +docker_push_job: + stage: docker + needs: [docker_test_job] + script: + - echo "Pushing Docker image to registry..." + # Add your Docker push commands here + tags: + - docker + +deploy_job: + stage: deploy + script: + - echo "Deploying the application..." + # Add your deployment commands here + tags: + - docker + + \ No newline at end of file diff --git a/pods/nginx.yaml b/pods/nginx.yaml new file mode 100644 index 00000000..3db2bf5b --- /dev/null +++ b/pods/nginx.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Pod +metadata: + name: my-pod + labels: + app: nginx + env: production +spec: + containers: + - name: nginx-container + image: nginx:latest + ports: + - containerPort: 80 \ No newline at end of file diff --git a/pods/pod.yaml b/pods/pod.yaml new file mode 100644 index 00000000..b3086a1f --- /dev/null +++ b/pods/pod.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: Pod +metadata: + name: my-pod +spec: + containers: + - name: my-container + image: my-image:latest + ports: + - containerPort: 80 diff --git a/replicasets/replicaset.yaml b/replicasets/replicaset.yaml new file mode 100644 index 00000000..5b6f90fa --- /dev/null +++ b/replicasets/replicaset.yaml @@ -0,0 +1,21 @@ +apiVersion: app/v1 +kind: ReplicaSet +metadata: + name: my-replicaset +spec: + replicas: 3 + selector: + matchLabels: + app: nginx + env: production + template: + metadata: + labels: + app: nginx + env: production + spec: + containers: + - name: nginx-container + image: nginx:latest + ports: + - containerPort: 80 \ No newline at end of file