|
| 1 | +project_name: deployer |
| 2 | +version: 7 |
| 3 | +ignore_files: |
| 4 | + - .*.kate-swp |
| 5 | + - .git |
| 6 | + - Cargo.lock |
| 7 | + - target |
| 8 | +cache_files: |
| 9 | + - Cargo.lock |
| 10 | + - target |
| 11 | +variables: |
| 12 | + build-artifact: |
| 13 | + is_secret: false |
| 14 | + value: |
| 15 | + type: plain |
| 16 | + value: target/release/depl |
| 17 | +actions: |
| 18 | + - info: cargo-fmt@0.1.0 |
| 19 | + exec_in_project_dir: true |
| 20 | + action: |
| 21 | + type: staged |
| 22 | + stage: build |
| 23 | + cmd: cargo fmt -- --config tab_spaces=2,max_width=120 */**/*.rs |
| 24 | + - info: cargo-install-by-copy@0.1.0 |
| 25 | + action: |
| 26 | + type: staged |
| 27 | + stage: build |
| 28 | + cmd: cp -f %bin% ~/.cargo/bin |
| 29 | + placeholders: |
| 30 | + - "%bin%" |
| 31 | + - info: cargo-lint@0.1.0 |
| 32 | + action: |
| 33 | + type: staged |
| 34 | + stage: build |
| 35 | + cmd: cargo clippy |
| 36 | + show_success_output: true |
| 37 | + - info: cargo-release@0.1.0 |
| 38 | + tags: |
| 39 | + - rust |
| 40 | + - cargo |
| 41 | + requirements: |
| 42 | + - type: exists_any |
| 43 | + paths: |
| 44 | + - /bin/cargo |
| 45 | + - ~/.cargo/bin/cargo |
| 46 | + action: |
| 47 | + type: staged |
| 48 | + stage: build |
| 49 | + cmd: cargo build --release |
| 50 | + - info: upx@0.1.0 |
| 51 | + requirements: |
| 52 | + - type: exists_any |
| 53 | + paths: |
| 54 | + - /bin/upx |
| 55 | + - /usr/bin/upx |
| 56 | + - ~/.local/bin/upx |
| 57 | + action: |
| 58 | + type: staged |
| 59 | + stage: build |
| 60 | + cmd: upx %af% |
| 61 | + placeholders: |
| 62 | + - "%af%" |
| 63 | +pipelines: |
| 64 | + - title: install |
| 65 | + info: deployer-install@0.1.0 |
| 66 | + default: true |
| 67 | + artifacts: |
| 68 | + - from: target/release/depl |
| 69 | + to: depl |
| 70 | + actions: |
| 71 | + - title: Lint |
| 72 | + used: cargo-lint@0.1.0 |
| 73 | + - title: Format |
| 74 | + used: cargo-fmt@0.1.0 |
| 75 | + - title: Build in release |
| 76 | + used: cargo-release@0.1.0 |
| 77 | + - title: Compress |
| 78 | + used: upx@0.1.0 |
| 79 | + with: |
| 80 | + "%af%": build-artifact |
| 81 | + - title: Install |
| 82 | + used: cargo-install-by-copy@0.1.0 |
| 83 | + with: |
| 84 | + "%bin%": build-artifact |
| 85 | + - title: ci |
| 86 | + info: deployer-ci@0.1.0 |
| 87 | + tags: |
| 88 | + - ci |
| 89 | + - gitlab |
| 90 | + - github |
| 91 | + gh_opts: |
| 92 | + on_push_branches: |
| 93 | + - stable |
| 94 | + - unstable |
| 95 | + on_pull_requests_branches: |
| 96 | + - unstable |
| 97 | + preflight_steps: |
| 98 | + - name: Install Rust Toolchain |
| 99 | + uses: actions-rust-lang/setup-rust-toolchain@v1 |
| 100 | + with: |
| 101 | + components: clippy |
| 102 | + target: x86_64-unknown-linux-gnu |
| 103 | + toolchain: nightly |
| 104 | + gl_opts: |
| 105 | + rules: |
| 106 | + - $CI_COMMIT_BRANCH == "unstable" |
| 107 | + - $CI_COMMIT_BRANCH == "stable" |
| 108 | + - $CI_PIPELINE_SOURCE == "merge_request_event" |
| 109 | + base_image: rust |
| 110 | + preflight_cmds: |
| 111 | + - rustup install nightly |
| 112 | + - rustup component add --toolchain nightly clippy |
| 113 | + exclusive_exec_tag: ci |
| 114 | + artifacts: |
| 115 | + - from: target/release/depl |
| 116 | + to: depl |
| 117 | + driver: shell |
| 118 | + actions: |
| 119 | + - title: Lint |
| 120 | + used: cargo-lint@0.1.0 |
| 121 | + - title: Build in release |
| 122 | + used: cargo-release@0.1.0 |
| 123 | + - title: ci-docker |
| 124 | + info: deployer-ci-docker@0.1.0 |
| 125 | + tags: |
| 126 | + - ci |
| 127 | + - docker |
| 128 | + containered_opts: |
| 129 | + preflight_cmds: |
| 130 | + - RUN apt-get update && apt-get install -y build-essential curl git && rm -rf /var/lib/apt/lists/* |
| 131 | + - RUN curl https://sh.rustup.rs -sSf | bash -s -- -y --profile minimal --default-toolchain nightly |
| 132 | + - ENV PATH="/root/.cargo/bin:${PATH}" |
| 133 | + - RUN rustup component add clippy |
| 134 | + cache_strategies: |
| 135 | + - fake_content: docker-fake-files@0.1.0 |
| 136 | + copy_cmds: |
| 137 | + - COPY rust-toolchain.toml . |
| 138 | + - COPY .docker-fake-files/rust/lib.rs src/lib.rs |
| 139 | + - COPY .docker-fake-files/rust/main.rs src/main.rs |
| 140 | + - COPY Cargo.toml . |
| 141 | + pre_cache_cmds: |
| 142 | + - DEPL |
| 143 | + - copy_cmds: |
| 144 | + - COPY src/ src/ |
| 145 | + - COPY DOCS.md . |
| 146 | + - COPY MIGRATIONS.md . |
| 147 | + pre_cache_cmds: |
| 148 | + - RUN touch src/main.rs |
| 149 | + - RUN touch src/lib.rs |
| 150 | + - DEPL |
| 151 | + use_containerd_local_storage_cache: true |
| 152 | + prevent_metadata_loading: true |
| 153 | + exclusive_exec_tag: ci-docker |
| 154 | + artifacts: |
| 155 | + - from: target/release/depl |
| 156 | + to: depl |
| 157 | + driver: shell |
| 158 | + actions: |
| 159 | + - title: Lint |
| 160 | + used: cargo-lint@0.1.0 |
| 161 | + - title: Build in release |
| 162 | + used: cargo-release@0.1.0 |
| 163 | + - title: ci-ansible |
| 164 | + info: deployer-ci-ansible@0.1.0 |
| 165 | + tags: |
| 166 | + - ci |
| 167 | + - docker |
| 168 | + ansible_opts: |
| 169 | + create_inventory: |
| 170 | + - localhost-test |
| 171 | + exclusive_exec_tag: ci-ansible |
| 172 | + artifacts: |
| 173 | + - from: target/release/depl |
| 174 | + to: depl |
| 175 | + driver: deployer |
| 176 | + actions: |
| 177 | + - title: Lint |
| 178 | + used: cargo-lint@0.1.0 |
| 179 | + - title: Build in release |
| 180 | + used: cargo-release@0.1.0 |
0 commit comments