diff --git a/.drone.yml b/.drone.yml index cd6125e..eb79656 100644 --- a/.drone.yml +++ b/.drone.yml @@ -13,7 +13,7 @@ steps: - cd ui - npm install - npm run build - - cp -R ./build /app/dist + - cp -R ./build /app/ui - name: test @@ -23,10 +23,14 @@ steps: - cargo clippy - cargo test --all + - name: binary-deploy image: rust:latest + volumes: + - name: temp + path: /app commands: - - cp -R /app/dist ./ui/build + - cp -R /app/ui ./ui/build - cargo build --release - tar cvzf mailspy.tar.gz -C target/release mailspy - wget https://dl.min.io/client/mc/release/linux-amd64/mc @@ -40,6 +44,38 @@ steps: # - staging # - production +- name: build-musl + image: rust + volumes: + - name: temp + path: /app + commands: + - cp -R /app/ui ./ui/build + - rustup target add x86_64-unknown-linux-musl + - apt update && apt install -y musl-tools musl-dev + - update-ca-certificates + - cargo build --target x86_64-unknown-linux-musl --release + - mkdir /app/build + - cp target/x86_64-unknown-linux-musl/release/mailspy /app/build/mailspy + +- name: stage-deploy + image: plugins/docker + privileged: true + volumes: + - name: temp + path: /app + settings: + username: + from_secret: CONTAINER_USER + password: + from_secret: CONTAINER_PASSWORD + registry: git.5sigma.io + context: /app/build + repo: git.5sigma.io/mailspy/mailspy + tags: latest + + + volumes: - name: temp temp: {} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1dca783 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +FROM alpine:latest +COPY mailspy /app/mailspy +EXPOSE 8089 +WORKDIR app +EXPOSE 7777 +EXPOSE 7778 +CMD ./mailspy