drone
This commit is contained in:
parent
f2f6f9e146
commit
25846155af
2 changed files with 104 additions and 7 deletions
71
README.md
71
README.md
|
@ -199,12 +199,81 @@ bundle exec jekyll serve
|
|||
|
||||
And then go to: http://localhost:4000/admin/
|
||||
|
||||
Click on "Login with Gitea".
|
||||
Click on "Login with Gitea".
|
||||
Now you must see a dashboard,
|
||||
you should be able to create new articles too.
|
||||
|
||||
That's perfect, now you can commit your admin folder,
|
||||
you have a basic CMS integration.
|
||||
|
||||
```
|
||||
git add admin
|
||||
git commit -a
|
||||
git pull && git push
|
||||
```
|
||||
|
||||
## Install Drone
|
||||
|
||||
Now we will want to automate the building of your website.
|
||||
We will need to create an Oauth2 client for Drone, similarly to Teabag.
|
||||
As in our example we are running Drone on `localhost:3002`, the callback
|
||||
URL is `http://localhost:3002/login`.
|
||||
|
||||
(fixme: mount the sqlite db on the host)
|
||||
|
||||
Once you have your credentials, you can launch the Drone
|
||||
daemon with the recommended parameters.
|
||||
Simply follow this doc: https://docs.drone.io/server/provider/gitea/
|
||||
|
||||
Then go to: http://localhost:3002
|
||||
Authenticate yourself.
|
||||
And activate your blog repo (mine is `quentin/my-blog`).
|
||||
|
||||
You will also need a runner to execute your builds.
|
||||
Check this page: https://docs.drone.io/runner/overview/
|
||||
I will use a docker runner on my side.
|
||||
|
||||
(note: I am currently using `iptables -F` as a dangerous workaround to docker's
|
||||
network firewalling)
|
||||
|
||||
## Configure Drone on your repo
|
||||
|
||||
We will now create a `.drone.yml` file that will tell to
|
||||
Drone how to generate our static website.
|
||||
|
||||
Due to my strange deployment, I need a custom cloning logic.
|
||||
But this is not required in a normal deployment.
|
||||
|
||||
```yml
|
||||
---
|
||||
kind: pipeline
|
||||
name: default
|
||||
|
||||
clone:
|
||||
disable: true
|
||||
|
||||
steps:
|
||||
- name: clone
|
||||
image: alpine/git
|
||||
commands:
|
||||
- git clone http://172.17.0.1:3000/quentin/my-blog.git .
|
||||
- git checkout $DRONE_COMMIT
|
||||
|
||||
- name: build
|
||||
image: ruby
|
||||
commands:
|
||||
- bundle install
|
||||
- bundle exec jekyll build
|
||||
|
||||
- name: publish
|
||||
image: ruby
|
||||
commands:
|
||||
- echo pretend we publish something
|
||||
```
|
||||
|
||||
So, great, we know how to build our website!
|
||||
The last step is to publish it!
|
||||
|
||||
## Install Garage
|
||||
|
||||
## Configure a website on Garage
|
||||
|
|
|
@ -1,14 +1,11 @@
|
|||
version: "3.4"
|
||||
|
||||
networks:
|
||||
gitea:
|
||||
external: false
|
||||
|
||||
services:
|
||||
server:
|
||||
# Patched image required for Gitea version < 1.19
|
||||
image: superboum/gitea:1.17.4-cors
|
||||
container_name: gitea
|
||||
network_mode: host
|
||||
environment:
|
||||
- USER_UID=1000
|
||||
- USER_GID=1000
|
||||
|
@ -18,9 +15,9 @@ services:
|
|||
- GITEA__cors__SCHEME =*
|
||||
# Ignored in Gitea version < 1.19, see image comment above
|
||||
- GITEA__cors__HEADERS =Content-Type,User-Agent,Authorization
|
||||
# HTTP hooks
|
||||
- GITEA__webhook__ALLOWED_HOST_LIST=*
|
||||
restart: always
|
||||
networks:
|
||||
- gitea
|
||||
volumes:
|
||||
- ./gitea:/data
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
|
@ -37,3 +34,34 @@ services:
|
|||
- ./teabag.env:/etc/teabag/teabag.env
|
||||
ports:
|
||||
- "3001:3001"
|
||||
|
||||
drone:
|
||||
image: drone/drone:2
|
||||
container_name: drone
|
||||
network_mode: host
|
||||
restart: always
|
||||
environment:
|
||||
- DRONE_GITEA_CLIENT_ID=2ede47ba-c943-48ad-8f7b-987df45983ee
|
||||
- DRONE_GITEA_CLIENT_SECRET=gto_vvj5e4fjvg6s3zeu4plgolvx2erowjvcp5bzhfo4c76v7bn466pa
|
||||
- DRONE_GITEA_SERVER=http://localhost:3000
|
||||
- DRONE_RPC_SECRET=EJPRnOcjAoKxAShyBTdeDX4GSHRUX4FzuIJKohTEw10=
|
||||
- DRONE_SERVER_HOST=localhost:3002
|
||||
- DRONE_SERVER_PROTO=http
|
||||
- DRONE_SERVER_PORT=:3002
|
||||
ports:
|
||||
- "3002:3002"
|
||||
|
||||
runner:
|
||||
image: drone/drone-runner-docker:1
|
||||
container_name: runner
|
||||
network_mode: host
|
||||
restart: always
|
||||
environment:
|
||||
- DRONE_RPC_PROTO=http
|
||||
- DRONE_RPC_HOST=localhost:3002
|
||||
- DRONE_RPC_SECRET=EJPRnOcjAoKxAShyBTdeDX4GSHRUX4FzuIJKohTEw10=
|
||||
- DRONE_RUNNER_CAPACITY=1
|
||||
- DRONE_RUNNER_NAME=dummy
|
||||
- DRONE_HTTP_BIND=3003
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
|
|
Loading…
Reference in a new issue