This commit is contained in:
parent
5447178b28
commit
36ced97f9f
1
.dockerignore
Normal file
1
.dockerignore
Normal file
|
@ -0,0 +1 @@
|
|||
target/
|
25
.drone.yml
Normal file
25
.drone.yml
Normal file
|
@ -0,0 +1,25 @@
|
|||
---
|
||||
kind: pipeline
|
||||
type: kubernetes
|
||||
name: Build Docker image
|
||||
|
||||
trigger:
|
||||
branch:
|
||||
- main
|
||||
event:
|
||||
exclude:
|
||||
- pull_request
|
||||
|
||||
steps:
|
||||
- name: kaniko
|
||||
image: plugins/kaniko
|
||||
settings:
|
||||
enable_cache: true
|
||||
username:
|
||||
from_secret: REGISTRY_USER
|
||||
password:
|
||||
from_secret: REGISTRY_PASSWORD
|
||||
registry: https://registry.asraphiel.dev/
|
||||
repo: registry.asraphiel.dev/library/pinbot-rs
|
||||
tags: ${DRONE_COMMIT_BRANCH}
|
||||
|
21
Dockerfile
Normal file
21
Dockerfile
Normal file
|
@ -0,0 +1,21 @@
|
|||
from rust:1.61.0-alpine as builder
|
||||
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN cargo init
|
||||
COPY Cargo.* /app/
|
||||
RUN cargo fetch
|
||||
|
||||
RUN apk add --no-cache musl-dev
|
||||
RUN cargo build --release
|
||||
|
||||
COPY src /app/src
|
||||
|
||||
RUN cargo build --release
|
||||
|
||||
from alpine as runtime
|
||||
|
||||
COPY --from=builder /app/target/release/pinbot-rs /app/pinbot-rs
|
||||
|
||||
CMD ["/app/pinbot-rs"]
|
|
@ -23,7 +23,7 @@ impl EventHandler for Handler {
|
|||
let emoji = r.emoji.as_data();
|
||||
if emoji == "📌" {
|
||||
let msg = r.message(c.http.clone()).await.expect("Could not find message");
|
||||
for r in msg.reactions.iter() {
|
||||
for r in &msg.reactions {
|
||||
let emoji = r.reaction_type.as_data();
|
||||
if emoji == "📌" {
|
||||
let count = r.count;
|
||||
|
@ -39,7 +39,7 @@ impl EventHandler for Handler {
|
|||
let emoji = r.emoji.as_data();
|
||||
if emoji == "📌" {
|
||||
let msg = r.message(&c.http).await.expect("Could not find message");
|
||||
for r in msg.reactions.iter() {
|
||||
for r in &msg.reactions {
|
||||
let emoji = r.reaction_type.as_data();
|
||||
if emoji == "📌" {
|
||||
let count = r.count;
|
||||
|
|
Loading…
Reference in a new issue