aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Ammerlaan <andrewammerlaan@riseup.net>2021-04-02 09:23:09 +0200
committerAndrew Ammerlaan <andrewammerlaan@riseup.net>2021-04-02 11:52:30 +0200
commite19e4730a005e718d8b8617c07bafca7e4e68346 (patch)
treef8316914f929b5923a12169a1a21f619e2a9fff7
parent.github/workflows/repoman.yml: Use script to auto run the latest rm (diff)
downloadguru-e19e4730a005e718d8b8617c07bafca7e4e68346.tar.gz
guru-e19e4730a005e718d8b8617c07bafca7e4e68346.tar.bz2
guru-e19e4730a005e718d8b8617c07bafca7e4e68346.zip
.github/workflows/*: reduce code-duplication
Reduce code duplication by moving the ::gentoo setup part into a seperate script. This way only one file has to be edited when e.g. updating the profile to a new version Signed-off-by: Andrew Ammerlaan <andrewammerlaan@riseup.net>
-rw-r--r--.github/workflows/duplicates.yml6
-rw-r--r--.github/workflows/repoman.yml6
-rwxr-xr-xscripts/setup-master-gentoo.sh10
3 files changed, 12 insertions, 10 deletions
diff --git a/.github/workflows/duplicates.yml b/.github/workflows/duplicates.yml
index d143d718e..6240adef0 100644
--- a/.github/workflows/duplicates.yml
+++ b/.github/workflows/duplicates.yml
@@ -13,11 +13,7 @@ jobs:
- uses: actions/checkout@v2
- name: Setup master gentoo repository
run: |
- sudo mkdir -p /var/db/repos/gentoo /etc/portage /var/cache/distfiles
- wget -qO - "https://github.com/gentoo-mirror/gentoo/archive/master.tar.gz" | sudo tar xz -C /var/db/repos/gentoo --strip-components=1
- sudo wget "https://www.gentoo.org/dtd/metadata.dtd" -O /var/cache/distfiles/metadata.dtd
- sudo wget "https://gitweb.gentoo.org/proj/portage.git/plain/cnf/repos.conf" -O /etc/portage/repos.conf
- sudo ln -s /var/db/repos/gentoo/profiles/default/linux/amd64/17.1 /etc/portage/make.profile
+ ./scripts/setup-master-gentoo.sh
- name: Check for duplicates
run: |
./scripts/check-duplicates.sh
diff --git a/.github/workflows/repoman.yml b/.github/workflows/repoman.yml
index b229afc94..fa9cebb6f 100644
--- a/.github/workflows/repoman.yml
+++ b/.github/workflows/repoman.yml
@@ -13,11 +13,7 @@ jobs:
- uses: actions/checkout@v2
- name: Setup master gentoo repository
run: |
- sudo mkdir -p /var/db/repos/gentoo /etc/portage /var/cache/distfiles
- wget -qO - "https://github.com/gentoo-mirror/gentoo/archive/master.tar.gz" | sudo tar xz -C /var/db/repos/gentoo --strip-components=1
- sudo wget "https://www.gentoo.org/dtd/metadata.dtd" -O /var/cache/distfiles/metadata.dtd
- sudo wget "https://gitweb.gentoo.org/proj/portage.git/plain/cnf/repos.conf" -O /etc/portage/repos.conf
- sudo ln -s /var/db/repos/gentoo/profiles/default/linux/amd64/17.1 /etc/portage/make.profile
+ ./scripts/setup-master-gentoo.sh
- name: Setup and run Repoman
run: |
./scripts/setup-and-run-repoman.sh
diff --git a/scripts/setup-master-gentoo.sh b/scripts/setup-master-gentoo.sh
new file mode 100755
index 000000000..a2939721a
--- /dev/null
+++ b/scripts/setup-master-gentoo.sh
@@ -0,0 +1,10 @@
+#! /usr/bin/env bash
+# Maintainer: Andrew Ammerlaan <andrewammerlaan@riseup.net>
+#
+# Fetch and setup the latest ::gentoo
+
+sudo mkdir -p /var/db/repos/gentoo /etc/portage /var/cache/distfiles
+wget -qO - "https://github.com/gentoo-mirror/gentoo/archive/master.tar.gz" | sudo tar xz -C /var/db/repos/gentoo --strip-components=1
+sudo wget "https://www.gentoo.org/dtd/metadata.dtd" -O /var/cache/distfiles/metadata.dtd
+sudo wget "https://gitweb.gentoo.org/proj/portage.git/plain/cnf/repos.conf" -O /etc/portage/repos.conf
+sudo ln -s /var/db/repos/gentoo/profiles/default/linux/amd64/17.1 /etc/portage/make.profile