Skip to content

Commit 74c77b3

Browse files
authored
Merge pull request #106 from ecpullen/alpha-project
twoliter: Create a test project
2 parents 54e6a0d + 7bf1975 commit 74c77b3

File tree

28 files changed

+416
-0
lines changed

28 files changed

+416
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/.git
2+
/.gomodcache
3+
/build/*
4+
!/build/rpms/
5+
/build/rpms/*
6+
!/build/rpms/*.rpm
7+
/build/rpms/*-debuginfo-*.rpm
8+
/build/rpms/*-debugsource-*.rpm
9+
**/target/*
10+
/sbkeys

tests/projects/project1/.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/build/
2+
**/target/
3+
/.cargo/
4+
/.gomodcache/
5+
/keys/
6+
/roles/
7+
/sbkeys/
8+
Test.toml
9+
testsys.kubeconfig
10+
Infra.toml
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
version = "0.0.1"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
schema-version = 1
2+
3+
[sdk]
4+
registry = "twoliter.alpha"
5+
name = "bottlerocket-sdk"
6+
version = "latest"
7+
8+
[toolchain]
9+
registry = "public.ecr.aws/bottlerocket"
10+
name = "bottlerocket-toolchain"
11+
version = "v0.34.1"
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
use std::process::{exit, Command};
2+
3+
fn main() -> Result<(), std::io::Error> {
4+
let ret = Command::new("buildsys").arg("build-package").status()?;
5+
if !ret.success() {
6+
exit(1);
7+
}
8+
Ok(())
9+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[package]
2+
name = "hello-agent"
3+
version = "0.1.0"
4+
edition = "2021"
5+
publish = false
6+
build = "../build.rs"
7+
8+
[package.metadata.build-package]
9+
variant-sensitive = false
10+
source-groups = ["hello-agent"]
11+
12+
[lib]
13+
path = "../packages.rs"
14+
15+
# RPM BuildRequires
16+
[build-dependencies]
17+
# None
18+
19+
# RPM Requires
20+
[dependencies]
21+
# None
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[Unit]
2+
Description=Send a hello-agent Ping
3+
4+
[Service]
5+
Type=oneshot
6+
RemainAfterExit=false
7+
StandardError=journal+console
8+
ExecStart=/usr/bin/hello-agent
9+
TimeoutStartSec=30s
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
%global _cross_first_party 1
2+
%undefine _debugsource_packages
3+
4+
Name: %{_cross_os}hello-agent
5+
Version: 0.0
6+
Release: 0%{?dist}
7+
Summary: Hello-agent
8+
License: Apache-2.0 OR MIT
9+
URL: https://github.com/bottlerocket-os/bottlerocket
10+
11+
# sources < 100: misc
12+
13+
# 1xx sources: systemd units
14+
Source103: hello-agent.service
15+
Source104: hello-agent.timer
16+
17+
BuildRequires: %{_cross_os}glibc-devel
18+
19+
%description
20+
%{summary}.
21+
22+
%prep
23+
%setup -T -c
24+
%cargo_prep
25+
26+
%build
27+
mkdir bin
28+
29+
%cargo_build_static --manifest-path %{_builddir}/sources/Cargo.toml \
30+
-p hello-agent
31+
32+
%install
33+
install -d %{buildroot}%{_cross_bindir}
34+
install -p -m 0755 ${HOME}/.cache/.static/%{__cargo_target_static}/release/hello-agent %{buildroot}%{_cross_bindir}
35+
36+
install -d %{buildroot}%{_cross_unitdir}
37+
install -p -m 0644 \
38+
%{S:103} %{S:104} \
39+
%{buildroot}%{_cross_unitdir}
40+
41+
%files
42+
%{_cross_bindir}/hello-agent
43+
%{_cross_unitdir}/hello-agent.service
44+
%{_cross_unitdir}/hello-agent.timer
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[Unit]
2+
Description=Scheduled Hello-Agent Pings
3+
4+
[Timer]
5+
# Don't run missed executions
6+
Persistent=false
7+
# Run 5 seconds after startup
8+
OnStartupSec=5
9+
# Run every 5 sec thereafter
10+
OnUnitActiveSec=5
11+
# Don't fire at exactly the same second across machines started together.
12+
RandomizedDelaySec=1
13+
# We don't want to extend the startup report too long after the requested time.
14+
AccuracySec=1
15+
# File describing job to execute
16+
Unit=hello-agent.service
17+
18+
[Install]
19+
WantedBy=timers.target
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[package]
2+
name = "hello-go"
3+
version = "0.1.0"
4+
edition = "2021"
5+
publish = false
6+
build = "../build.rs"
7+
8+
[package.metadata.build-package]
9+
source-groups = ["hello-go"]
10+
11+
[lib]
12+
path = "../packages.rs"
13+
14+
# RPM BuildRequires
15+
[build-dependencies]
16+
# None
17+
18+
# RPM Requires
19+
[dependencies]
20+
# None

0 commit comments

Comments
 (0)