vendor openssl
This commit is contained in:
5
.cargo/config.toml
Normal file
5
.cargo/config.toml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
[target.armv7-unknown-linux-gnueabihf]
|
||||||
|
linker = "arm-linux-gnueabihf-gcc"
|
||||||
|
|
||||||
|
[target.armv7-unknown-linux-musleabihf]
|
||||||
|
linker = "musl-gcc"
|
||||||
2
.dockerignore
Executable file
2
.dockerignore
Executable file
@ -0,0 +1,2 @@
|
|||||||
|
/target/
|
||||||
|
/.git/
|
||||||
64
.drone.yml
Normal file
64
.drone.yml
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: default
|
||||||
|
|
||||||
|
platform:
|
||||||
|
os: "linux"
|
||||||
|
arch: "arm"
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: "deps"
|
||||||
|
image: "rust:1.49"
|
||||||
|
volumes:
|
||||||
|
- name: "cache"
|
||||||
|
path: "/.target"
|
||||||
|
commands:
|
||||||
|
- "apt-get update"
|
||||||
|
- "apt-get install -yqq musl-tools make"
|
||||||
|
- "rustup target add armv7-unknown-linux-musleabihf"
|
||||||
|
- "cargo check"
|
||||||
|
- "cargo test"
|
||||||
|
- "cargo build --release --target=armv7-unknown-linux-musleabihf"
|
||||||
|
|
||||||
|
- name: "check"
|
||||||
|
image: "rust:1.49"
|
||||||
|
depends_on:
|
||||||
|
- "deps"
|
||||||
|
volumes:
|
||||||
|
- name: "cache"
|
||||||
|
path: "/.target"
|
||||||
|
commands:
|
||||||
|
- "cargo check"
|
||||||
|
|
||||||
|
- name: "test"
|
||||||
|
image: "rust:1.49"
|
||||||
|
depends_on:
|
||||||
|
- "deps"
|
||||||
|
volumes:
|
||||||
|
- name: "cache"
|
||||||
|
path: "/.target"
|
||||||
|
commands:
|
||||||
|
- "cargo test"
|
||||||
|
|
||||||
|
- name: "deploy"
|
||||||
|
image: "rust:1.49"
|
||||||
|
depends_on:
|
||||||
|
- "check"
|
||||||
|
- "test"
|
||||||
|
environment:
|
||||||
|
SSH_PK:
|
||||||
|
from_secret: SSH_PRIVATE_KEY
|
||||||
|
SSH_PARAMS: '-o StrictHostKeyChecking=no -o UserKnownHostsFile=/tmp/known_hosts'
|
||||||
|
TARGET_DIR: "./.target/armv7-unknown-linux-musleabihf/release"
|
||||||
|
commands:
|
||||||
|
- "mkdir /tmp/ssh 2>&1"
|
||||||
|
- "echo -n ${SSH_PK} | base64 -d > /tmp/ssh/deploy_key "
|
||||||
|
- "eval $(ssh-agent -s)"
|
||||||
|
- "chmod 600 /tmp/ssh/deploy_key"
|
||||||
|
- "ssh-add /tmp/ssh/deploy_key"
|
||||||
|
- "scp ${SSH_PARAMS} ${TARGET_DIR}/alterego ${SSH_USER}@${SSH_HOST}:/home/pi/alterego"
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
- name: "cache"
|
||||||
|
temp: {}
|
||||||
0
.gitignore
vendored
Normal file → Executable file
0
.gitignore
vendored
Normal file → Executable file
11
Cargo.lock
generated
Normal file → Executable file
11
Cargo.lock
generated
Normal file → Executable file
@ -16,6 +16,7 @@ dependencies = [
|
|||||||
"env_logger",
|
"env_logger",
|
||||||
"envconfig",
|
"envconfig",
|
||||||
"log",
|
"log",
|
||||||
|
"openssl",
|
||||||
"reqwest",
|
"reqwest",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
@ -723,6 +724,15 @@ version = "0.1.2"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de"
|
checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "openssl-src"
|
||||||
|
version = "111.13.0+1.1.1i"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "045e4dc48af57aad93d665885789b43222ae26f4886494da12d1ed58d309dcb6"
|
||||||
|
dependencies = [
|
||||||
|
"cc",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "openssl-sys"
|
name = "openssl-sys"
|
||||||
version = "0.9.58"
|
version = "0.9.58"
|
||||||
@ -732,6 +742,7 @@ dependencies = [
|
|||||||
"autocfg",
|
"autocfg",
|
||||||
"cc",
|
"cc",
|
||||||
"libc",
|
"libc",
|
||||||
|
"openssl-src",
|
||||||
"pkg-config",
|
"pkg-config",
|
||||||
"vcpkg",
|
"vcpkg",
|
||||||
]
|
]
|
||||||
|
|||||||
1
Cargo.toml
Normal file → Executable file
1
Cargo.toml
Normal file → Executable file
@ -17,3 +17,4 @@ uuid = { version = "0.8.1", features = ["v4"] }
|
|||||||
log = "0.4"
|
log = "0.4"
|
||||||
env_logger = "0.8.1"
|
env_logger = "0.8.1"
|
||||||
envconfig = "0.9.1"
|
envconfig = "0.9.1"
|
||||||
|
openssl = {version="*", features = ["vendored"]}
|
||||||
|
|||||||
7
Dockerfile
Executable file
7
Dockerfile
Executable file
@ -0,0 +1,7 @@
|
|||||||
|
FROM docker.io/rust:1.49
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install -yqq \
|
||||||
|
musl-tools \
|
||||||
|
make
|
||||||
|
|
||||||
|
RUN rustup target add armv7-unknown-linux-musleabihf
|
||||||
27
makefile
Executable file
27
makefile
Executable file
@ -0,0 +1,27 @@
|
|||||||
|
export DOCKER_BUILDKIT=1
|
||||||
|
|
||||||
|
DOCKERFLAGS:=-it --rm \
|
||||||
|
-v "${PWD}":"/app" \
|
||||||
|
--workdir "/app" \
|
||||||
|
-e "PWD=/app"
|
||||||
|
|
||||||
|
DOCKERIMG:="rust-build-env:V1"
|
||||||
|
|
||||||
|
image:
|
||||||
|
docker build -t rust-build-env:V1 .
|
||||||
|
.PHONY: image
|
||||||
|
|
||||||
|
ARM_PREFIX:=CARGO_TARGET_ARM_UNKNOWN_LINUX_MUSLEABIHF_LINKER=arm-linux-gnueabihf-ld \
|
||||||
|
REALGCC=arm-linux-gnueabihf-gcc-8 \
|
||||||
|
TARGET_CC=musl-gcc
|
||||||
|
|
||||||
|
build_debug_arm:
|
||||||
|
${ARM_PREFIX} cargo build --target=armv7-unknown-linux-musleabihf
|
||||||
|
.PHONY: build_debug_arm
|
||||||
|
|
||||||
|
build_release_arm:
|
||||||
|
docker run ${DOCKERFLAGS} ${DOCKERIMG} /bin/sh -c 'cargo build --release --target=armv7-unknown-linux-gnueabihf'
|
||||||
|
.PHONY: build_release_arm
|
||||||
|
|
||||||
|
docker_build_release_arm:
|
||||||
|
docker run ${DOCKERFLAGS} ${DOCKERIMG} make build_release_arm
|
||||||
2
src/main.rs
Normal file → Executable file
2
src/main.rs
Normal file → Executable file
@ -5,7 +5,7 @@ use teloxide::{prelude::*, utils::command::BotCommand};
|
|||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() {
|
async fn main() {
|
||||||
run().await
|
tokio::spawn(run()).await.unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Envconfig, Clone)]
|
#[derive(Envconfig, Clone)]
|
||||||
|
|||||||
Reference in New Issue
Block a user