From 56cbb89999b1a8e886f357b9fe11aab3745ba64c Mon Sep 17 00:00:00 2001 From: Chris Reeder Date: Tue, 2 Apr 2024 23:37:25 +0000 Subject: [PATCH] gets build id from github --- .github/workflows/ci.yaml | 8 ++++---- ci/src/lib.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6f4f5a8..df60281 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -16,7 +16,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Use Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 21.7.1 @@ -65,20 +65,20 @@ jobs: image: rust:1.77.0 volumes: - /var/run/docker.sock + env: + BUILD_ID: ${{ github.job }}-${{ github.run_id }} steps: - uses: actions/checkout@v4 - name: Install Docker CLI run: | - # Add Docker's official GPG key: apt-get update apt-get install ca-certificates curl install -m 0755 -d /etc/apt/keyrings curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc chmod a+r /etc/apt/keyrings/docker.asc - # Add the repository to Apt sources: echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \ $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ @@ -88,4 +88,4 @@ jobs: apt-get install -y docker-ce-cli - name: Run CI - run: cargo run --bin ci -- build_images + run: cargo run --bin ci -- --all diff --git a/ci/src/lib.rs b/ci/src/lib.rs index f4d9d8f..e928b72 100644 --- a/ci/src/lib.rs +++ b/ci/src/lib.rs @@ -40,7 +40,7 @@ pub fn cmd(args: Cli) { return; } - let context = Context { id: "12345" }; + let context = Context { id: &std::env::var("BUILD_ID").unwrap() }; let config = Config { runner: Box::new(Docker{}), builder: Box::new(Docker{}),