Version 0.1.0
continuous-integration/drone/push Build is passing Details

main
Julius 2022-06-24 17:23:37 +02:00
parent 5447178b28
commit 36ced97f9f
Signed by: j00lz
GPG Key ID: AF241B0AA237BBA2
4 changed files with 49 additions and 2 deletions

1
.dockerignore Normal file
View File

@ -0,0 +1 @@
target/

25
.drone.yml Normal file
View 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
View 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"]

View File

@ -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;