From a077d70598ecca837ffcf3f217f441e841b78d4a Mon Sep 17 00:00:00 2001 From: Bryson Steck Date: Sun, 16 Mar 2025 21:05:33 -0600 Subject: [PATCH] bump version, add notices, update build script --- Cargo.lock | 2 +- Cargo.toml | 2 +- build | 12 ++++++++---- package.Dockerfile | 5 +++++ src/common.rs | 8 ++++++++ src/config.rs | 8 ++++++++ src/main.rs | 8 ++++++++ src/refractr.rs | 8 ++++++++ 8 files changed, 47 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b2dd846..d094656 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -574,7 +574,7 @@ dependencies = [ [[package]] name = "refractr" -version = "0.4.0" +version = "0.5.0" dependencies = [ "clap", "colored", diff --git a/Cargo.toml b/Cargo.toml index 696e7f6..38dac2a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "refractr" license = "MPL-2.0" -version = "0.4.0" +version = "0.5.0" edition = "2021" [dependencies] diff --git a/build b/build index 7696eae..3877965 100755 --- a/build +++ b/build @@ -8,11 +8,15 @@ cargo update cargo clean # docker builds -docker build -t refractr:$version --build-arg UID=$uid --build-arg GID=$gid -f package.Dockerfile . +docker build -t refractr:$version --build-arg UID=$uid --build-arg GID=$gid --build-arg VERSION=$version -f package.Dockerfile . docker tag refractr:$version refractr:latest -docker tag refractr:$version git.brysonsteck.xyz/brysonsteck/refractr:latest -docker tag refractr:$version git.brysonsteck.xyz/brysonsteck/refractr:$version -test "$1" = "push" && docker push -a git.brysonsteck.xyz/brysonsteck/refractr +if test "$1" = "push"; then + docker tag refractr:$version git.brysonsteck.xyz/brysonsteck/refractr:latest + docker tag refractr:$version git.brysonsteck.xyz/brysonsteck/refractr:$version + docker push -a git.brysonsteck.xyz/brysonsteck/refractr + docker image rm git.brysonsteck.xyz/brysonsteck/refractr:latest + docker image rm git.brysonsteck.xyz/brysonsteck/refractr:$version +fi # rust build cargo build diff --git a/package.Dockerfile b/package.Dockerfile index b21fddc..d921a3d 100644 --- a/package.Dockerfile +++ b/package.Dockerfile @@ -1,8 +1,13 @@ FROM rust:slim ARG UID="1000" ARG GID="1000" +ARG VERSION ENV REFRACTR_DOCKER="true" +LABEL org.opencontainers.image.authors="me@brysonsteck.xyz" +LABEL version="${VERSION}" +LABEL license="MPL-2.0" + WORKDIR /usr/src/refractr COPY . . diff --git a/src/common.rs b/src/common.rs index aef15f4..aa5da26 100644 --- a/src/common.rs +++ b/src/common.rs @@ -1,3 +1,11 @@ +/* + * Copyright 2025 Bryson Steck + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ + use colored::Colorize; pub enum ExitCode { diff --git a/src/config.rs b/src/config.rs index 87bc1a1..747f6e9 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1,3 +1,11 @@ +/* + * Copyright 2025 Bryson Steck + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ + use crate::common; use crate::refractr::Refractr; diff --git a/src/main.rs b/src/main.rs index d141f2c..9d0048c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,11 @@ +/* + * Copyright 2025 Bryson Steck + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ + mod common; mod config; mod refractr; diff --git a/src/refractr.rs b/src/refractr.rs index 254ec53..5851ba7 100644 --- a/src/refractr.rs +++ b/src/refractr.rs @@ -1,3 +1,11 @@ +/* + * Copyright 2025 Bryson Steck + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ + use crate::common::{self, ReturnData, ExitCode}; use crate::config::{Config, ConfigFile};