├── .drone.yml ├── .gitignore ├── 0.8.x ├── README.md ├── docker-compose.bitbucket.yml ├── docker-compose.gitea.yml ├── docker-compose.github.mysql.yml ├── docker-compose.github.yml ├── docker-compose.gitlab.yml └── docker-compose.yml ├── 1.x ├── docker-compose.github.mysql.yml ├── docker-compose.github.yml ├── docker-compose.gitlab.yml ├── docker-compose.yml └── traefik+drone │ ├── README.md │ ├── drone │ └── docker-compose.yml │ └── traefik │ ├── acme.json │ ├── docker-compose.yml │ └── traefik.toml ├── 2.x └── docker-compose.yml ├── LICENSE ├── README.md ├── ansible ├── Makefile ├── host.ini ├── playbook.yml ├── roles │ ├── base │ │ ├── tasks │ │ │ ├── main.yml │ │ │ └── ubuntu.yml │ │ └── vars │ │ │ └── ubuntu.yml │ └── docker │ │ ├── defaults │ │ └── main.yml │ │ ├── handlers │ │ └── main.yml │ │ ├── tasks │ │ └── main.yml │ │ └── templates │ │ ├── daemon.json.j2 │ │ ├── default.j2 │ │ └── service.j2 └── vars │ ├── drone-agent.yml │ └── drone-server.yml ├── data └── mysql │ └── .gitkeep └── installation ├── images ├── bitbucket-setup-01.png ├── bitbucket-setup-02.png ├── bitbucket-setup-03.png ├── bitbucket-setup-04.png ├── bitbucket-setup-05.png ├── bitbucket-setup-06.png ├── github-setup-01.png ├── github-setup-02.png ├── github-setup-03.png ├── github-setup-04.png ├── github-setup-05.png ├── gitlab-setup-01.png ├── gitlab-setup-02.png ├── gitlab-setup-03.png └── gitlab-setup-04.png ├── install-with-bitbucket.md ├── install-with-github.md └── install-with-gitlab.md /.drone.yml: -------------------------------------------------------------------------------- 1 | kind: pipeline 2 | type: docker 3 | name: default 4 | 5 | steps: 6 | - name: greeting 7 | image: alpine 8 | commands: 9 | - echo hello 10 | - echo world 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.dll 4 | *.so 5 | *.dylib 6 | 7 | # Test binary, build with `go test -c` 8 | *.test 9 | 10 | # Output of the go coverage tool, specifically when used with LiteIDE 11 | *.out 12 | 13 | # Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736 14 | .glide/ 15 | .env 16 | *.sqlite 17 | playbook.retry 18 | -------------------------------------------------------------------------------- /0.8.x/README.md: -------------------------------------------------------------------------------- 1 | ## Install from Binary 2 | 3 | Separate server and agent binaries and images for [0.8.x](http://docs.drone.io/release-0.8.0) 4 | 5 | ```sh 6 | # 7 | # install dependencies 8 | # 9 | 10 | go get -u github.com/drone/drone-ui/dist 11 | go get -u golang.org/x/net/context 12 | go get -u golang.org/x/net/context/ctxhttp 13 | go get -u github.com/golang/protobuf/proto 14 | go get -u github.com/golang/protobuf/protoc-gen-go 15 | 16 | # 17 | # install binaries to $GOPATH/bin 18 | # 19 | 20 | go install github.com/drone/drone/cmd/drone-agent 21 | go install github.com/drone/drone/cmd/drone-server 22 | ``` 23 | 24 | ## Install from Docker 25 | 26 | Please make sure that you are already install [docker-compose](https://docs.docker.com/compose/install/) tool. 27 | 28 | ```yml 29 | version: '2' 30 | 31 | services: 32 | drone-server: 33 | image: drone/drone:0.8 34 | ports: 35 | - 80:8000 36 | - 9000:9000 37 | volumes: 38 | - /var/lib/drone:/var/lib/drone/ 39 | restart: always 40 | environment: 41 | - DRONE_HOST=http://drone.example.com 42 | - DRONE_OPEN=true 43 | - DRONE_GITHUB=true 44 | - DRONE_GITHUB_CLIENT=${DRONE_GITHUB_CLIENT} 45 | - DRONE_GITHUB_SECRET=${DRONE_GITHUB_SECRET} 46 | - DRONE_SECRET=${DRONE_SECRET} 47 | 48 | drone-agent: 49 | image: drone/agent:0.8 50 | restart: always 51 | depends_on: 52 | - drone-server 53 | volumes: 54 | - /var/run/docker.sock:/var/run/docker.sock 55 | environment: 56 | - DRONE_SERVER=drone-server:9000 57 | - DRONE_SECRET=${DRONE_SECRET} 58 | ``` 59 | 60 | ## Drone Installation 61 | 62 | * [Installation with GitHub][1] 63 | * [Installation with GitLab][2] 64 | * [Installation with BitBucket][3] 65 | * [Drone on Kubernetes on AWS][4] 66 | 67 | [1]:./installation/install-with-github.md 68 | [2]:./installation/install-with-gitlab.md 69 | [3]:./installation/install-with-bitbucket.md 70 | [4]:https://github.com/appleboy/drone-on-kubernetes/tree/master/aws 71 | -------------------------------------------------------------------------------- /0.8.x/docker-compose.bitbucket.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | 3 | services: 4 | drone-server: 5 | image: drone/drone:0.8 6 | ports: 7 | - 8080:8000 8 | - 9000:9000 9 | volumes: 10 | - ./:/var/lib/drone/ 11 | restart: always 12 | environment: 13 | - DRONE_HOST=https://559e3faa.ngrok.io 14 | - DRONE_OPEN=true 15 | - DRONE_SECRET=drone-workshop 16 | - DRONE_ADMIN=appleboy 17 | 18 | # BitBucket Config 19 | - DRONE_BITBUCKET=true 20 | - DRONE_BITBUCKET_CLIENT=${CLIENT} 21 | - DRONE_BITBUCKET_SECRET=${SECRET} 22 | 23 | drone-agent: 24 | image: drone/agent:0.8 25 | restart: always 26 | depends_on: 27 | - drone-server 28 | volumes: 29 | - /var/run/docker.sock:/var/run/docker.sock 30 | environment: 31 | - DRONE_SERVER=drone-server:9000 32 | - DRONE_SECRET=drone-workshop 33 | - DRONE_MAX_PROCS=3 34 | -------------------------------------------------------------------------------- /0.8.x/docker-compose.gitea.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | 3 | services: 4 | drone-server: 5 | image: drone/drone:0.8 6 | ports: 7 | - 8080:8000 8 | - 9000:9000 9 | volumes: 10 | - ./:/var/lib/drone/ 11 | restart: always 12 | environment: 13 | - DRONE_HOST=http://localhost:8080 14 | - DRONE_OPEN=true 15 | - DRONE_SECRET=drone-workshop 16 | - DRONE_ADMIN=appleboy 17 | 18 | # Gitea Config 19 | - DRONE_GITEA=true 20 | - DRONE_GITEA_URL=https://try.gitea.io 21 | - DRONE_GITEA_GIT_USERNAME=admin_username 22 | - DRONE_GITEA_GIT_PASSWORD=admin_password 23 | 24 | drone-agent: 25 | image: drone/agent:0.8 26 | restart: always 27 | depends_on: 28 | - drone-server 29 | volumes: 30 | - /var/run/docker.sock:/var/run/docker.sock 31 | environment: 32 | - DRONE_SERVER=drone-server:9000 33 | - DRONE_SECRET=drone-workshop 34 | - DRONE_MAX_PROCS=3 35 | -------------------------------------------------------------------------------- /0.8.x/docker-compose.github.mysql.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | 3 | services: 4 | drone-server: 5 | image: drone/drone:0.8 6 | ports: 7 | - 8080:8000 8 | - 9000:9000 9 | volumes: 10 | - ./:/var/lib/drone/ 11 | restart: always 12 | depends_on: 13 | - mysql-server 14 | environment: 15 | - DRONE_HOST=https://559e3faa.ngrok.io 16 | - DRONE_OPEN=true 17 | - DRONE_SECRET=drone-workshop 18 | - DRONE_ADMIN=appleboy 19 | 20 | # GitHub Config 21 | - DRONE_GITHUB=true 22 | - DRONE_GITHUB_CLIENT=c8cf09279ae4cea67115 23 | - DRONE_GITHUB_SECRET=88e91609a3428f270198f112d3c35f6b8aee5a11 24 | - DRONE_GITHUB_SCOPE=repo,repo:status,user:email,read:org 25 | 26 | # MySQL Database Setting 27 | - DRONE_DATABASE_DRIVER=mysql 28 | - DRONE_DATABASE_DATASOURCE=root:drone@tcp(mysql-server:3306)/drone?parseTime=true 29 | 30 | drone-agent: 31 | image: drone/agent:0.8 32 | restart: always 33 | depends_on: 34 | - drone-server 35 | volumes: 36 | - /var/run/docker.sock:/var/run/docker.sock 37 | environment: 38 | - DRONE_SERVER=drone-server:9000 39 | - DRONE_SECRET=drone-workshop 40 | - DRONE_MAX_PROCS=3 41 | 42 | mysql-server: 43 | image: mysql:5.7.17 44 | ports: 45 | - 3308:3306 46 | volumes: 47 | - ./data/mysql:/var/lib/mysql 48 | environment: 49 | - MYSQL_DATABASE=drone 50 | - MYSQL_ROOT_PASSWORD=drone 51 | 52 | -------------------------------------------------------------------------------- /0.8.x/docker-compose.github.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | 3 | services: 4 | drone-server: 5 | image: drone/drone:0.8 6 | ports: 7 | - 8080:8000 8 | - 9000:9000 9 | volumes: 10 | - ./:/var/lib/drone/ 11 | restart: always 12 | environment: 13 | - DRONE_HOST=https://559e3faa.ngrok.io 14 | - DRONE_OPEN=true 15 | - DRONE_SECRET=drone-workshop 16 | - DRONE_ADMIN=appleboy 17 | 18 | # GitHub Config 19 | - DRONE_GITHUB=true 20 | - DRONE_GITHUB_CLIENT=${CLIENT} 21 | - DRONE_GITHUB_SECRET=${SECRET} 22 | 23 | drone-agent: 24 | image: drone/agent:0.8 25 | restart: always 26 | depends_on: 27 | - drone-server 28 | volumes: 29 | - /var/run/docker.sock:/var/run/docker.sock 30 | environment: 31 | - DRONE_SERVER=drone-server:9000 32 | - DRONE_SECRET=drone-workshop 33 | - DRONE_MAX_PROCS=3 34 | -------------------------------------------------------------------------------- /0.8.x/docker-compose.gitlab.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | 3 | services: 4 | drone-server: 5 | image: drone/drone:0.8 6 | ports: 7 | - 8080:8000 8 | - 9000:9000 9 | volumes: 10 | - ./:/var/lib/drone/ 11 | restart: always 12 | environment: 13 | - DRONE_HOST=https://559e3faa.ngrok.io 14 | - DRONE_OPEN=true 15 | - DRONE_SECRET=drone-workshop 16 | - DRONE_ADMIN=appleboy 17 | 18 | # GitLab Config 19 | - DRONE_GITLAB=true 20 | - DRONE_GITLAB_CLIENT=${CLIENT} 21 | - DRONE_GITLAB_SECRET=${SECRET} 22 | - DRONE_GITLAB_URL=https://gitlab.com 23 | 24 | drone-agent: 25 | image: drone/agent:0.8 26 | restart: always 27 | depends_on: 28 | - drone-server 29 | volumes: 30 | - /var/run/docker.sock:/var/run/docker.sock 31 | environment: 32 | - DRONE_SERVER=drone-server:9000 33 | - DRONE_SECRET=drone-workshop 34 | - DRONE_MAX_PROCS=3 35 | -------------------------------------------------------------------------------- /0.8.x/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | 3 | services: 4 | drone-server: 5 | image: drone/drone:0.8 6 | ports: 7 | - 8080:8000 8 | volumes: 9 | - ./:/var/lib/drone/ 10 | restart: always 11 | environment: 12 | - DRONE_HOST=${HOST} 13 | - DRONE_OPEN=true 14 | - DRONE_SECRET=drone-workshop 15 | - DRONE_ADMIN=appleboy 16 | # GitHub Config 17 | - DRONE_GITHUB=true 18 | - DRONE_GITHUB_CLIENT=${CLIENT} 19 | - DRONE_GITHUB_SECRET=${SECRET} 20 | 21 | drone-agent: 22 | image: drone/agent:0.8 23 | restart: always 24 | depends_on: 25 | - drone-server 26 | volumes: 27 | - /var/run/docker.sock:/var/run/docker.sock 28 | environment: 29 | - DRONE_SERVER=drone-server:9000 30 | - DRONE_SECRET=drone-workshop 31 | - DRONE_MAX_PROCS=3 32 | -------------------------------------------------------------------------------- /1.x/docker-compose.github.mysql.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | 3 | services: 4 | drone-server: 5 | image: drone/drone:1 6 | ports: 7 | - 8081:80 8 | restart: always 9 | environment: 10 | - DRONE_SERVER_HOST=${DRONE_SERVER_HOST} 11 | - DRONE_SERVER_PROTO=${DRONE_SERVER_PROTO} 12 | - DRONE_TLS_AUTOCERT=false 13 | - DRONE_RPC_SECRET=${DRONE_RPC_SECRET} 14 | - DRONE_AGENTS_ENABLED=true 15 | - DRONE_DATABASE_DATASOURCE=root:drone@tcp(mysql-server:3306)/drone?parseTime=true 16 | # GitHub Config 17 | - DRONE_GITHUB_SERVER=https://github.com 18 | - DRONE_GITHUB_CLIENT_ID=${DRONE_GITHUB_CLIENT_ID} 19 | - DRONE_GITHUB_CLIENT_SECRET=${DRONE_GITHUB_CLIENT_SECRET} 20 | 21 | - DRONE_LOGS_PRETTY=true 22 | - DRONE_LOGS_COLOR=true 23 | 24 | # runner for docker version 25 | drone-runner: 26 | image: drone/drone-runner-docker:1 27 | restart: always 28 | depends_on: 29 | - drone-server 30 | volumes: 31 | - /var/run/docker.sock:/var/run/docker.sock 32 | environment: 33 | - DRONE_RPC_HOST=${DRONE_RPC_HOST} 34 | - DRONE_RPC_PROTO=${DRONE_RPC_PROTO} 35 | - DRONE_RPC_SECRET=${DRONE_RPC_SECRET} 36 | - DRONE_RUNNER_CAPACITY=3 37 | 38 | mysql-server: 39 | image: mysql:5.7 40 | ports: 41 | - 3308:3306 42 | volumes: 43 | - mysql-data:/var/lib/mysql 44 | environment: 45 | - MYSQL_DATABASE=drone 46 | - MYSQL_ROOT_PASSWORD=drone 47 | 48 | volumes: 49 | mysql-data: 50 | -------------------------------------------------------------------------------- /1.x/docker-compose.github.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | 3 | services: 4 | drone-server: 5 | image: drone/drone:1 6 | ports: 7 | - 8081:80 8 | volumes: 9 | - ./:/data 10 | restart: always 11 | environment: 12 | - DRONE_SERVER_HOST=${DRONE_SERVER_HOST} 13 | - DRONE_SERVER_PROTO=${DRONE_SERVER_PROTO} 14 | - DRONE_RPC_SECRET=${DRONE_RPC_SECRET} 15 | 16 | # GitHub Config 17 | - DRONE_GITHUB_SERVER=https://github.com 18 | - DRONE_GITHUB_CLIENT_ID=${DRONE_GITHUB_CLIENT_ID} 19 | - DRONE_GITHUB_CLIENT_SECRET=${DRONE_GITHUB_CLIENT_SECRET} 20 | 21 | - DRONE_LOGS_PRETTY=true 22 | - DRONE_LOGS_COLOR=true 23 | 24 | # runner for docker version 25 | drone-runner: 26 | image: drone/drone-runner-docker:1 27 | restart: always 28 | depends_on: 29 | - drone-server 30 | volumes: 31 | - /var/run/docker.sock:/var/run/docker.sock 32 | environment: 33 | - DRONE_RPC_HOST=${DRONE_RPC_HOST} 34 | - DRONE_RPC_PROTO=${DRONE_RPC_PROTO} 35 | - DRONE_RPC_SECRET=${DRONE_RPC_SECRET} 36 | - DRONE_RUNNER_CAPACITY=3 37 | -------------------------------------------------------------------------------- /1.x/docker-compose.gitlab.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | 3 | services: 4 | drone-server: 5 | image: drone/drone:1 6 | ports: 7 | - 8081:80 8 | volumes: 9 | - ./:/data 10 | restart: always 11 | environment: 12 | - DRONE_SERVER_HOST=${DRONE_SERVER_HOST} 13 | - DRONE_SERVER_PROTO=${DRONE_SERVER_PROTO} 14 | - DRONE_RPC_SECRET=${DRONE_RPC_SECRET} 15 | # Gitlab Config 16 | - DRONE_GITLAB_SERVER=https://gitlab.com 17 | - DRONE_GITLAB_CLIENT_ID=${DRONE_GITLAB_CLIENT_ID} 18 | - DRONE_GITLAB_CLIENT_SECRET=${DRONE_GITLAB_CLIENT_SECRET} 19 | - DRONE_LOGS_PRETTY=true 20 | - DRONE_LOGS_COLOR=true 21 | 22 | # runner for docker version 23 | drone-runner: 24 | image: drone/drone-runner-docker:1 25 | restart: always 26 | depends_on: 27 | - drone-server 28 | volumes: 29 | - /var/run/docker.sock:/var/run/docker.sock 30 | environment: 31 | - DRONE_RPC_HOST=${DRONE_RPC_HOST} 32 | - DRONE_RPC_PROTO=${DRONE_RPC_PROTO} 33 | - DRONE_RPC_SECRET=${DRONE_RPC_SECRET} 34 | - DRONE_RUNNER_CAPACITY=3 35 | -------------------------------------------------------------------------------- /1.x/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | 3 | services: 4 | drone-server: 5 | image: drone/drone:1 6 | ports: 7 | - 8081:80 8 | volumes: 9 | - ./:/data 10 | restart: always 11 | environment: 12 | - DRONE_SERVER_HOST=${DRONE_SERVER_HOST} 13 | - DRONE_SERVER_PROTO=${DRONE_SERVER_PROTO} 14 | - DRONE_RPC_SECRET=${DRONE_RPC_SECRET} 15 | 16 | # GitHub Config 17 | - DRONE_GITHUB_SERVER=https://github.com 18 | - DRONE_GITHUB_CLIENT_ID=${DRONE_GITHUB_CLIENT_ID} 19 | - DRONE_GITHUB_CLIENT_SECRET=${DRONE_GITHUB_CLIENT_SECRET} 20 | 21 | - DRONE_LOGS_PRETTY=true 22 | - DRONE_LOGS_COLOR=true 23 | 24 | # runner for docker version 25 | drone-runner: 26 | image: drone/drone-runner-docker:1 27 | restart: always 28 | depends_on: 29 | - drone-server 30 | volumes: 31 | - /var/run/docker.sock:/var/run/docker.sock 32 | environment: 33 | - DRONE_RPC_HOST=${DRONE_RPC_HOST} 34 | - DRONE_RPC_PROTO=${DRONE_RPC_PROTO} 35 | - DRONE_RPC_SECRET=${DRONE_RPC_SECRET} 36 | - DRONE_RUNNER_CAPACITY=3 37 | -------------------------------------------------------------------------------- /1.x/traefik+drone/README.md: -------------------------------------------------------------------------------- 1 | # Traefik + Drone CI/CD Server 2 | 3 | ## Setup the traefik service 4 | 5 | 1. copy the `traefik` folder to `/opt/` 6 | 7 | ```sh 8 | $ cp -r traefik /opt/ 9 | ``` 10 | 11 | 2. change the permission of `acme.json` to `600` 12 | 13 | ```sh 14 | $ chmod 600 /opt/traefik/acme.json 15 | ``` 16 | 17 | 3. create `web` docker network 18 | 19 | ```sh 20 | $ docker network create web 21 | ``` 22 | 23 | 4. Start the traefik service using Docker 24 | 25 | ```sh 26 | $ cd /opt/traefik/ && docker-compose up -d 27 | ``` 28 | 29 | ## Setup the single server of Drone 30 | 31 | 1. copy `drone` folder to `/home/` 32 | 33 | ```sh 34 | $ cp -r traefik /home/ 35 | ``` 36 | 37 | 2. update the drone setting in `.env` 38 | 39 | ``` 40 | DRONE_SERVER_HOST=example.com 41 | DRONE_SERVER_PROTO=http 42 | DRONE_GITHUB_CLIENT_ID=xxxx 43 | DRONE_GITHUB_CLIENT_SECRET=xxxx 44 | ``` 45 | 46 | 3 start the drone service. 47 | 48 | ```sh 49 | $ cd /home/drone/ && docker-compose up -d 50 | ``` 51 | 52 | 4. open the drone link in your browser 53 | -------------------------------------------------------------------------------- /1.x/traefik+drone/drone/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | 3 | services: 4 | drone-server: 5 | image: drone/drone:1 6 | volumes: 7 | - ./:/data 8 | - /var/run/docker.sock:/var/run/docker.sock 9 | restart: always 10 | environment: 11 | - DRONE_SERVER_HOST=${DRONE_SERVER_HOST} 12 | - DRONE_SERVER_PROTO=${DRONE_SERVER_PROTO} 13 | - DRONE_TLS_AUTOCERT=false 14 | - DRONE_RUNNER_CAPACITY=3 15 | # GitHub Config 16 | - DRONE_GITHUB_SERVER=https://github.com 17 | - DRONE_GITHUB_CLIENT_ID=${DRONE_GITHUB_CLIENT_ID} 18 | - DRONE_GITHUB_CLIENT_SECRET=${DRONE_GITHUB_CLIENT_SECRET} 19 | - DRONE_LOGS_PRETTY=true 20 | - DRONE_LOGS_COLOR=true 21 | networks: 22 | - web 23 | logging: 24 | options: 25 | max-size: "100k" 26 | max-file: "3" 27 | labels: 28 | - "traefik.docker.network=web" 29 | - "traefik.enable=true" 30 | - "traefik.basic.frontend.rule=Host:${DRONE_SERVER_HOST}" 31 | - "traefik.basic.port=80" 32 | - "traefik.basic.protocol=http" 33 | 34 | networks: 35 | web: 36 | external: true 37 | -------------------------------------------------------------------------------- /1.x/traefik+drone/traefik/acme.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-training/drone-tutorial/b743298b88e1e9684097c029d21ebdc8daa5de3e/1.x/traefik+drone/traefik/acme.json -------------------------------------------------------------------------------- /1.x/traefik+drone/traefik/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | 3 | services: 4 | traefik: 5 | image: traefik 6 | restart: always 7 | ports: 8 | - 80:80 9 | - 443:443 10 | - 8080:8080 11 | networks: 12 | - web 13 | volumes: 14 | - /var/run/docker.sock:/var/run/docker.sock 15 | - ./traefik.toml:/traefik.toml 16 | - ./acme.json:/acme.json 17 | container_name: traefik 18 | 19 | networks: 20 | web: 21 | external: true 22 | -------------------------------------------------------------------------------- /1.x/traefik+drone/traefik/traefik.toml: -------------------------------------------------------------------------------- 1 | debug = false 2 | 3 | logLevel = "INFO" 4 | defaultEntryPoints = ["https","http"] 5 | 6 | [entryPoints] 7 | [entryPoints.http] 8 | address = ":80" 9 | [entryPoints.http.redirect] 10 | entryPoint = "https" 11 | [entryPoints.https] 12 | address = ":443" 13 | [entryPoints.https.tls] 14 | 15 | [acme] 16 | email = "xxxxx@gmail.com" 17 | storage = "acme.json" 18 | entryPoint = "https" 19 | onHostRule = true 20 | 21 | [acme.httpChallenge] 22 | entryPoint = "http" 23 | 24 | [docker] 25 | endpoint = "unix:///var/run/docker.sock" 26 | watch = true 27 | -------------------------------------------------------------------------------- /2.x/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | 3 | services: 4 | drone-server: 5 | image: drone/drone:2 6 | ports: 7 | - 8081:80 8 | volumes: 9 | - ./:/data 10 | restart: always 11 | environment: 12 | - DRONE_SERVER_HOST=${DRONE_SERVER_HOST} 13 | - DRONE_SERVER_PROTO=${DRONE_SERVER_PROTO} 14 | - DRONE_RPC_SECRET=${DRONE_RPC_SECRET} 15 | 16 | # GitHub Config 17 | - DRONE_GITHUB_SERVER=https://github.com 18 | - DRONE_GITHUB_CLIENT_ID=${DRONE_GITHUB_CLIENT_ID} 19 | - DRONE_GITHUB_CLIENT_SECRET=${DRONE_GITHUB_CLIENT_SECRET} 20 | 21 | - DRONE_LOGS_PRETTY=true 22 | - DRONE_LOGS_COLOR=true 23 | - DRONE_DEBUG=true 24 | - DRONE_TRACE=true 25 | 26 | drone-runner: 27 | image: drone/drone-runner-docker:1 28 | restart: always 29 | depends_on: 30 | - drone-server 31 | ports: 32 | - 3000:3000 33 | volumes: 34 | - /var/run/docker.sock:/var/run/docker.sock 35 | environment: 36 | - DRONE_RPC_HOST=${DRONE_SERVER_HOST} 37 | - DRONE_RPC_PROTO=${DRONE_SERVER_PROTO} 38 | - DRONE_RPC_SECRET=${DRONE_RPC_SECRET} 39 | - DRONE_RUNNER_CAPACITY=2 40 | - DRONE_RUNNER_NAME=my-first-runner 41 | - DRONE_DEBUG=true 42 | - DRONE_TRACE=true 43 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 golang workshop 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # drone-tutorial 2 | 3 | Drone Continuous Delivery Documentation 4 | 5 | ## Install Drone with GitHub 6 | 7 | ```yaml 8 | version: '2' 9 | 10 | services: 11 | drone-server: 12 | image: drone/drone:1 13 | ports: 14 | - 8081:80 15 | volumes: 16 | - ./:/data 17 | restart: always 18 | environment: 19 | - DRONE_SERVER_HOST=${DRONE_SERVER_HOST} 20 | - DRONE_SERVER_PROTO=${DRONE_SERVER_PROTO} 21 | - DRONE_RPC_SECRET=${DRONE_RPC_SECRET} 22 | 23 | # GitHub Config 24 | - DRONE_GITHUB_SERVER=https://github.com 25 | - DRONE_GITHUB_CLIENT_ID=${DRONE_GITHUB_CLIENT_ID} 26 | - DRONE_GITHUB_CLIENT_SECRET=${DRONE_GITHUB_CLIENT_SECRET} 27 | 28 | - DRONE_LOGS_PRETTY=true 29 | - DRONE_LOGS_COLOR=true 30 | 31 | # runner for docker version 32 | drone-runner: 33 | image: drone/drone-runner-docker:1 34 | restart: always 35 | depends_on: 36 | - drone-server 37 | volumes: 38 | - /var/run/docker.sock:/var/run/docker.sock 39 | environment: 40 | - DRONE_RPC_HOST=${DRONE_RPC_HOST} 41 | - DRONE_RPC_PROTO=${DRONE_RPC_PROTO} 42 | - DRONE_RPC_SECRET=${DRONE_RPC_SECRET} 43 | - DRONE_RUNNER_CAPACITY=3 44 | ``` 45 | 46 | ## Install Drone with GitLab 47 | 48 | ```yaml 49 | version: '2' 50 | 51 | services: 52 | drone-server: 53 | image: drone/drone:1 54 | ports: 55 | - 8081:80 56 | volumes: 57 | - ./:/data 58 | restart: always 59 | environment: 60 | - DRONE_SERVER_HOST=${DRONE_SERVER_HOST} 61 | - DRONE_SERVER_PROTO=${DRONE_SERVER_PROTO} 62 | - DRONE_RPC_SECRET=${DRONE_RPC_SECRET} 63 | # Gitlab Config 64 | - DRONE_GITLAB_SERVER=https://gitlab.com 65 | - DRONE_GITLAB_CLIENT_ID=${DRONE_GITLAB_CLIENT_ID} 66 | - DRONE_GITLAB_CLIENT_SECRET=${DRONE_GITLAB_CLIENT_SECRET} 67 | - DRONE_LOGS_PRETTY=true 68 | - DRONE_LOGS_COLOR=true 69 | 70 | # runner for docker version 71 | drone-runner: 72 | image: drone/drone-runner-docker:1 73 | restart: always 74 | depends_on: 75 | - drone-server 76 | volumes: 77 | - /var/run/docker.sock:/var/run/docker.sock 78 | environment: 79 | - DRONE_RPC_HOST=${DRONE_RPC_HOST} 80 | - DRONE_RPC_PROTO=${DRONE_RPC_PROTO} 81 | - DRONE_RPC_SECRET=${DRONE_RPC_SECRET} 82 | - DRONE_RUNNER_CAPACITY=3 83 | ``` 84 | 85 | ## Git Service Configutation 86 | 87 | * [Configutation with GitHub][1] 88 | * [Configutation with GitLab][2] 89 | * [Configutation with BitBucket][3] 90 | * [Drone on Kubernetes on AWS][4] 91 | 92 | [1]:./installation/install-with-github.md 93 | [2]:./installation/install-with-gitlab.md 94 | [3]:./installation/install-with-bitbucket.md 95 | [4]:https://github.com/appleboy/drone-on-kubernetes/tree/master/aws 96 | -------------------------------------------------------------------------------- /ansible/Makefile: -------------------------------------------------------------------------------- 1 | all: ansible 2 | 3 | lint: 4 | ansible-lint --exclude=$(HOME)/.ansible/roles playbook.yml 5 | 6 | ansible: lint 7 | ansible-playbook -i host.ini playbook.yml 8 | -------------------------------------------------------------------------------- /ansible/host.ini: -------------------------------------------------------------------------------- 1 | [drone_server] 2 | elephant ansible_user=multipass ansible_host=192.168.64.7 ansible_port=22 3 | 4 | [drone_agent] 5 | monkey ansible_user=multipass ansible_host=192.168.64.7 ansible_port=22 6 | -------------------------------------------------------------------------------- /ansible/playbook.yml: -------------------------------------------------------------------------------- 1 | - hosts: 2 | - drone_server 3 | - drone_agent 4 | gather_facts: False 5 | tasks: 6 | - name: bootstrap 7 | raw: | 8 | test -e /usr/bin/python || (apt -y update && apt install -y python-minimal) 9 | test -e /usr/local/bin/pip || (curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && python get-pip.py && pip install docker-py) 10 | changed_when: False 11 | become: true 12 | become_user: root 13 | register: out 14 | - debug: var=out.stdout_lines 15 | 16 | - name: "deploy drone server." 17 | hosts: drone_server 18 | become: true 19 | become_user: root 20 | roles: 21 | - { role: appleboy.drone } 22 | vars_files: 23 | - vars/drone-server.yml 24 | 25 | - name: "deploy drone agent." 26 | hosts: drone_agent 27 | become: true 28 | become_user: root 29 | roles: 30 | - { role: appleboy.drone } 31 | vars_files: 32 | - vars/drone-agent.yml 33 | -------------------------------------------------------------------------------- /ansible/roles/base/tasks/main.yml: -------------------------------------------------------------------------------- 1 | - name: vars 2 | include_vars: ubuntu.yml 3 | when: ansible_distribution == 'Ubuntu' 4 | tags: 5 | - base 6 | 7 | - name: ubuntu 8 | import_tasks: ubuntu.yml 9 | when: ansible_distribution == 'Ubuntu' 10 | tags: 11 | - base 12 | -------------------------------------------------------------------------------- /ansible/roles/base/tasks/ubuntu.yml: -------------------------------------------------------------------------------- 1 | - name: install 2 | with_items: '{{ base_packages }}' 3 | package: 4 | name: '{{ item }}' 5 | state: present 6 | tags: 7 | - base 8 | -------------------------------------------------------------------------------- /ansible/roles/base/vars/ubuntu.yml: -------------------------------------------------------------------------------- 1 | base_packages: 2 | - apt-transport-https 3 | - software-properties-common 4 | - htop 5 | - tree 6 | -------------------------------------------------------------------------------- /ansible/roles/docker/defaults/main.yml: -------------------------------------------------------------------------------- 1 | docker_deps: 2 | - apt-transport-https 3 | - ca-certificates 4 | - software-properties-common 5 | 6 | docker_packages: 7 | - docker-ce 8 | 9 | docker_services: 10 | - docker 11 | 12 | docker_compose_url: https://github.com/docker/compose/releases/download/1.24.0/docker-compose-Linux-x86_64 13 | docker_compose_checksum: 223f149e2048c7d18fd6a57af213c4d451a06a42 14 | 15 | docker_opts: "--bip=192.168.1.10/24 --fixed-cidr=192.168.1.0/24" 16 | -------------------------------------------------------------------------------- /ansible/roles/docker/handlers/main.yml: -------------------------------------------------------------------------------- 1 | - name: restart docker 2 | with_items: '{{ docker_services }}' 3 | systemd: 4 | name: '{{ item }}' 5 | state: restarted 6 | daemon_reload: yes 7 | -------------------------------------------------------------------------------- /ansible/roles/docker/tasks/main.yml: -------------------------------------------------------------------------------- 1 | - name: deps 2 | with_items: '{{ docker_deps }}' 3 | package: 4 | name: '{{ item }}' 5 | state: present 6 | tags: 7 | - docker 8 | 9 | - name: key1 10 | apt_key: 11 | url: https://download.docker.com/linux/ubuntu/gpg 12 | id: 9DC858229FC7DD38854AE2D88D81803C0EBFCD88 13 | state: present 14 | tags: 15 | - docker 16 | 17 | - name: key2 18 | apt_key: 19 | keyserver: hkp://p80.pool.sks-keyservers.net:80 20 | id: 58118E89F3A912897C070ADBF76221572C52609D 21 | state: present 22 | tags: 23 | - docker 24 | 25 | - name: repo 26 | apt_repository: 27 | repo: deb [arch=amd64] https://download.docker.com/linux/ubuntu {{ ansible_distribution_release }} stable 28 | filename: docker 29 | update_cache: yes 30 | state: present 31 | tags: 32 | - docker 33 | 34 | - name: install 35 | with_items: '{{ docker_packages }}' 36 | package: 37 | name: '{{ item }}' 38 | state: present 39 | tags: 40 | - docker 41 | 42 | - name: service 43 | notify: 44 | - restart docker 45 | template: 46 | src: service.j2 47 | dest: /etc/systemd/system/docker.service 48 | tags: 49 | - docker 50 | 51 | - name: default config 52 | notify: 53 | - restart docker 54 | template: 55 | src: default.j2 56 | dest: /etc/default/docker 57 | tags: 58 | - docker 59 | 60 | - name: daemon config 61 | notify: 62 | - restart docker 63 | template: 64 | src: daemon.json.j2 65 | dest: /etc/docker/daemon.json 66 | tags: 67 | - docker 68 | 69 | - name: start 70 | with_items: '{{ docker_services }}' 71 | systemd: 72 | name: '{{ item }}' 73 | state: started 74 | daemon_reload: yes 75 | masked: no 76 | enabled: yes 77 | tags: 78 | - docker 79 | 80 | - name: compose 81 | get_url: 82 | url: '{{ docker_compose_url }}' 83 | dest: /usr/local/bin/docker-compose 84 | checksum: sha1:{{ docker_compose_checksum }} 85 | mode: u=rwx,g=rx,o=rx 86 | validate_certs: false 87 | tags: 88 | - docker 89 | -------------------------------------------------------------------------------- /ansible/roles/docker/templates/daemon.json.j2: -------------------------------------------------------------------------------- 1 | { 2 | "insecure-registries": ["mtksms10.mediatek.inc:5000", "mtksitap54.mediatek.inc:5000"] 3 | } 4 | -------------------------------------------------------------------------------- /ansible/roles/docker/templates/default.j2: -------------------------------------------------------------------------------- 1 | DOCKER_OPTS="{{ docker_opts }}" 2 | -------------------------------------------------------------------------------- /ansible/roles/docker/templates/service.j2: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Docker 3 | 4 | After=network.target 5 | After=docker.socket 6 | Requires=docker.socket 7 | 8 | [Service] 9 | EnvironmentFile=-/etc/default/docker 10 | 11 | Type=notify 12 | TimeoutStartSec=0 13 | Delegate=yes 14 | KillMode=process 15 | LimitNOFILE=1048576 16 | LimitNPROC=infinity 17 | LimitCORE=infinity 18 | TasksMax=infinity 19 | Restart=on-failure 20 | StartLimitBurst=3 21 | StartLimitInterval=60s 22 | 23 | ExecStart=/usr/bin/dockerd -H fd:// $DOCKER_OPTS 24 | ExecReload=/bin/kill -s HUP $MAINPID 25 | 26 | [Install] 27 | WantedBy=multi-user.target 28 | -------------------------------------------------------------------------------- /ansible/vars/drone-agent.yml: -------------------------------------------------------------------------------- 1 | drone_agent_enable: "true" 2 | drone_version: "latest" 3 | drone_rpc_server: "http://192.168.64.7:8080" 4 | drone_rpc_secret: "30075d074bfd9e74cfd0b84a5886b986" 5 | docker_compose_version: "1.24.0" 6 | docker_users: 7 | - multipass 8 | -------------------------------------------------------------------------------- /ansible/vars/drone-server.yml: -------------------------------------------------------------------------------- 1 | drone_server_enable: "true" 2 | drone_version: "latest" 3 | drone_github_client_id: "e2bdde88b88f7ccf873a" 4 | drone_github_client_secret: "64be56c439c4702778c698591bd63213bcd66ae2" 5 | drone_server_host: "b3ae145e.ngrok.io" 6 | drone_server_proto: "https" 7 | drone_rpc_secret: "30075d074bfd9e74cfd0b84a5886b986" 8 | drone_agents_enabled: true 9 | # drone_database_driver: "postgres" 10 | # drone_database_datasource: "postgres://drone:drone@postgres:5432/drone?sslmode=disable" 11 | # drone_database_driver: "mysql" 12 | # drone_database_datasource: "drone:drone@tcp(mysql:3306)/drone?parseTime=true" 13 | docker_compose_version: "1.24.0" 14 | docker_users: 15 | - multipass 16 | -------------------------------------------------------------------------------- /data/mysql/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-training/drone-tutorial/b743298b88e1e9684097c029d21ebdc8daa5de3e/data/mysql/.gitkeep -------------------------------------------------------------------------------- /installation/images/bitbucket-setup-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-training/drone-tutorial/b743298b88e1e9684097c029d21ebdc8daa5de3e/installation/images/bitbucket-setup-01.png -------------------------------------------------------------------------------- /installation/images/bitbucket-setup-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-training/drone-tutorial/b743298b88e1e9684097c029d21ebdc8daa5de3e/installation/images/bitbucket-setup-02.png -------------------------------------------------------------------------------- /installation/images/bitbucket-setup-03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-training/drone-tutorial/b743298b88e1e9684097c029d21ebdc8daa5de3e/installation/images/bitbucket-setup-03.png -------------------------------------------------------------------------------- /installation/images/bitbucket-setup-04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-training/drone-tutorial/b743298b88e1e9684097c029d21ebdc8daa5de3e/installation/images/bitbucket-setup-04.png -------------------------------------------------------------------------------- /installation/images/bitbucket-setup-05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-training/drone-tutorial/b743298b88e1e9684097c029d21ebdc8daa5de3e/installation/images/bitbucket-setup-05.png -------------------------------------------------------------------------------- /installation/images/bitbucket-setup-06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-training/drone-tutorial/b743298b88e1e9684097c029d21ebdc8daa5de3e/installation/images/bitbucket-setup-06.png -------------------------------------------------------------------------------- /installation/images/github-setup-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-training/drone-tutorial/b743298b88e1e9684097c029d21ebdc8daa5de3e/installation/images/github-setup-01.png -------------------------------------------------------------------------------- /installation/images/github-setup-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-training/drone-tutorial/b743298b88e1e9684097c029d21ebdc8daa5de3e/installation/images/github-setup-02.png -------------------------------------------------------------------------------- /installation/images/github-setup-03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-training/drone-tutorial/b743298b88e1e9684097c029d21ebdc8daa5de3e/installation/images/github-setup-03.png -------------------------------------------------------------------------------- /installation/images/github-setup-04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-training/drone-tutorial/b743298b88e1e9684097c029d21ebdc8daa5de3e/installation/images/github-setup-04.png -------------------------------------------------------------------------------- /installation/images/github-setup-05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-training/drone-tutorial/b743298b88e1e9684097c029d21ebdc8daa5de3e/installation/images/github-setup-05.png -------------------------------------------------------------------------------- /installation/images/gitlab-setup-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-training/drone-tutorial/b743298b88e1e9684097c029d21ebdc8daa5de3e/installation/images/gitlab-setup-01.png -------------------------------------------------------------------------------- /installation/images/gitlab-setup-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-training/drone-tutorial/b743298b88e1e9684097c029d21ebdc8daa5de3e/installation/images/gitlab-setup-02.png -------------------------------------------------------------------------------- /installation/images/gitlab-setup-03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-training/drone-tutorial/b743298b88e1e9684097c029d21ebdc8daa5de3e/installation/images/gitlab-setup-03.png -------------------------------------------------------------------------------- /installation/images/gitlab-setup-04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-training/drone-tutorial/b743298b88e1e9684097c029d21ebdc8daa5de3e/installation/images/gitlab-setup-04.png -------------------------------------------------------------------------------- /installation/install-with-bitbucket.md: -------------------------------------------------------------------------------- 1 | # Install Drone with Bitbucket 2 | 3 | See the online documentaion: 4 | 5 | * Bitbucket Cloud: [Single Machine](https://docs.drone.io/installation/bitbucket-cloud/single-machine/) | [Multi-Machine](https://docs.drone.io/installation/bitbucket-cloud/multi-machine/) 6 | * Bitbucket Server: [Single Machine](https://docs.drone.io/installation/bitbucket-server/single-machine/) | [Multi-Machine](https://docs.drone.io/installation/bitbucket-server/multi-machine/) 7 | 8 | ## How to register OAuth application 9 | 10 | Go to your account setting in bitbucket, click `OAuth` under `ACCESS MANAGEMENT` menu on left sidebar and click `Add consumer` under `OAuth consumers`. 11 | 12 | ![bitbucket-setup-01](images/bitbucket-setup-01.png) 13 | 14 | You will see the following register page. 15 | 16 | ![bitbucket-setup-02](images/bitbucket-setup-02.png) 17 | 18 | Please make sure that your drone `Callback URL` setting. It is very import the authorization callback URL matches your http(s) scheme and hostname exactly with **/authorize** (0.8) **/login** (1.0) as the path. 19 | 20 | ![bitbucket-setup-03](images/bitbucket-setup-03.png) 21 | 22 | Check the following OAuth Permissions 23 | 24 | ![bitbucket-setup-04](images/bitbucket-setup-04.png) 25 | 26 | Copy `Key` and `Secret` in `OAuth consumers` 27 | 28 | ![bitbucket-setup-06](images/bitbucket-setup-06.png) 29 | 30 | Open your drone home page in your browser and login as BitBucket account. 31 | 32 | ![bitbucket-setup-05](images/bitbucket-setup-05.png) 33 | -------------------------------------------------------------------------------- /installation/install-with-github.md: -------------------------------------------------------------------------------- 1 | # Install Drone with GitHub 2 | 3 | See the online documentaion: [Single Machine](https://docs.drone.io/installation/github/single-machine/) | [Multi-Machine](https://docs.drone.io/installation/github/multi-machine/) | [Kubernetes](https://docs.drone.io/installation/github/kubernetes/) 4 | 5 | ## How to register OAuth application 6 | 7 | Go to your GiHub [profile setting](https://github.com/settings/profile) and click `OAuth applications` under `Developer settings` menu on left sidebar. 8 | 9 | ![github-setup-01](images/github-setup-01.png) 10 | 11 | You will see the following register page. 12 | 13 | ![github-setup-02](images/github-setup-02.png) 14 | 15 | Please make sure that your drone `Authorization callback URL` setting. It is very import the authorization callback URL matches your http(s) scheme and hostname exactly with **/authorize** (0.8) **/login** (1.0) as the path. 16 | 17 | ![github-setup-03](images/github-setup-03.png)> 18 | 19 | Copy `Client ID` and `Client Secret` 20 | 21 | ![github-setup-04](images/github-setup-04.png) 22 | 23 | Open your drone home page in your browser and login as Github account. 24 | 25 | ![github-setup-05](images/github-setup-05.png) 26 | -------------------------------------------------------------------------------- /installation/install-with-gitlab.md: -------------------------------------------------------------------------------- 1 | # Install Drone with GitLab 2 | 3 | See the online documentaion: [Single Machine](https://docs.drone.io/installation/gitlab/single-machine/) | [Multi-Machine](https://docs.drone.io/installation/gitlab/multi-machine/) 4 | 5 | ## How to register OAuth application 6 | 7 | Go to your GitLab [profile setting](https://gitlab.com/profile) and navigate to your account settings and choose `Applications` from the menu. 8 | 9 | ![gitlab-setup-01](images/gitlab-setup-01.png) 10 | 11 | Please make sure that your drone `Redirect URI` setting. It is very import the authorization callback URL matches your http(s) scheme and hostname exactly with **/authorize** (0.8) **/login** (1.0) as the path. 12 | 13 | ![gitlab-setup-02](images/gitlab-setup-02.png) 14 | 15 | Copy `Application ID` and `Secret` 16 | 17 | ![gitlab-setup-03](images/gitlab-setup-03.png) 18 | 19 | Open your drone home page in your browser and login as gitlab account. 20 | 21 | ![gitlab-setup-04](images/gitlab-setup-04.png) 22 | --------------------------------------------------------------------------------