Skip to content

Commit

Permalink
run with docker
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronny Adams committed May 21, 2021
1 parent 4805b86 commit e9b43fc
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.git
.env
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM python:3.6-alpine


RUN apk --update add git

WORKDIR /app
ADD requirements.txt .
RUN python3 -m pip install -r requirements.txt

12 changes: 12 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: "3.7"

services:
sync:
build:
context: .
dockerfile: Dockerfile
volumes:
- ./:/app
command: python3 migrate.py
network_mode: host
env_file: .env
12 changes: 6 additions & 6 deletions migrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
#######################
# CONFIG SECTION START
#######################
GITLAB_URL = 'https://gitlab.source.com'
GITLAB_TOKEN = 'gitlab token'
GITLAB_URL = os.getenv('GITLAB_URL', 'https://gitlab.source.com')
GITLAB_TOKEN = os.getenv('GITLAB_TOKEN', 'gitlab token')

# needed to clone the repositories, keep empty to try publickey (untested)
GITLAB_ADMIN_USER = 'admin username'
GITLAB_ADMIN_PASS = 'admin password'
GITLAB_ADMIN_USER = os.getenv('GITLAB_ADMIN_USER', 'admin username')
GITLAB_ADMIN_PASS = os.getenv('GITLAB_ADMIN_PASS', 'admin password')

GITEA_URL = 'https://gitea.dest.com'
GITEA_TOKEN = 'gitea token'
GITEA_URL = os.getenv('GITEA_URL','https://gitea.dest.com')
GITEA_TOKEN = os.getenv('GITEA_TOKEN', 'gitea token')
#######################
# CONFIG SECTION END
#######################
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
python-gitlab
requests
python-dateutil
mysql-connector
git+https://github.com/h44z/pygitea

0 comments on commit e9b43fc

Please sign in to comment.