Skip to content

Commit

Permalink
Merge pull request #3 from RukuLab/dev
Browse files Browse the repository at this point in the history
Configured github actions
  • Loading branch information
Joker666 authored Jul 4, 2024
2 parents 614dc05 + 5e12ecb commit 02fd6cb
Show file tree
Hide file tree
Showing 10 changed files with 66 additions and 10 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/rust.yml → .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Rust
name: Build

on:
push:
Expand All @@ -15,8 +15,8 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
- uses: actions/checkout@v4
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
48 changes: 48 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Release

on:
push:
tags:
- "v*"

permissions: write-all

jobs:
create-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: taiki-e/create-gh-release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}

build-and-upload-assets:
needs: create-release
strategy:
matrix:
include:
- name: linux-amd64
target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- name: linux-arm64
target: aarch64-unknown-linux-gnu
os: ubuntu-latest
- name: macos-amd64
target: x86_64-apple-darwin
os: macos-latest
- name: macos-arm64
target: aarch64-apple-darwin
os: macos-latest
runs-on: ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Build and upload
uses: taiki-e/upload-rust-binary-action@v1
with:
bin: ${{ github.event.repository.name }}
target: ${{ matrix.target }}
archive: $bin-${{ matrix.name }}
token: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<img width="894" alt="Screenshot 2024-07-05 at 3 47 14 AM" src="https://github.com/RukuLab/ruku/assets/3280322/1f37fca3-e87c-42f3-a6e8-795514390cd4">
Binary file added resources/1200x1200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/1696x1094.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/1788x756.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 4 additions & 2 deletions src/container.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ impl<'a> Container<'a> {
std::process::exit(1);
});
self.stop_and_remove(container_id).await;
} else {
self.log.error("No application is running");
}
}

Expand Down Expand Up @@ -131,14 +133,14 @@ impl<'a> Container<'a> {
platform: None,
};

let exposed_port = format!("{}/tcp", self.config.port);
let exposed_port = format!("{}/tcp", self.config.port.unwrap());
let mut host_config = HostConfig::default();
let mut port_bindings = PortMap::new();
port_bindings.insert(
exposed_port.clone(),
Some(vec![PortBinding {
host_ip: None,
host_port: Some(self.config.port.to_string()),
host_port: Some(self.config.port.unwrap().to_string()),
}]),
);
host_config.port_bindings = Some(port_bindings);
Expand Down
5 changes: 5 additions & 0 deletions src/deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ impl<'a> Deploy<'a> {
}

pub async fn run(&self) {
if self.config.port.is_none() {
self.log.error("No port specified, skipping deployment");
std::process::exit(1);
}

self.log.step(&format!("Running from {}", self.path));

// Nix pack
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ async fn main() {
}

let config = envy::from_env::<model::Config>().unwrap_or_else(|_| {
log.error("Ruku was unable to resolve the PORT environment variable");
log.error("Ruku was unable to resolve the environment variables");
std::process::exit(1);
});

Expand Down
2 changes: 1 addition & 1 deletion src/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use serde::Deserialize;

#[derive(Deserialize)]
pub struct Config {
pub port: u16,
pub port: Option<u16>,
pub name: Option<String>,
pub version: Option<String>,
}

0 comments on commit 02fd6cb

Please sign in to comment.