Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
A
ap-11_django
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Давид Ли
ap-11_django
Commits
06c62116
Commit
06c62116
authored
Nov 18, 2023
by
Давид Ли
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add ci cd
parent
56561978
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
27 deletions
+49
-27
.gitlab-ci.yml
.gitlab-ci.yml
+49
-0
docker-compose.yml
docker-compose.yml
+0
-27
No files found.
.gitlab-ci.yml
0 → 100644
View file @
06c62116
stages
:
-
build
# - test
-
deploy
services
:
-
postgres:13-alpine
variables
:
POSTGRES_PASSWORD
:
postgres
before_script
:
-
docker login -u gitlab-ci-token -p "$CI_JOB_TOKEN" "$CI_REGISTRY"
build
:
stage
:
build
only
:
-
merge_requests
script
:
-
docker login -u gitlab-ci-token -p "$CI_JOB_TOKEN" "$CI_REGISTRY"
-
docker build -t "$CI_REGISTRY_IMAGE:$CI_PIPELINE_ID" -f ./docker/Dockerfile .
-
docker push "$CI_REGISTRY_IMAGE:$CI_PIPELINE_ID"
image
:
docker
services
:
-
docker:dind
# test:
# stage: test
# only:
# - merge_requests
# script:
# - python3 manage.py test
deploy
:
only
:
-
merge_requests
stage
:
deploy
image
:
docker/compose
variables
:
DOCKER_HOST
:
"
${SERVER_HOST}"
before_script
:
-
apk update && apk add openssh-client bash
-
eval $(ssh-agent -s)
-
echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
-
mkdir -p ~/.ssh
-
chmod 700 ~/.ssh
script
:
-
docker-compose pull
-
docker-compose up -d --remove-orphans
docker-compose.yml
View file @
06c62116
...
@@ -19,30 +19,3 @@ services:
...
@@ -19,30 +19,3 @@ services:
command
:
bash -c "python manage.py makemigrations --merge --noinput &&
command
:
bash -c "python manage.py makemigrations --merge --noinput &&
python manage.py migrate --noinput &&
python manage.py migrate --noinput &&
python manage.py runserver 0.0.0.0:8000"
python manage.py runserver 0.0.0.0:8000"
redis
:
image
:
redis
celery
:
build
:
dockerfile
:
docker/Dockerfile
command
:
celery -A core/celery.py worker -l info
volumes
:
-
.:/usr/src/app
depends_on
:
-
postgres
-
redis
environment
:
-
TZ=Asia/Almaty
celery-beat
:
build
:
dockerfile
:
docker/Dockerfile
command
:
celery -A core/celery.py beat -l info
volumes
:
-
.:/usr/src/app
depends_on
:
-
postgres
-
redis
environment
:
-
TZ=Asia/Almaty
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment