mirror of https://github.com/chaos-mesh/toda.git
add auto release script
Signed-off-by: Yang Keao <keao.yang@yahoo.com>
This commit is contained in:
parent
23eb90d8e9
commit
1a16dde822
|
@ -1,3 +1,4 @@
|
||||||
target
|
target
|
||||||
.git
|
.git
|
||||||
Dockerfile
|
Dockerfile
|
||||||
|
example
|
|
@ -0,0 +1,40 @@
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
|
|
||||||
|
name: Create Release
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Create Release
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
make image-toda
|
||||||
|
CID=$(docker create <image-name>)
|
||||||
|
docker cp ${CID}:/toda /toda
|
||||||
|
tar -czvf /toda.tar.gz /toda
|
||||||
|
- name: Create Release
|
||||||
|
id: create_release
|
||||||
|
uses: actions/create-release@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
tag_name: ${{ github.ref }}
|
||||||
|
release_name: Release ${{ github.ref }}
|
||||||
|
draft: false
|
||||||
|
prerelease: false
|
||||||
|
- name: Upload Release Asset
|
||||||
|
id: upload-release-asset
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
asset_path: /toda.tar.gz
|
||||||
|
asset_name: toda-linux-amd64.tar.gz
|
||||||
|
asset_content_type: application/zip
|
29
Dockerfile
29
Dockerfile
|
@ -1,26 +1,33 @@
|
||||||
# syntax=docker/dockerfile:experimental
|
# syntax=docker/dockerfile:experimental
|
||||||
|
|
||||||
FROM ubuntu:20.04
|
FROM debian:buster-slim
|
||||||
|
|
||||||
|
ENV DEBIAN_FRONTEND noninteractive
|
||||||
|
|
||||||
ARG HTTPS_PROXY
|
ARG HTTPS_PROXY
|
||||||
ARG HTTP_PROXY
|
ARG HTTP_PROXY
|
||||||
|
|
||||||
ENV DEBIAN_FRONTEND noninteractive
|
ENV http_proxy $HTTP_PROXY
|
||||||
|
ENV https_proxy $HTTPS_PROXY
|
||||||
|
|
||||||
RUN apt-get update
|
RUN apt-get update && apt-get install build-essential curl git pkg-config libfuse-dev fuse -y && rm -rf /var/lib/apt/lists/*
|
||||||
RUN apt-get install libfuse-dev pkg-config fuse curl build-essential -y
|
|
||||||
RUN apt-get install gdb vim -y
|
|
||||||
|
|
||||||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain nightly-2020-07-01 -y
|
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain nightly-2020-07-01 -y
|
||||||
ENV PATH "/root/.cargo/bin:${PATH}"
|
ENV PATH "/root/.cargo/bin:${PATH}"
|
||||||
ENV RUSTFLAGS "-Z relro-level=full"
|
|
||||||
|
RUN if [ -n "$HTTP_PROXY" ]; then echo "[http]\n\
|
||||||
|
proxy = \"${HTTP_PROXY}\"\n\
|
||||||
|
"\
|
||||||
|
> /root/.cargo/config ; fi
|
||||||
|
|
||||||
|
COPY . /toda-build
|
||||||
|
|
||||||
WORKDIR /toda-build
|
WORKDIR /toda-build
|
||||||
|
|
||||||
COPY . .
|
ENV RUSTFLAGS "-Z relro-level=full"
|
||||||
|
RUN --mount=type=cache,target=/toda-build/target \
|
||||||
|
--mount=type=cache,target=/root/.cargo/registry \
|
||||||
|
cargo build --release
|
||||||
|
|
||||||
RUN --mount=type=cache,target=/toda-build/target \
|
RUN --mount=type=cache,target=/toda-build/target \
|
||||||
cargo build
|
cp /toda-build/target/release/toda /toda
|
||||||
|
|
||||||
RUN --mount=type=cache,target=/toda-build/target \
|
|
||||||
cp /toda-build/target/debug/toda /toda
|
|
3
Makefile
3
Makefile
|
@ -10,5 +10,8 @@ example: example-image volume
|
||||||
example-inject:debug-toda
|
example-inject:debug-toda
|
||||||
cat ./io-inject-example.json|sudo -E ./target/debug/toda --path /var/run/test --pid $$(pgrep main-app) --verbose trace
|
cat ./io-inject-example.json|sudo -E ./target/debug/toda --path /var/run/test --pid $$(pgrep main-app) --verbose trace
|
||||||
|
|
||||||
|
image-toda:
|
||||||
|
docker build --build-arg HTTP_PROXY=${HTTP_PROXY} --build-arg HTTPS_PROXY=${HTTPS_PROXY} . -t chaos-mesh/toda
|
||||||
|
|
||||||
debug-toda:
|
debug-toda:
|
||||||
RUSTFLAGS="-Z relro-level=full" cargo build
|
RUSTFLAGS="-Z relro-level=full" cargo build
|
||||||
|
|
Loading…
Reference in New Issue