feat: we don't always need to pull
Some checks failed
continuous-integration/drone/push Build is failing

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
Kasper Juul Hermansen 2024-03-30 15:51:46 +01:00
parent d60aa262de
commit e36baaae35
Signed by: kjuulh
GPG Key ID: 9AA7BC13CE474394
3 changed files with 17 additions and 15 deletions

8
Cargo.lock generated
View File

@ -307,7 +307,7 @@ dependencies = [
[[package]] [[package]]
name = "cuddle-ci" name = "cuddle-ci"
version = "0.2.0" version = "0.2.0"
source = "git+https://git.front.kjuulh.io/kjuulh/dagger-components?branch=main#4f15e5a88779b626f229c124b3d3df656a4597de" source = "git+https://git.front.kjuulh.io/kjuulh/dagger-components?branch=main#f4e7ced9d89ee1753c0cac12d77df9c20d135fab"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"chrono", "chrono",
@ -340,12 +340,12 @@ dependencies = [
[[package]] [[package]]
name = "dagger-components" name = "dagger-components"
version = "0.1.0" version = "0.1.0"
source = "git+https://git.front.kjuulh.io/kjuulh/dagger-components?branch=main#4f15e5a88779b626f229c124b3d3df656a4597de" source = "git+https://git.front.kjuulh.io/kjuulh/dagger-components?branch=main#f4e7ced9d89ee1753c0cac12d77df9c20d135fab"
[[package]] [[package]]
name = "dagger-cuddle-please" name = "dagger-cuddle-please"
version = "0.2.0" version = "0.2.0"
source = "git+https://git.front.kjuulh.io/kjuulh/dagger-components?branch=main#4f15e5a88779b626f229c124b3d3df656a4597de" source = "git+https://git.front.kjuulh.io/kjuulh/dagger-components?branch=main#f4e7ced9d89ee1753c0cac12d77df9c20d135fab"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"dagger-sdk", "dagger-sdk",
@ -355,7 +355,7 @@ dependencies = [
[[package]] [[package]]
name = "dagger-rust" name = "dagger-rust"
version = "0.2.0" version = "0.2.0"
source = "git+https://git.front.kjuulh.io/kjuulh/dagger-components?branch=main#4f15e5a88779b626f229c124b3d3df656a4597de" source = "git+https://git.front.kjuulh.io/kjuulh/dagger-components?branch=main#f4e7ced9d89ee1753c0cac12d77df9c20d135fab"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"dagger-sdk", "dagger-sdk",

View File

@ -1,10 +1,13 @@
use std::sync::Arc; use std::sync::Arc;
use cuddle_ci::drone_templater::DroneTemplater;
use cuddle_ci::rust_service::architecture::{Architecture, Os}; use cuddle_ci::rust_service::architecture::{Architecture, Os};
use cuddle_ci::rust_service::{extensions::*, RustService}; use cuddle_ci::rust_service::{extensions::*, RustService};
use cuddle_ci::{drone_templater, CuddleCI}; use cuddle_ci::{drone_templater, CuddleCI};
use tokio::sync::Mutex; use tokio::sync::Mutex;
const BIN_NAME: &str = "cuddle-rust-cli-plan";
#[tokio::main] #[tokio::main]
async fn main() -> eyre::Result<()> { async fn main() -> eyre::Result<()> {
let client = dagger_sdk::connect().await?; let client = dagger_sdk::connect().await?;
@ -27,16 +30,17 @@ async fn main() -> eyre::Result<()> {
.with_apt_ca_certificates() .with_apt_ca_certificates()
.with_crates(["ci", "crates/*"]) .with_crates(["ci", "crates/*"])
.with_mold("2.3.3") .with_mold("2.3.3")
.with_bin_name("cuddle-rust-cli-plan") .with_bin_name(BIN_NAME)
.with_deployment(false) .with_deployment(false)
.to_owned(); .to_owned();
let service = Arc::new(Mutex::new(service)); let service = Arc::new(Mutex::new(service));
let drone_templater = Arc::new(Mutex::new(drone_templater::DroneTemplater::new( let drone_templater = Arc::new(Mutex::new(
client, DroneTemplater::new(client, "templates/cuddle-rust-cli-plan.yaml")
"templates/cuddle-rust-cli-plan.yaml", .with_variable("bin_name", BIN_NAME)
))); .to_owned(),
));
CuddleCI::default() CuddleCI::default()
.with_pull_request(service.clone()) .with_pull_request(service.clone())

View File

@ -26,8 +26,7 @@ steps:
- chmod 700 ~/.ssh/config - chmod 700 ~/.ssh/config
- name: build pr - name: build pr
image: kasperhermansen/cuddle-rust-cli-plan:{{image_tag}} image: kasperhermansen/{{bin_name}}:{{image_tag}}
pull: always
volumes: volumes:
- name: ssh - name: ssh
path: /root/.ssh/ path: /root/.ssh/
@ -37,7 +36,7 @@ steps:
- echo "$DOCKER_PASSWORD" | docker login --password-stdin --username="$DOCKER_USERNAME" docker.io - echo "$DOCKER_PASSWORD" | docker login --password-stdin --username="$DOCKER_USERNAME" docker.io
- export CLUSTER=clank-dev - export CLUSTER=clank-dev
- cuddle --version - cuddle --version
- cuddle-rust-cli-plan pr - {{ bin_name }} pr
environment: environment:
DAGGER_CLOUD_TOKEN: DAGGER_CLOUD_TOKEN:
from_secret: dagger_cloud_token from_secret: dagger_cloud_token
@ -79,8 +78,7 @@ steps:
- "load_secret" - "load_secret"
- name: build main - name: build main
image: kasperhermansen/cuddle-rust-cli-plan:{{image_tag}} image: kasperhermansen/{{bin_name}}:{{image_tag}}
pull: always
volumes: volumes:
- name: ssh - name: ssh
path: /root/.ssh/ path: /root/.ssh/
@ -90,7 +88,7 @@ steps:
- echo "$DOCKER_PASSWORD" | docker login --password-stdin --username="$DOCKER_USERNAME" docker.io - echo "$DOCKER_PASSWORD" | docker login --password-stdin --username="$DOCKER_USERNAME" docker.io
- export CLUSTER=clank-prod - export CLUSTER=clank-prod
- cuddle --version - cuddle --version
- cuddle-rust-cli-plan main - {{ bin_name }} main
environment: environment:
DAGGER_CLOUD_TOKEN: DAGGER_CLOUD_TOKEN:
from_secret: dagger_cloud_token from_secret: dagger_cloud_token