Skip to content

Commit a5e1a57

Browse files
author
vsilent
committed
no console for prod build for now
1 parent 66a2d9a commit a5e1a57

4 files changed

Lines changed: 13 additions & 11 deletions

File tree

‎.github/workflows/docker.yml‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,11 @@ jobs:
9595
command: clippy
9696
args: -- -D warnings
9797

98-
- name: Run cargo build
98+
- name: Build server (release)
9999
uses: actions-rs/cargo@v1
100100
with:
101101
command: build
102-
args: --release
102+
args: --release --bin server
103103

104104
- name: npm install, build, and test
105105
working-directory: ./web
@@ -122,9 +122,9 @@ jobs:
122122
- name: Copy app files and zip
123123
run: |
124124
mkdir -p app/stacker/dist
125-
cp target/release/stacker app/stacker
126-
cp -a web/dist/. app/stacker
127-
cp docker/prod/Dockerfile app/Dockerfile
125+
cp target/release/server app/stacker/server
126+
cp -a web/dist/. app/stacker || true
127+
cp Dockerfile app/Dockerfile
128128
cd app
129129
touch .env
130130
tar -czvf ../app.tar.gz .

‎.github/workflows/rust.yml‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,11 @@ jobs:
6060
key: ${{ runner.os }}-target-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
6161
restore-keys: |
6262
${{ runner.os }}-target-${{ matrix.target }}-
63-
- name: Build (release)
64-
run: cargo build --release --target ${{ matrix.target }} --verbose
63+
- name: Build server (release)
64+
run: cargo build --release --target ${{ matrix.target }} --bin server --verbose
65+
66+
- name: Build console (release with features)
67+
run: cargo build --release --target ${{ matrix.target }} --bin console --features explain --verbose
6568
- name: Prepare binaries
6669
run: |
6770
mkdir -p artifacts

‎Dockerfile‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ COPY ./src ./src
3434
ENV SQLX_OFFLINE true
3535

3636
RUN apt-get update && apt-get install --no-install-recommends -y libssl-dev; \
37-
cargo build --bin=console --features="explain" && cargo build --release --features="explain"
37+
cargo build --release --bin server
3838

3939
#RUN ls -la /app/target/release/ >&2
4040

@@ -48,7 +48,6 @@ RUN mkdir ./files && chmod 0777 ./files
4848

4949
# copy binary and configuration files
5050
COPY --from=builder /app/target/release/server .
51-
COPY --from=builder /app/target/release/console .
5251
COPY --from=builder /app/.env .
5352
COPY --from=builder /app/configuration.yaml .
5453
COPY --from=builder /usr/local/cargo/bin/sqlx sqlx

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,14 @@ The core Project model includes:
6969
- Required headers: `X-Agent-Id`, `X-Timestamp`, `X-Request-Id`, `X-Agent-Signature`
7070
- Signature: base64(HMAC_SHA256(AGENT_TOKEN, raw_body_bytes))
7171
- Helper available: `helpers::AgentClient`
72-
- Base URL: set `AGENT_BASE_URL` to point Stacker at the target agent (e.g., `http://agent:8080`).
72+
- Base URL: set `AGENT_BASE_URL` to point Stacker at the target agent (e.g., `http://agent:5000`).
7373

7474
Example:
7575
```rust
7676
use stacker::helpers::AgentClient;
7777
use serde_json::json;
7878

79-
let client = AgentClient::new("http://agent:8080", agent_id, agent_token);
79+
let client = AgentClient::new("http://agent:5000", agent_id, agent_token);
8080
let payload = json!({"deployment_hash": dh, "type": "restart_service", "parameters": {"service": "web"}});
8181
let resp = client.commands_execute(&payload).await?;
8282
```

0 commit comments

Comments
 (0)