Skip to content
This repository has been archived by the owner on Nov 14, 2022. It is now read-only.

Commit

Permalink
👷 Update Travis CI and generated project GitLab CI
Browse files Browse the repository at this point in the history
to use new CI scripts that include the corresponding Docker Compose files
  • Loading branch information
tiangolo committed Sep 24, 2018
1 parent 0103afe commit 30791e9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 74 deletions.
8 changes: 0 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,5 @@ install:
services:
- docker

# before_script:
# - cookiecutter --config-file ./testing-config.yml --no-input -f ./
# - cd ./testing-project
# - docker-compose -f docker-compose.test.yml build
# - docker-compose -f docker-compose.test.yml up -d
# - sleep 20
# - docker-compose -f docker-compose.test.yml exec -T backend bash -c 'alembic revision --autogenerate -m "Testing" && alembic upgrade head'

script:
- bash ./test.sh
71 changes: 5 additions & 66 deletions {{cookiecutter.project_slug}}/.gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,55 +12,15 @@ stages:
tests:
stage: test
script:
- >
DOMAIN=backend
ENV=stag
docker-compose
-f docker-compose.yml
-f docker-compose.build.yml
-f docker-compose.test.yml
config > docker-stack.yml
- docker-compose -f docker-stack.yml build
- docker-compose -f docker-stack.yml down -v --remove-orphans # Remove possibly previous broken stacks left hanging after an error
- docker-compose -f docker-stack.yml up -d
- docker-compose -f docker-stack.yml exec -T backend-tests /start.sh
- docker-compose -f docker-stack.yml down -v --remove-orphans
tags:
- build
- test

build-branch:
stage: build
script:
- >
TAG=stag
ENV=stag
docker-compose
-f docker-compose.images.yml
-f docker-compose.build.yml
config > docker-stack.yml
- docker-compose -f docker-stack.yml build
- docker-compose -f docker-stack.yml push
except:
- master
- production
- tags
- sh ./script-test.sh
tags:
- build
- test

build-stag:
stage: build
script:
- >
TAG=stag
ENV=stag
docker-compose
-f docker-compose.images.yml
-f docker-compose.build.yml
config > docker-stack.yml
- docker-compose -f docker-stack.yml build
- docker-compose -f docker-stack.yml push
- TAG=stag FRONTEND_ENV=stag sh ./script-build-push.sh
only:
- master
tags:
Expand All @@ -70,14 +30,7 @@ build-stag:
build-prod:
stage: build
script:
- >
TAG=prod
docker-compose
-f docker-compose.images.yml
-f docker-compose.build.yml
config > docker-stack.yml
- docker-compose -f docker-stack.yml build
- docker-compose -f docker-stack.yml push
- TAG=prod sh ./script-build-push.sh
only:
- production
tags:
Expand All @@ -93,14 +46,7 @@ deploy-stag:
TRAEFIK_PUBLIC_TAG={{cookiecutter.traefik_public_constraint_tag}}
STACK_NAME={{cookiecutter.docker_swarm_stack_name_staging}}
TAG=stag
docker-compose
-f docker-compose.yml
-f docker-compose.admin.yml
-f docker-compose.images.yml
-f docker-compose.deploy.yml
config > docker-stack.yml
- docker-auto-labels docker-stack.yml
- docker stack deploy -c docker-stack.yml --with-registry-auth {{cookiecutter.docker_swarm_stack_name_staging}}
sh ./script-deploy.sh
environment:
name: staging
url: https://{{cookiecutter.domain_staging}}
Expand All @@ -119,14 +65,7 @@ deploy-prod:
TRAEFIK_PUBLIC_TAG={{cookiecutter.traefik_public_constraint_tag}}
STACK_NAME={{cookiecutter.docker_swarm_stack_name_main}}
TAG=prod
docker-compose
-f docker-compose.yml
-f docker-compose.admin.yml
-f docker-compose.images.yml
-f docker-compose.deploy.yml
config > docker-stack.yml
- docker-auto-labels docker-stack.yml
- docker stack deploy -c docker-stack.yml --with-registry-auth {{cookiecutter.docker_swarm_stack_name_main}}
sh ./script-deploy.sh
environment:
name: production
url: https://{{cookiecutter.domain_main}}
Expand Down

0 comments on commit 30791e9

Please sign in to comment.