Change drone config to extract version in alpine container

This commit is contained in:
Harald Kube 2021-03-13 15:32:07 +01:00
parent 843fda81d1
commit 9633b7cca8

View file

@ -17,13 +17,13 @@ steps:
# - ls # - ls
# - ls target # - ls target
- name: build_test # - name: build_test
image: drone_rust:1.50-musl # image: drone_rust:1.50-musl
volumes: # volumes:
- name: target # - name: target
path: /drone/src/target # path: /drone/src/target
commands: # commands:
- cargo build --release # - cargo build --release
- name: run_test - name: run_test
image: drone_rust:1.50-musl image: drone_rust:1.50-musl
@ -40,25 +40,17 @@ steps:
path: /drone/src/target path: /drone/src/target
commands: commands:
- cargo build --release --target armv7-unknown-linux-musleabihf --features "rppal" - cargo build --release --target armv7-unknown-linux-musleabihf --features "rppal"
- grep '^version = ' Cargo.toml | cut -f2 -d\" > target/VERSION
when: when:
event: tag event: tag
- name: show_version - name: prepare_deployment
image: alpine image: alpine
volumes: volumes:
- name: target - name: target
path: /drone/src/target path: /drone/src/target
commands: commands:
# - grep '^version = ' Cargo.toml | cut -f2 -d\" > target/VERSION - grep '^version = ' Cargo.toml | cut -f2 -d\" > target/VERSION
- cat target/VERSION - cat target/VERSION
- name: bundle_deployment
image: alpine
volumes:
- name: target
path: /drone/src/target
commands:
- cp target/armv7-unknown-linux-musleabihf/release/s0_meter target/s0_meter-armhf-$(cat target/VERSION) - cp target/armv7-unknown-linux-musleabihf/release/s0_meter target/s0_meter-armhf-$(cat target/VERSION)
when: when:
event: tag event: tag