Compare commits
2 Commits
prometheus
...
gitlab
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
76282e9e28 | ||
|
|
0b7d20dcaa |
22
.drone.yml
22
.drone.yml
@@ -1,22 +0,0 @@
|
|||||||
kind: pipeline
|
|
||||||
type: exec
|
|
||||||
name: build
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: build
|
|
||||||
commands:
|
|
||||||
- docker-compose -p pycms build
|
|
||||||
|
|
||||||
- name: test
|
|
||||||
commands:
|
|
||||||
- docker-compose -p pycms up --build --abort-on-container-exit
|
|
||||||
|
|
||||||
- name: push
|
|
||||||
commands:
|
|
||||||
- docker-compose -p pycms push
|
|
||||||
- name: run
|
|
||||||
commands:
|
|
||||||
- docker-compose -p pycms down
|
|
||||||
- docker-compose -p pycms up -d
|
|
||||||
|
|
||||||
|
|
||||||
39
.gitlab-ci.yml
Normal file
39
.gitlab-ci.yml
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
# This file is a template, and might need editing before it works on your project.
|
||||||
|
# To contribute improvements to CI/CD templates, please follow the Development guide at:
|
||||||
|
# https://docs.gitlab.com/ee/development/cicd/templates.html
|
||||||
|
# This specific template is located at:
|
||||||
|
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Getting-Started.gitlab-ci.yml
|
||||||
|
|
||||||
|
# This is a sample GitLab CI/CD configuration file that should run without any modifications.
|
||||||
|
# It demonstrates a basic 3 stage CI/CD pipeline. Instead of real tests or scripts,
|
||||||
|
# it uses echo commands to simulate the pipeline execution.
|
||||||
|
#
|
||||||
|
# A pipeline is composed of independent jobs that run scripts, grouped into stages.
|
||||||
|
# Stages run in sequential order, but jobs within stages run in parallel.
|
||||||
|
#
|
||||||
|
# For more information, see: https://docs.gitlab.com/ee/ci/yaml/index.html#stages
|
||||||
|
|
||||||
|
stages: # List of stages for jobs, and their order of execution
|
||||||
|
- build
|
||||||
|
- test
|
||||||
|
- deploy
|
||||||
|
|
||||||
|
build-job: # This job runs in the build stage, which runs first.
|
||||||
|
stage: build
|
||||||
|
script:
|
||||||
|
- echo "Compiling the code..."
|
||||||
|
- docker build .
|
||||||
|
- echo "Compile complete."
|
||||||
|
|
||||||
|
test-job: # This job also runs in the test stage.
|
||||||
|
stage: test # It can run at the same time as unit-test-job (in parallel).
|
||||||
|
script:
|
||||||
|
- echo "Linting code... This will take about 10 seconds."
|
||||||
|
- docker-compose up --build --abort-on-container-exit
|
||||||
|
- echo "No lint issues found."
|
||||||
|
|
||||||
|
deploy-job: # This job runs in the deploy stage.
|
||||||
|
stage: deploy # It only runs when *both* jobs in the test stage complete successfully.
|
||||||
|
script:
|
||||||
|
- echo "Deploying application..."
|
||||||
|
- echo "Application successfully deployed."
|
||||||
@@ -10,9 +10,3 @@ services:
|
|||||||
- db
|
- db
|
||||||
db:
|
db:
|
||||||
image: mongo
|
image: mongo
|
||||||
tests:
|
|
||||||
build: .
|
|
||||||
command: bash ./test.sh
|
|
||||||
depends_on:
|
|
||||||
- db
|
|
||||||
- server
|
|
||||||
|
|||||||
10
test.sh
10
test.sh
@@ -1,10 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
curl_cmd='curl -s -w "%{http_code}" -o /dev/null'
|
|
||||||
url='server:8080'
|
|
||||||
$curl_cmd -X POST $url/admin/post/test -F 'body=testpage' && echo ": Create success" || echo ': create fail'
|
|
||||||
|
|
||||||
$curl_cmd $url/post/test && echo ": get Success" || echo ': get fail'
|
|
||||||
|
|
||||||
$curl_cmd -X POST $url/admin/post/test -F 'body=testpage2' && echo ": Update success" || echo ': update fail'
|
|
||||||
|
|
||||||
$curl_cmd -X DELETE $url/admin/post/test && echo ": delete success" || echo ': delete fail'
|
|
||||||
Reference in New Issue
Block a user