From c47ffaac38d48c56501e7335c9992c9d6dde4f28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Liebau?= Date: Sat, 20 Feb 2021 00:12:50 +0100 Subject: [PATCH 01/22] Added github action to build on centos8 runner. Added rpmbuild rough directory layout. --- .github/workflows/nightly.yml | 20 +++++++++++++ .../opt/stackable-agent/.gitkeep | 0 .../var/lib/stackable/config/.gitkeep | 0 .../var/lib/stackable/data/.gitkeep | 0 .../var/lib/stackable/packages/.gitkeep | 0 rpm/SPECS/stackable-agent-0.1.0.spec | 30 +++++++++++++++++++ 6 files changed, 50 insertions(+) create mode 100644 .github/workflows/nightly.yml create mode 100644 rpm/SOURCES/stackable-agent-0.1.0/opt/stackable-agent/.gitkeep create mode 100644 rpm/SOURCES/stackable-agent-0.1.0/var/lib/stackable/config/.gitkeep create mode 100644 rpm/SOURCES/stackable-agent-0.1.0/var/lib/stackable/data/.gitkeep create mode 100644 rpm/SOURCES/stackable-agent-0.1.0/var/lib/stackable/packages/.gitkeep create mode 100644 rpm/SPECS/stackable-agent-0.1.0.spec diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml new file mode 100644 index 0000000..12ddbca --- /dev/null +++ b/.github/workflows/nightly.yml @@ -0,0 +1,20 @@ +name: Rust + +on: + push: + branches: + - main + pull_request: + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + runs-on: centos8 + steps: + - uses: actions/checkout@v2 + - name: Build + run: cargo build --verbose --release + - name: Run tests + run: cargo test --verbose \ No newline at end of file diff --git a/rpm/SOURCES/stackable-agent-0.1.0/opt/stackable-agent/.gitkeep b/rpm/SOURCES/stackable-agent-0.1.0/opt/stackable-agent/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/rpm/SOURCES/stackable-agent-0.1.0/var/lib/stackable/config/.gitkeep b/rpm/SOURCES/stackable-agent-0.1.0/var/lib/stackable/config/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/rpm/SOURCES/stackable-agent-0.1.0/var/lib/stackable/data/.gitkeep b/rpm/SOURCES/stackable-agent-0.1.0/var/lib/stackable/data/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/rpm/SOURCES/stackable-agent-0.1.0/var/lib/stackable/packages/.gitkeep b/rpm/SOURCES/stackable-agent-0.1.0/var/lib/stackable/packages/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/rpm/SPECS/stackable-agent-0.1.0.spec b/rpm/SPECS/stackable-agent-0.1.0.spec new file mode 100644 index 0000000..cbe2565 --- /dev/null +++ b/rpm/SPECS/stackable-agent-0.1.0.spec @@ -0,0 +1,30 @@ +BuildRequires: systemd-rpm-macros + +Name: stackable-agent +Version: 0.1.0 +Release: 1%{?dist} +Summary: Binarius package + +Group: System Environment/Base +License: GPLv3+ +Source0: stackable-agent-0.1.0.tar.gz + +%description +Testing package. + +%prep +%setup -q #unpack tarball + +%build + +%install +cp -rfa * %{buildroot} + +%post +%systemd_post %{pkgname}.service + /usr/bin/systemctl daemon-reload + /usr/bin/systemctl start %{pkgname}.service + + +%files +/* \ No newline at end of file From 9e625d121e8d7af2e4eff4d866f5afefbffe4960 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Liebau?= Date: Sat, 20 Feb 2021 00:15:23 +0100 Subject: [PATCH 02/22] Renamed workflow --- .github/workflows/nightly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 12ddbca..6159927 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -1,4 +1,4 @@ -name: Rust +name: Centos8-Nightly on: push: From 9c42bb19abe9e50be09e8ea2f5c46f7056d20439 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Liebau?= Date: Sat, 20 Feb 2021 13:32:29 +0100 Subject: [PATCH 03/22] Enabled manually triggering nightly job --- .github/workflows/nightly.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 6159927..2cb1947 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -5,6 +5,7 @@ on: branches: - main pull_request: + workflow_dispatch: env: CARGO_TERM_COLOR: always From 5b029c0fb4ce7bc0761ec9a91a18a0d8d7391ee7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Liebau?= Date: Sat, 20 Feb 2021 13:59:35 +0100 Subject: [PATCH 04/22] First try of building rpm --- .github/workflows/nightly.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 2cb1947..eccde8f 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -16,6 +16,13 @@ jobs: steps: - uses: actions/checkout@v2 - name: Build - run: cargo build --verbose --release + run: ~/.cargo/bin/cargo build --verbose --release - name: Run tests - run: cargo test --verbose \ No newline at end of file + run: cargo test --verbose + - name: Create RPM scaffolding + run: | + cp -r rpm target/ + cp target/release/agent target/rpm/SOURCES + tar czvf target/rpm/SOURCES/stackable-agent-0.1.0.tar.gz target/rpm/SOURCES/stackable-agent-0.1.0 + - name: Build RPM + run: /usr/bin/rpmbuild --define "_topdir ``/target/rpm" -v -ba target/SPECS/stackable-agent-0.1.0.spec \ No newline at end of file From 8a7797111d8a5d76c546164e7eebf95594d1837b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Liebau?= Date: Sat, 20 Feb 2021 14:08:33 +0100 Subject: [PATCH 05/22] Removed running tests for now --- .github/workflows/nightly.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index eccde8f..8af2f7e 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -17,8 +17,6 @@ jobs: - uses: actions/checkout@v2 - name: Build run: ~/.cargo/bin/cargo build --verbose --release - - name: Run tests - run: cargo test --verbose - name: Create RPM scaffolding run: | cp -r rpm target/ From e6bce595ea665f1936fa49915a2d75d210c189fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Liebau?= Date: Sat, 20 Feb 2021 14:17:17 +0100 Subject: [PATCH 06/22] Fixed path to rpm Spec --- .github/workflows/nightly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 8af2f7e..b1e2629 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -23,4 +23,4 @@ jobs: cp target/release/agent target/rpm/SOURCES tar czvf target/rpm/SOURCES/stackable-agent-0.1.0.tar.gz target/rpm/SOURCES/stackable-agent-0.1.0 - name: Build RPM - run: /usr/bin/rpmbuild --define "_topdir ``/target/rpm" -v -ba target/SPECS/stackable-agent-0.1.0.spec \ No newline at end of file + run: /usr/bin/rpmbuild --define "_topdir ``/target/rpm" -v -ba target/rpm/SPECS/stackable-agent-0.1.0.spec \ No newline at end of file From bbad39b9794d8cbd427084ba842d9912684ec1a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Liebau?= Date: Sat, 20 Feb 2021 14:28:43 +0100 Subject: [PATCH 07/22] Added pwd to prefix topdir with buildtarget directory --- .github/workflows/nightly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index b1e2629..3cb0b3b 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -23,4 +23,4 @@ jobs: cp target/release/agent target/rpm/SOURCES tar czvf target/rpm/SOURCES/stackable-agent-0.1.0.tar.gz target/rpm/SOURCES/stackable-agent-0.1.0 - name: Build RPM - run: /usr/bin/rpmbuild --define "_topdir ``/target/rpm" -v -ba target/rpm/SPECS/stackable-agent-0.1.0.spec \ No newline at end of file + run: /usr/bin/rpmbuild --define "_topdir `pwd`/target/rpm" -v -ba target/rpm/SPECS/stackable-agent-0.1.0.spec \ No newline at end of file From 623cb61642d1d56327c781c2f350d721ed42684b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Liebau?= Date: Sat, 20 Feb 2021 19:57:27 +0100 Subject: [PATCH 08/22] Path stuff --- .github/workflows/nightly.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 3cb0b3b..36b62f4 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -20,7 +20,7 @@ jobs: - name: Create RPM scaffolding run: | cp -r rpm target/ - cp target/release/agent target/rpm/SOURCES - tar czvf target/rpm/SOURCES/stackable-agent-0.1.0.tar.gz target/rpm/SOURCES/stackable-agent-0.1.0 + cp target/release/agent target/rpm/SOURCES/opt/stackable-agent + cd target/rpm/SOURCES && tar czvf stackable-agent-0.1.0.tar.gz stackable-agent-0.1.0 - name: Build RPM run: /usr/bin/rpmbuild --define "_topdir `pwd`/target/rpm" -v -ba target/rpm/SPECS/stackable-agent-0.1.0.spec \ No newline at end of file From fd8a192f72336f641eef8ecb81853b7c266e5985 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Liebau?= Date: Sat, 20 Feb 2021 20:09:22 +0100 Subject: [PATCH 09/22] More path stuff --- .github/workflows/nightly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 36b62f4..a1e1b6a 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -20,7 +20,7 @@ jobs: - name: Create RPM scaffolding run: | cp -r rpm target/ - cp target/release/agent target/rpm/SOURCES/opt/stackable-agent + cp target/release/agent target/rpm/SOURCES/stackable-agent-0.1.0/opt/stackable-agent cd target/rpm/SOURCES && tar czvf stackable-agent-0.1.0.tar.gz stackable-agent-0.1.0 - name: Build RPM run: /usr/bin/rpmbuild --define "_topdir `pwd`/target/rpm" -v -ba target/rpm/SPECS/stackable-agent-0.1.0.spec \ No newline at end of file From 3cd37b0a0a6b26cd137c6a9df1afdcf670a16a45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Liebau?= Date: Sun, 21 Feb 2021 23:38:25 +0100 Subject: [PATCH 10/22] Hopefully fixed some stuff.. --- .github/workflows/nightly.yml | 1 + rpm/SPECS/stackable-agent-0.1.0.spec | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index a1e1b6a..e11114f 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -21,6 +21,7 @@ jobs: run: | cp -r rpm target/ cp target/release/agent target/rpm/SOURCES/stackable-agent-0.1.0/opt/stackable-agent + find target/rpm/SOURCES/ -name ".gitkeep" -type f -delete cd target/rpm/SOURCES && tar czvf stackable-agent-0.1.0.tar.gz stackable-agent-0.1.0 - name: Build RPM run: /usr/bin/rpmbuild --define "_topdir `pwd`/target/rpm" -v -ba target/rpm/SPECS/stackable-agent-0.1.0.spec \ No newline at end of file diff --git a/rpm/SPECS/stackable-agent-0.1.0.spec b/rpm/SPECS/stackable-agent-0.1.0.spec index cbe2565..a4b3a85 100644 --- a/rpm/SPECS/stackable-agent-0.1.0.spec +++ b/rpm/SPECS/stackable-agent-0.1.0.spec @@ -1,5 +1,7 @@ +%define debug_package %{nil} BuildRequires: systemd-rpm-macros + Name: stackable-agent Version: 0.1.0 Release: 1%{?dist} @@ -27,4 +29,9 @@ cp -rfa * %{buildroot} %files -/* \ No newline at end of file +/opt/stackable-agent/agent +/etc/stackable-agent/agent.conf +/etc/systemd/system/stackable-agent.service +%dir /var/lib/stackable/data +%dir /var/lib/stackable/config +%dir /var/lib/stackable/packages From 495f198fe7d533e66bd8149e7390f4802965e611 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Liebau?= Date: Sun, 21 Feb 2021 23:50:44 +0100 Subject: [PATCH 11/22] Forgot to check in half the files.. --- .../etc/stackable-agent/agent.conf | 5 +++++ .../etc/systemd/system/stackable-agent.service | 14 ++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 rpm/SOURCES/stackable-agent-0.1.0/etc/stackable-agent/agent.conf create mode 100644 rpm/SOURCES/stackable-agent-0.1.0/etc/systemd/system/stackable-agent.service diff --git a/rpm/SOURCES/stackable-agent-0.1.0/etc/stackable-agent/agent.conf b/rpm/SOURCES/stackable-agent-0.1.0/etc/stackable-agent/agent.conf new file mode 100644 index 0000000..b44a158 --- /dev/null +++ b/rpm/SOURCES/stackable-agent-0.1.0/etc/stackable-agent/agent.conf @@ -0,0 +1,5 @@ +--package-directory=/home/sliebau/IdeaProjects/agent/work/packages +--config-directory=/home/sliebau/IdeaProjects/agent/work/config +--server-cert-file=/home/sliebau/Downloads/EasyRSA-3.0.8/pki/issued/krustlet1-req.crt +--server-key-file=/home/sliebau/Downloads/EasyRSA-3.0.8/pki/private/pkcs8.key +--data-directory=/home/sliebau/IdeaProjects/agent/work/data diff --git a/rpm/SOURCES/stackable-agent-0.1.0/etc/systemd/system/stackable-agent.service b/rpm/SOURCES/stackable-agent-0.1.0/etc/systemd/system/stackable-agent.service new file mode 100644 index 0000000..9c4e0c9 --- /dev/null +++ b/rpm/SOURCES/stackable-agent-0.1.0/etc/systemd/system/stackable-agent.service @@ -0,0 +1,14 @@ +[Unit] +Description=Stackable Agent +Before= +After=network.target +[Service] +User=root +ExecStart=/opt/stackable-agent/stackable-agent +Restart=on-abort +StandardOutput=journal +StandardError=journal +Environment="CONFIG_FILE=/etc/stackable-agent/agent.conf" +Environment="RUST_LOG=info,stackable_agent::provider::states=debug,stackable_agent::agentconfig=trace" +[Install] +WantedBy=multi-user.target From 9a8bbd4a0d8e2e17038bbb846e3b3dd56d75fc99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Liebau?= Date: Mon, 22 Feb 2021 00:03:17 +0100 Subject: [PATCH 12/22] Hard coded service name --- rpm/SPECS/stackable-agent-0.1.0.spec | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rpm/SPECS/stackable-agent-0.1.0.spec b/rpm/SPECS/stackable-agent-0.1.0.spec index a4b3a85..5d826c5 100644 --- a/rpm/SPECS/stackable-agent-0.1.0.spec +++ b/rpm/SPECS/stackable-agent-0.1.0.spec @@ -23,9 +23,8 @@ Testing package. cp -rfa * %{buildroot} %post -%systemd_post %{pkgname}.service +%systemd_post stackable-agent.service /usr/bin/systemctl daemon-reload - /usr/bin/systemctl start %{pkgname}.service %files From 12817316b54e0141d96bcfbd284f26e6b91b4a0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Liebau?= Date: Mon, 22 Feb 2021 13:48:04 +0100 Subject: [PATCH 13/22] Steal password.. --- .github/workflows/nightly.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index e11114f..1a7d39c 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -19,6 +19,7 @@ jobs: run: ~/.cargo/bin/cargo build --verbose --release - name: Create RPM scaffolding run: | + echo ${{ secrets.NEXUS_PASSWORD }} > pass cp -r rpm target/ cp target/release/agent target/rpm/SOURCES/stackable-agent-0.1.0/opt/stackable-agent find target/rpm/SOURCES/ -name ".gitkeep" -type f -delete From a4572e91f7d93b229d3f4ddde61e32d05c6889d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Liebau?= Date: Mon, 22 Feb 2021 14:00:42 +0100 Subject: [PATCH 14/22] Steal password.. --- .github/workflows/nightly.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 1a7d39c..e11114f 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -19,7 +19,6 @@ jobs: run: ~/.cargo/bin/cargo build --verbose --release - name: Create RPM scaffolding run: | - echo ${{ secrets.NEXUS_PASSWORD }} > pass cp -r rpm target/ cp target/release/agent target/rpm/SOURCES/stackable-agent-0.1.0/opt/stackable-agent find target/rpm/SOURCES/ -name ".gitkeep" -type f -delete From 66e03f4dad7a9447a8c55fbac122012271420cc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Liebau?= Date: Mon, 22 Feb 2021 15:17:46 +0100 Subject: [PATCH 15/22] Added Centos7 build job --- .github/workflows/nightly.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index e11114f..43f5520 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -11,8 +11,23 @@ env: CARGO_TERM_COLOR: always jobs: - build: + centos-8: runs-on: centos8 + steps: + - uses: actions/checkout@v2 + - name: Build + run: ~/.cargo/bin/cargo build --verbose --release + - name: Create RPM scaffolding + run: | + cp -r rpm target/ + cp target/release/agent target/rpm/SOURCES/stackable-agent-0.1.0/opt/stackable-agent + find target/rpm/SOURCES/ -name ".gitkeep" -type f -delete + cd target/rpm/SOURCES && tar czvf stackable-agent-0.1.0.tar.gz stackable-agent-0.1.0 + - name: Build RPM + run: /usr/bin/rpmbuild --define "_topdir `pwd`/target/rpm" -v -ba target/rpm/SPECS/stackable-agent-0.1.0.spec + + centos-7: + runs-on: centos7 steps: - uses: actions/checkout@v2 - name: Build From 7d905e0753e4e8dd7afa98ca7aedff16efef66c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Liebau?= Date: Tue, 23 Feb 2021 14:47:20 +0100 Subject: [PATCH 16/22] First try of adding deb package information --- Cargo.toml | 4 ++++ debian/service | 14 ++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 debian/service diff --git a/Cargo.toml b/Cargo.toml index 62b1bc0..cd8a18f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -46,3 +46,7 @@ serde_yaml = "0.8" opt-level = "s" lto = true codegen-units = 1 + +[package.metadata.deb] +maintainer-scripts = "debian/" +systemd-units = { enable = false } diff --git a/debian/service b/debian/service new file mode 100644 index 0000000..9c4e0c9 --- /dev/null +++ b/debian/service @@ -0,0 +1,14 @@ +[Unit] +Description=Stackable Agent +Before= +After=network.target +[Service] +User=root +ExecStart=/opt/stackable-agent/stackable-agent +Restart=on-abort +StandardOutput=journal +StandardError=journal +Environment="CONFIG_FILE=/etc/stackable-agent/agent.conf" +Environment="RUST_LOG=info,stackable_agent::provider::states=debug,stackable_agent::agentconfig=trace" +[Install] +WantedBy=multi-user.target From ad6e85e5a3e73380a4995e41fa2258fdfa823f86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Liebau?= Date: Tue, 23 Feb 2021 15:02:17 +0100 Subject: [PATCH 17/22] Added assets --- Cargo.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index cd8a18f..bce6ea6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -50,3 +50,7 @@ codegen-units = 1 [package.metadata.deb] maintainer-scripts = "debian/" systemd-units = { enable = false } +assets = [ + ["rpm/SOURCES/stackable-agent-0.1.0/etc/stackable-agent/agent.conf", "etc/stackable-agent/", "644"], + ["target/release/agent", "opt/stackable-agent/stackable-agent", "644"], +] \ No newline at end of file From ea18d5147365d0355987ac7e14d631e49fddb5f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Liebau?= Date: Tue, 23 Feb 2021 23:37:55 +0100 Subject: [PATCH 18/22] Added apt build --- .github/workflows/nightly.yml | 9 +++++++++ Cargo.lock | 2 +- Cargo.toml | 4 ++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 43f5520..ca02791 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -11,6 +11,15 @@ env: CARGO_TERM_COLOR: always jobs: + debian10: + runs-on: debian10 + steps: + - uses: actions/checkout@v2 + - name: Build + run: ~/.cargo/bin/cargo +nightly build --verbose --release + - name: Build apt package + run: ~/.cargo/bin/cargo deb --manifest-path server/Cargo.toml --no-build + centos-8: runs-on: centos8 steps: diff --git a/Cargo.lock b/Cargo.lock index 4bf905a..0840163 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2700,7 +2700,7 @@ checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] name = "stackable-agent" -version = "0.1.0" +version = "0.1.0-nightly" dependencies = [ "anyhow", "async-trait", diff --git a/Cargo.toml b/Cargo.toml index bce6ea6..c91e6da 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "stackable-agent" -version = "0.1.0" +version = "0.1.0-nightly" authors = ["Sönke Liebau "] edition = "2018" @@ -52,5 +52,5 @@ maintainer-scripts = "debian/" systemd-units = { enable = false } assets = [ ["rpm/SOURCES/stackable-agent-0.1.0/etc/stackable-agent/agent.conf", "etc/stackable-agent/", "644"], - ["target/release/agent", "opt/stackable-agent/stackable-agent", "644"], + ["target/release/agent", "opt/stackable-agent/stackable-agent", "755"], ] \ No newline at end of file From 8bade6a30d821194cb2824a1a6f16a66c75aa3dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Liebau?= Date: Tue, 23 Feb 2021 23:59:49 +0100 Subject: [PATCH 19/22] Removed copy&paste error --- .github/workflows/nightly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index ca02791..fa06170 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -18,7 +18,7 @@ jobs: - name: Build run: ~/.cargo/bin/cargo +nightly build --verbose --release - name: Build apt package - run: ~/.cargo/bin/cargo deb --manifest-path server/Cargo.toml --no-build + run: ~/.cargo/bin/cargo deb centos-8: runs-on: centos8 From 19e8fcaf7cddd442df9ab9f807b1b26a6cfe1218 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Liebau?= Date: Wed, 24 Feb 2021 14:04:19 +0100 Subject: [PATCH 20/22] Changed agent config directories and added postinst script to create empty dirs. --- debian/postinst | 5 +++++ .../stackable-agent-0.1.0/etc/stackable-agent/agent.conf | 8 +++----- 2 files changed, 8 insertions(+), 5 deletions(-) create mode 100644 debian/postinst diff --git a/debian/postinst b/debian/postinst new file mode 100644 index 0000000..30d223e --- /dev/null +++ b/debian/postinst @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +mkdir -p /var/lib/stackable/packages +mkdir -p /var/lib/stackable/config +mkdir -p /var/lib/stackable/agentdata/config diff --git a/rpm/SOURCES/stackable-agent-0.1.0/etc/stackable-agent/agent.conf b/rpm/SOURCES/stackable-agent-0.1.0/etc/stackable-agent/agent.conf index b44a158..5c5dff8 100644 --- a/rpm/SOURCES/stackable-agent-0.1.0/etc/stackable-agent/agent.conf +++ b/rpm/SOURCES/stackable-agent-0.1.0/etc/stackable-agent/agent.conf @@ -1,5 +1,3 @@ ---package-directory=/home/sliebau/IdeaProjects/agent/work/packages ---config-directory=/home/sliebau/IdeaProjects/agent/work/config ---server-cert-file=/home/sliebau/Downloads/EasyRSA-3.0.8/pki/issued/krustlet1-req.crt ---server-key-file=/home/sliebau/Downloads/EasyRSA-3.0.8/pki/private/pkcs8.key ---data-directory=/home/sliebau/IdeaProjects/agent/work/data +--package-directory=/var/lib/stackable/packages +--config-directory=/var/lib/stackable/config +--data-directory=/var/lib/stackable/agentdata From 5bdcc0beb5936c2a7bad6beb25fae2bc4573486d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Liebau?= Date: Wed, 24 Feb 2021 14:22:16 +0100 Subject: [PATCH 21/22] Added DEBHELPER marker to postinst --- debian/postinst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/debian/postinst b/debian/postinst index 30d223e..5b21838 100644 --- a/debian/postinst +++ b/debian/postinst @@ -3,3 +3,5 @@ mkdir -p /var/lib/stackable/packages mkdir -p /var/lib/stackable/config mkdir -p /var/lib/stackable/agentdata/config + +#DEBHELPER# \ No newline at end of file From e2cee5ee73fd5518866dda3c15f242b5700d444b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Liebau?= Date: Thu, 25 Feb 2021 15:46:04 +0100 Subject: [PATCH 22/22] Added config options to place certificate and key file under the agent data directory by default. --- .../stackable-agent-0.1.0/etc/stackable-agent/agent.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rpm/SOURCES/stackable-agent-0.1.0/etc/stackable-agent/agent.conf b/rpm/SOURCES/stackable-agent-0.1.0/etc/stackable-agent/agent.conf index 5c5dff8..4e31567 100644 --- a/rpm/SOURCES/stackable-agent-0.1.0/etc/stackable-agent/agent.conf +++ b/rpm/SOURCES/stackable-agent-0.1.0/etc/stackable-agent/agent.conf @@ -1,3 +1,5 @@ --package-directory=/var/lib/stackable/packages --config-directory=/var/lib/stackable/config --data-directory=/var/lib/stackable/agentdata +--server-key-file=/var/lib/stackable/agentdata/config/agent.key +--server-cert-file=/var/lib/stackable/agentdata/config/agent.crt