diff --git a/.github/workflows/ansible_kira_restart.yml b/.github/workflows/ansible_kira_restart.yml index f1f3948ae..2a45c792f 100644 --- a/.github/workflows/ansible_kira_restart.yml +++ b/.github/workflows/ansible_kira_restart.yml @@ -15,6 +15,23 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 + + - name: ❓ Ensure Wrapper Permissions + run: chmod +x ./gradlew + + - name: ☕ Setup Java + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + + - name: 🐘 Gradle Build + uses: gradle/gradle-build-action@v2 + env: + CI: true + with: + arguments: ":ansible:build" + - name: Inject secrets run: 'echo "$SECRETS_YML" > variables/secrets.yml' shell: bash diff --git a/.github/workflows/ansible_ping.yml b/.github/workflows/ansible_ping.yml index 2ed6be0be..ff5499795 100644 --- a/.github/workflows/ansible_ping.yml +++ b/.github/workflows/ansible_ping.yml @@ -15,6 +15,23 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 + + - name: ❓ Ensure Wrapper Permissions + run: chmod +x ./gradlew + + - name: ☕ Setup Java + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + + - name: 🐘 Gradle Build + uses: gradle/gradle-build-action@v2 + env: + CI: true + with: + arguments: ":ansible:build" + - name: Inject secrets run: 'echo "$SECRETS_YML" > variables/secrets.yml' shell: bash diff --git a/.github/workflows/ansible_setup_server.yml b/.github/workflows/ansible_setup_server.yml index a9a47ce20..50b761472 100644 --- a/.github/workflows/ansible_setup_server.yml +++ b/.github/workflows/ansible_setup_server.yml @@ -15,6 +15,23 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 + + - name: ❓ Ensure Wrapper Permissions + run: chmod +x ./gradlew + + - name: ☕ Setup Java + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + + - name: 🐘 Gradle Build + uses: gradle/gradle-build-action@v2 + env: + CI: true + with: + arguments: ":ansible:build" + - name: Inject secrets run: 'echo "$SECRETS_YML" > variables/secrets.yml' shell: bash diff --git a/.github/workflows/ansible_start_server.yml b/.github/workflows/ansible_start_server.yml index 9fec35187..07d6d9b64 100644 --- a/.github/workflows/ansible_start_server.yml +++ b/.github/workflows/ansible_start_server.yml @@ -15,6 +15,23 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 + + - name: ❓ Ensure Wrapper Permissions + run: chmod +x ./gradlew + + - name: ☕ Setup Java + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + + - name: 🐘 Gradle Build + uses: gradle/gradle-build-action@v2 + env: + CI: true + with: + arguments: ":ansible:build" + - name: Inject secrets run: 'echo "$SECRETS_YML" > variables/secrets.yml' shell: bash diff --git a/.github/workflows/ansible_stop_server.yml b/.github/workflows/ansible_stop_server.yml index 5581f7372..55cddfc6f 100644 --- a/.github/workflows/ansible_stop_server.yml +++ b/.github/workflows/ansible_stop_server.yml @@ -15,6 +15,23 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 + + - name: ❓ Ensure Wrapper Permissions + run: chmod +x ./gradlew + + - name: ☕ Setup Java + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + + - name: 🐘 Gradle Build + uses: gradle/gradle-build-action@v2 + env: + CI: true + with: + arguments: ":ansible:build" + - name: Inject secrets run: 'echo "$SECRETS_YML" > variables/secrets.yml' shell: bash diff --git a/.github/workflows/ansible_update_server.yml b/.github/workflows/ansible_update_server.yml index 1be49e304..5ddefb5a5 100644 --- a/.github/workflows/ansible_update_server.yml +++ b/.github/workflows/ansible_update_server.yml @@ -15,6 +15,23 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 + + - name: ❓ Ensure Wrapper Permissions + run: chmod +x ./gradlew + + - name: ☕ Setup Java + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + + - name: 🐘 Gradle Build + uses: gradle/gradle-build-action@v2 + env: + CI: true + with: + arguments: ":ansible:build" + - name: Inject secrets run: 'echo "$SECRETS_YML" > variables/secrets.yml' shell: bash diff --git a/ansible/README.md b/ansible/README.md index 32e403710..993e2d18d 100644 --- a/ansible/README.md +++ b/ansible/README.md @@ -1,4 +1,5 @@ # CivAnsible +This project is a hybrid gradle/ansible project that is designed to provision and deploy services to a server. ## Prerequisites 1. Create a user on the server named `actions` with sudo privileges @@ -9,6 +10,10 @@ 3. Create a repo scoped secret with the contents of your secrets.yml called SECRETS_YML 4. Create an ansible inventory named after the environment +## Usage +1. Build dependencies with `gradle :ansible:build` +2. Use an ansible playbook with `ansible-playbook -i inventories/ playbooks/` + ## TODOs - Private Config - Mount backups location and configure params, setup diff --git a/ansible/build.gradle.kts b/ansible/build.gradle.kts new file mode 100644 index 000000000..5debb4412 --- /dev/null +++ b/ansible/build.gradle.kts @@ -0,0 +1,48 @@ +val paperPlugin by configurations.creating +val proxyPlugin by configurations.creating + +dependencies { + paperPlugin(project(path = ":plugins:banstick-paper", configuration = "reobf")) + paperPlugin(project(path = ":plugins:bastion-paper", configuration = "reobf")) + paperPlugin(project(path = ":plugins:citadel-paper", configuration = "reobf")) + paperPlugin(project(path = ":plugins:civchat2-paper", configuration = "reobf")) + paperPlugin(project(path = ":plugins:civduties-paper", configuration = "reobf")) + paperPlugin(project(path = ":plugins:civmodcore-paper", configuration = "reobf")) + paperPlugin(project(path = ":plugins:combattagplus-paper", configuration = "reobf")) + paperPlugin(project(path = ":plugins:essenceglue-paper", configuration = "reobf")) + paperPlugin(project(path = ":plugins:exilepearl-paper", configuration = "reobf")) + paperPlugin(project(path = ":plugins:factorymod-paper", configuration = "reobf")) + paperPlugin(project(path = ":plugins:finale-paper", configuration = "reobf")) + paperPlugin(project(path = ":plugins:hiddenore-paper", configuration = "reobf")) + paperPlugin(project(path = ":plugins:itemexchange-paper", configuration = "reobf")) + paperPlugin(project(path = ":plugins:jukealert-paper", configuration = "reobf")) + paperPlugin(project(path = ":plugins:kirabukkitgateway-paper", configuration = "reobf")) + paperPlugin(project(path = ":plugins:namecolors-paper", configuration = "reobf")) + paperPlugin(project(path = ":plugins:namelayer-paper", configuration = "reobf")) + paperPlugin(project(path = ":plugins:railswitch-paper", configuration = "reobf")) + paperPlugin(project(path = ":plugins:randomspawn-paper", configuration = "reobf")) + paperPlugin(project(path = ":plugins:realisticbiomes-paper", configuration = "reobf")) + paperPlugin(project(path = ":plugins:simpleadminhacks-paper", configuration = "reobf")) +} + +val copyPaperPlugins = tasks.register("copyPaperPlugins") { + dependsOn(paperPlugin) + + from("$projectDir/src/paper-plugins") + from(paperPlugin.resolvedConfiguration.resolvedArtifacts.map { it.file }) + into("$buildDir/paper-plugins") +} + +val copyProxyPlugins = tasks.register("copyProxyPlugins") { + dependsOn(proxyPlugin) + + from("$projectDir/src/proxy-plugins") + from(proxyPlugin.resolvedConfiguration.resolvedArtifacts.map { it.file }) + into("$buildDir/proxy-plugins") +} + +// TODO: Is build the right name? +tasks.register("build") { + dependsOn(copyPaperPlugins) + dependsOn(copyProxyPlugins) +} diff --git a/ansible/files/paper-plugins/CivDuties-paper-2.0.0-SNAPSHOT.jar b/ansible/files/paper-plugins/CivDuties-paper-2.0.0-SNAPSHOT.jar deleted file mode 100644 index f672aff3b..000000000 Binary files a/ansible/files/paper-plugins/CivDuties-paper-2.0.0-SNAPSHOT.jar and /dev/null differ diff --git a/ansible/files/paper-plugins/CombatTagPlus-paper-2.0.0-SNAPSHOT.jar b/ansible/files/paper-plugins/CombatTagPlus-paper-2.0.0-SNAPSHOT.jar deleted file mode 100644 index 29171060d..000000000 Binary files a/ansible/files/paper-plugins/CombatTagPlus-paper-2.0.0-SNAPSHOT.jar and /dev/null differ diff --git a/ansible/files/paper-plugins/EssenceGlue-paper-2.0.0-SNAPSHOT.jar b/ansible/files/paper-plugins/EssenceGlue-paper-2.0.0-SNAPSHOT.jar deleted file mode 100644 index 54811fa32..000000000 Binary files a/ansible/files/paper-plugins/EssenceGlue-paper-2.0.0-SNAPSHOT.jar and /dev/null differ diff --git a/ansible/files/paper-plugins/HiddenOre-paper-2.0.0-SNAPSHOT.jar b/ansible/files/paper-plugins/HiddenOre-paper-2.0.0-SNAPSHOT.jar deleted file mode 100644 index a7eebf524..000000000 Binary files a/ansible/files/paper-plugins/HiddenOre-paper-2.0.0-SNAPSHOT.jar and /dev/null differ diff --git a/ansible/files/paper-plugins/KiraBukkitGateway-2.0.1.jar b/ansible/files/paper-plugins/KiraBukkitGateway-2.0.1.jar deleted file mode 100644 index 4a61b4318..000000000 Binary files a/ansible/files/paper-plugins/KiraBukkitGateway-2.0.1.jar and /dev/null differ diff --git a/ansible/files/paper-plugins/NameColors-paper-2.0.0-SNAPSHOT.jar b/ansible/files/paper-plugins/NameColors-paper-2.0.0-SNAPSHOT.jar deleted file mode 100644 index 778ffa475..000000000 Binary files a/ansible/files/paper-plugins/NameColors-paper-2.0.0-SNAPSHOT.jar and /dev/null differ diff --git a/ansible/files/paper-plugins/RailSwitch-paper-2.0.0-SNAPSHOT.jar b/ansible/files/paper-plugins/RailSwitch-paper-2.0.0-SNAPSHOT.jar deleted file mode 100644 index ad562d882..000000000 Binary files a/ansible/files/paper-plugins/RailSwitch-paper-2.0.0-SNAPSHOT.jar and /dev/null differ diff --git a/ansible/files/paper-plugins/banstick-paper-2.0.1.jar b/ansible/files/paper-plugins/banstick-paper-2.0.1.jar deleted file mode 100644 index 9c75b1e31..000000000 Binary files a/ansible/files/paper-plugins/banstick-paper-2.0.1.jar and /dev/null differ diff --git a/ansible/files/paper-plugins/bastion-paper-3.0.1.jar b/ansible/files/paper-plugins/bastion-paper-3.0.1.jar deleted file mode 100644 index 8942ee984..000000000 Binary files a/ansible/files/paper-plugins/bastion-paper-3.0.1.jar and /dev/null differ diff --git a/ansible/files/paper-plugins/citadel-paper-5.2.4.jar b/ansible/files/paper-plugins/citadel-paper-5.2.4.jar deleted file mode 100644 index af9a406f5..000000000 Binary files a/ansible/files/paper-plugins/citadel-paper-5.2.4.jar and /dev/null differ diff --git a/ansible/files/paper-plugins/civchat2-paper-2.2.2.jar b/ansible/files/paper-plugins/civchat2-paper-2.2.2.jar deleted file mode 100644 index 7e05eb4a8..000000000 Binary files a/ansible/files/paper-plugins/civchat2-paper-2.2.2.jar and /dev/null differ diff --git a/ansible/files/paper-plugins/civmodcore-paper-3.0.6.jar b/ansible/files/paper-plugins/civmodcore-paper-3.0.6.jar deleted file mode 100644 index b74f34048..000000000 Binary files a/ansible/files/paper-plugins/civmodcore-paper-3.0.6.jar and /dev/null differ diff --git a/ansible/files/paper-plugins/exilepearl-paper-2.1.6.jar b/ansible/files/paper-plugins/exilepearl-paper-2.1.6.jar deleted file mode 100644 index d0b393988..000000000 Binary files a/ansible/files/paper-plugins/exilepearl-paper-2.1.6.jar and /dev/null differ diff --git a/ansible/files/paper-plugins/factorymod-paper-3.1.0.jar b/ansible/files/paper-plugins/factorymod-paper-3.1.0.jar deleted file mode 100644 index f823c73eb..000000000 Binary files a/ansible/files/paper-plugins/factorymod-paper-3.1.0.jar and /dev/null differ diff --git a/ansible/files/paper-plugins/finale-paper-2.1.0.jar b/ansible/files/paper-plugins/finale-paper-2.1.0.jar deleted file mode 100644 index 19cebcb02..000000000 Binary files a/ansible/files/paper-plugins/finale-paper-2.1.0.jar and /dev/null differ diff --git a/ansible/files/paper-plugins/itemexchange-paper-2.0.2.jar b/ansible/files/paper-plugins/itemexchange-paper-2.0.2.jar deleted file mode 100644 index 27fbb5b94..000000000 Binary files a/ansible/files/paper-plugins/itemexchange-paper-2.0.2.jar and /dev/null differ diff --git a/ansible/files/paper-plugins/jukealert-paper-3.0.8.jar b/ansible/files/paper-plugins/jukealert-paper-3.0.8.jar deleted file mode 100644 index 43a68bf4c..000000000 Binary files a/ansible/files/paper-plugins/jukealert-paper-3.0.8.jar and /dev/null differ diff --git a/ansible/files/paper-plugins/namelayer-paper-3.0.6.jar b/ansible/files/paper-plugins/namelayer-paper-3.0.6.jar deleted file mode 100644 index dca5929dc..000000000 Binary files a/ansible/files/paper-plugins/namelayer-paper-3.0.6.jar and /dev/null differ diff --git a/ansible/files/paper-plugins/randomspawn-paper-3.0.4.jar b/ansible/files/paper-plugins/randomspawn-paper-3.0.4.jar deleted file mode 100644 index e99da2b49..000000000 Binary files a/ansible/files/paper-plugins/randomspawn-paper-3.0.4.jar and /dev/null differ diff --git a/ansible/files/paper-plugins/realisticbiomes-paper-3.2.3.jar b/ansible/files/paper-plugins/realisticbiomes-paper-3.2.3.jar deleted file mode 100644 index 3493822b9..000000000 Binary files a/ansible/files/paper-plugins/realisticbiomes-paper-3.2.3.jar and /dev/null differ diff --git a/ansible/files/paper-plugins/simpleadminhacks-paper-2.3.2.jar b/ansible/files/paper-plugins/simpleadminhacks-paper-2.3.2.jar deleted file mode 100644 index 8578555ee..000000000 Binary files a/ansible/files/paper-plugins/simpleadminhacks-paper-2.3.2.jar and /dev/null differ diff --git a/ansible/inventories/civmc-Test.yml b/ansible/inventories/civmc-Test.yml index 0d735da68..8d939c665 100644 --- a/ansible/inventories/civmc-Test.yml +++ b/ansible/inventories/civmc-Test.yml @@ -2,7 +2,7 @@ all: hosts: civmc-test-1: ansible_host: 15.204.132.209 - ansible_user: actions + ansible_user: sound children: swarm_manager: hosts: diff --git a/ansible/playbooks/ping.yml b/ansible/playbooks/ping.yml index caff1a430..c6e1b85bc 100644 --- a/ansible/playbooks/ping.yml +++ b/ansible/playbooks/ping.yml @@ -2,6 +2,9 @@ hosts: all tasks: + - name: Ping | Include Preflight + include_tasks: ../tasks/preflight-checks.yml + - name: Configure | Expand setting include_tasks: ../tasks/expand-setting.yml diff --git a/ansible/playbooks/restart-kira.yml b/ansible/playbooks/restart-kira.yml index 6d97a0401..a69561838 100644 --- a/ansible/playbooks/restart-kira.yml +++ b/ansible/playbooks/restart-kira.yml @@ -3,6 +3,9 @@ become: true tasks: + - name: Restart Kira | Include Preflight + include_tasks: ../tasks/preflight-checks.yml + - name: Restart Kira | Expand setting include_tasks: ../tasks/expand-setting.yml diff --git a/ansible/playbooks/setup-server.yml b/ansible/playbooks/setup-server.yml index cc69d9b27..4f720d708 100644 --- a/ansible/playbooks/setup-server.yml +++ b/ansible/playbooks/setup-server.yml @@ -3,6 +3,9 @@ become: true tasks: + - name: Setup Server | Include Preflight + include_tasks: ../tasks/preflight-checks.yml + - name: Setup Server | Expand setting include_tasks: ../tasks/expand-setting.yml diff --git a/ansible/playbooks/start-server.yml b/ansible/playbooks/start-server.yml index 9075960a7..04c4c438d 100644 --- a/ansible/playbooks/start-server.yml +++ b/ansible/playbooks/start-server.yml @@ -3,6 +3,9 @@ become: true tasks: + - name: Start Server | Include Preflight + include_tasks: ../tasks/preflight-checks.yml + - name: Start Server | Expand setting include_tasks: ../tasks/expand-setting.yml diff --git a/ansible/playbooks/stop-server.yml b/ansible/playbooks/stop-server.yml index 29f652b95..dddedba7b 100644 --- a/ansible/playbooks/stop-server.yml +++ b/ansible/playbooks/stop-server.yml @@ -3,6 +3,9 @@ become: true tasks: + - name: Stop Server| Include Preflight + include_tasks: ../tasks/preflight-checks.yml + - name: Stop Server | Expand setting include_tasks: ../tasks/expand-setting.yml diff --git a/ansible/playbooks/update-server.yml b/ansible/playbooks/update-server.yml index 4958b506a..7fe6677b4 100644 --- a/ansible/playbooks/update-server.yml +++ b/ansible/playbooks/update-server.yml @@ -3,6 +3,9 @@ become: true tasks: + - name: Update Serer | Include Preflight + include_tasks: ../tasks/preflight-checks.yml + - name: Update Server | Expand setting include_tasks: ../tasks/expand-setting.yml diff --git a/ansible/files/paper-plugins/Brewery-3.1.1.jar b/ansible/src/paper-plugins/Brewery-3.1.1.jar similarity index 100% rename from ansible/files/paper-plugins/Brewery-3.1.1.jar rename to ansible/src/paper-plugins/Brewery-3.1.1.jar diff --git a/ansible/files/paper-plugins/CMILib-1.1.2.5.jar b/ansible/src/paper-plugins/CMILib-1.1.2.5.jar similarity index 100% rename from ansible/files/paper-plugins/CMILib-1.1.2.5.jar rename to ansible/src/paper-plugins/CMILib-1.1.2.5.jar diff --git a/ansible/files/paper-plugins/Chunky-1.2.164.jar b/ansible/src/paper-plugins/Chunky-1.2.164.jar similarity index 100% rename from ansible/files/paper-plugins/Chunky-1.2.164.jar rename to ansible/src/paper-plugins/Chunky-1.2.164.jar diff --git a/ansible/files/paper-plugins/ChunkyBorder-1.0.64.jar b/ansible/src/paper-plugins/ChunkyBorder-1.0.64.jar similarity index 100% rename from ansible/files/paper-plugins/ChunkyBorder-1.0.64.jar rename to ansible/src/paper-plugins/ChunkyBorder-1.0.64.jar diff --git a/ansible/files/paper-plugins/Clearlag-3.2.2.jar b/ansible/src/paper-plugins/Clearlag-3.2.2.jar similarity index 100% rename from ansible/files/paper-plugins/Clearlag-3.2.2.jar rename to ansible/src/paper-plugins/Clearlag-3.2.2.jar diff --git a/ansible/files/paper-plugins/CraftEnhance-2.4.3.jar b/ansible/src/paper-plugins/CraftEnhance-2.4.3.jar similarity index 100% rename from ansible/files/paper-plugins/CraftEnhance-2.4.3.jar rename to ansible/src/paper-plugins/CraftEnhance-2.4.3.jar diff --git a/ansible/files/paper-plugins/DiscordSRV-Build-1.26.1.jar b/ansible/src/paper-plugins/DiscordSRV-Build-1.26.1.jar similarity index 100% rename from ansible/files/paper-plugins/DiscordSRV-Build-1.26.1.jar rename to ansible/src/paper-plugins/DiscordSRV-Build-1.26.1.jar diff --git a/ansible/files/paper-plugins/Donum-paper-2.0.0-SNAPSHOT.jar b/ansible/src/paper-plugins/Donum-paper-2.0.0-SNAPSHOT.jar similarity index 100% rename from ansible/files/paper-plugins/Donum-paper-2.0.0-SNAPSHOT.jar rename to ansible/src/paper-plugins/Donum-paper-2.0.0-SNAPSHOT.jar diff --git a/ansible/files/paper-plugins/EntityDetection-1.2.0.jar b/ansible/src/paper-plugins/EntityDetection-1.2.0.jar similarity index 100% rename from ansible/files/paper-plugins/EntityDetection-1.2.0.jar rename to ansible/src/paper-plugins/EntityDetection-1.2.0.jar diff --git a/ansible/files/paper-plugins/GSit-1.4.9.jar b/ansible/src/paper-plugins/GSit-1.4.9.jar similarity index 100% rename from ansible/files/paper-plugins/GSit-1.4.9.jar rename to ansible/src/paper-plugins/GSit-1.4.9.jar diff --git a/ansible/files/paper-plugins/HolographicDisplays-3.0.0.b.3.jar b/ansible/src/paper-plugins/HolographicDisplays-3.0.0.b.3.jar similarity index 100% rename from ansible/files/paper-plugins/HolographicDisplays-3.0.0.b.3.jar rename to ansible/src/paper-plugins/HolographicDisplays-3.0.0.b.3.jar diff --git a/ansible/files/paper-plugins/Insights-6.11.0.jar b/ansible/src/paper-plugins/Insights-6.11.0.jar similarity index 100% rename from ansible/files/paper-plugins/Insights-6.11.0.jar rename to ansible/src/paper-plugins/Insights-6.11.0.jar diff --git a/ansible/files/paper-plugins/LuckPerms-5.4.0.jar b/ansible/src/paper-plugins/LuckPerms-5.4.0.jar similarity index 100% rename from ansible/files/paper-plugins/LuckPerms-5.4.0.jar rename to ansible/src/paper-plugins/LuckPerms-5.4.0.jar diff --git a/ansible/files/paper-plugins/MythicMobs-5.0.2.jar.disabled b/ansible/src/paper-plugins/MythicMobs-5.0.2.jar.disabled similarity index 100% rename from ansible/files/paper-plugins/MythicMobs-5.0.2.jar.disabled rename to ansible/src/paper-plugins/MythicMobs-5.0.2.jar.disabled diff --git a/ansible/files/paper-plugins/ProtocolLib-5.0.0.jar b/ansible/src/paper-plugins/ProtocolLib-5.0.0.jar similarity index 100% rename from ansible/files/paper-plugins/ProtocolLib-5.0.0.jar rename to ansible/src/paper-plugins/ProtocolLib-5.0.0.jar diff --git a/ansible/files/paper-plugins/SelectionVisualizer-3.1.1.1.jar b/ansible/src/paper-plugins/SelectionVisualizer-3.1.1.1.jar similarity index 100% rename from ansible/files/paper-plugins/SelectionVisualizer-3.1.1.1.jar rename to ansible/src/paper-plugins/SelectionVisualizer-3.1.1.1.jar diff --git a/ansible/files/paper-plugins/SuperVanish-6.2.7.jar b/ansible/src/paper-plugins/SuperVanish-6.2.7.jar similarity index 100% rename from ansible/files/paper-plugins/SuperVanish-6.2.7.jar rename to ansible/src/paper-plugins/SuperVanish-6.2.7.jar diff --git a/ansible/files/paper-plugins/TAB-3.1.1.jar b/ansible/src/paper-plugins/TAB-3.1.1.jar similarity index 100% rename from ansible/files/paper-plugins/TAB-3.1.1.jar rename to ansible/src/paper-plugins/TAB-3.1.1.jar diff --git a/ansible/files/paper-plugins/Terra-bukkit-6.0.0-BETA+834404c47-shaded.jar b/ansible/src/paper-plugins/Terra-bukkit-6.0.0-BETA+834404c47-shaded.jar similarity index 100% rename from ansible/files/paper-plugins/Terra-bukkit-6.0.0-BETA+834404c47-shaded.jar rename to ansible/src/paper-plugins/Terra-bukkit-6.0.0-BETA+834404c47-shaded.jar diff --git a/ansible/files/paper-plugins/Vault.jar b/ansible/src/paper-plugins/Vault.jar similarity index 100% rename from ansible/files/paper-plugins/Vault.jar rename to ansible/src/paper-plugins/Vault.jar diff --git a/ansible/files/paper-plugins/Votifier-2.7.3.jar b/ansible/src/paper-plugins/Votifier-2.7.3.jar similarity index 100% rename from ansible/files/paper-plugins/Votifier-2.7.3.jar rename to ansible/src/paper-plugins/Votifier-2.7.3.jar diff --git a/ansible/files/paper-plugins/aqua-1.1.1.jar b/ansible/src/paper-plugins/aqua-1.1.1.jar similarity index 100% rename from ansible/files/paper-plugins/aqua-1.1.1.jar rename to ansible/src/paper-plugins/aqua-1.1.1.jar diff --git a/ansible/files/paper-plugins/castlegates-paper-2.0.2.jar b/ansible/src/paper-plugins/castlegates-paper-2.0.2.jar similarity index 100% rename from ansible/files/paper-plugins/castlegates-paper-2.0.2.jar rename to ansible/src/paper-plugins/castlegates-paper-2.0.2.jar diff --git a/ansible/files/paper-plugins/even-more-fish-1.6.11.17.jar b/ansible/src/paper-plugins/even-more-fish-1.6.11.17.jar similarity index 100% rename from ansible/files/paper-plugins/even-more-fish-1.6.11.17.jar rename to ansible/src/paper-plugins/even-more-fish-1.6.11.17.jar diff --git a/ansible/files/paper-plugins/orebfuscator-5.2.6.jar b/ansible/src/paper-plugins/orebfuscator-5.2.6.jar similarity index 100% rename from ansible/files/paper-plugins/orebfuscator-5.2.6.jar rename to ansible/src/paper-plugins/orebfuscator-5.2.6.jar diff --git a/ansible/files/paper-plugins/spark-bukkit-1.8.14.jar b/ansible/src/paper-plugins/spark-bukkit-1.8.14.jar similarity index 100% rename from ansible/files/paper-plugins/spark-bukkit-1.8.14.jar rename to ansible/src/paper-plugins/spark-bukkit-1.8.14.jar diff --git a/ansible/files/paper-plugins/worldedit-7.2.10.jar b/ansible/src/paper-plugins/worldedit-7.2.10.jar similarity index 100% rename from ansible/files/paper-plugins/worldedit-7.2.10.jar rename to ansible/src/paper-plugins/worldedit-7.2.10.jar diff --git a/ansible/files/proxy-plugins/LuckPerms-Bungee-5.4.25.jar b/ansible/src/proxy-plugins/LuckPerms-Bungee-5.4.25.jar similarity index 100% rename from ansible/files/proxy-plugins/LuckPerms-Bungee-5.4.25.jar rename to ansible/src/proxy-plugins/LuckPerms-Bungee-5.4.25.jar diff --git a/ansible/files/proxy-plugins/ViaBackwards-4.7.0.jar b/ansible/src/proxy-plugins/ViaBackwards-4.7.0.jar similarity index 100% rename from ansible/files/proxy-plugins/ViaBackwards-4.7.0.jar rename to ansible/src/proxy-plugins/ViaBackwards-4.7.0.jar diff --git a/ansible/files/proxy-plugins/ViaVersion-4.7.0.jar b/ansible/src/proxy-plugins/ViaVersion-4.7.0.jar similarity index 100% rename from ansible/files/proxy-plugins/ViaVersion-4.7.0.jar rename to ansible/src/proxy-plugins/ViaVersion-4.7.0.jar diff --git a/ansible/tasks/deploy/stacks.yml b/ansible/tasks/deploy/stacks.yml index a9cfcbe09..af5fb2c50 100644 --- a/ansible/tasks/deploy/stacks.yml +++ b/ansible/tasks/deploy/stacks.yml @@ -52,9 +52,9 @@ dest: '/opt/stacks/{{item.target}}' loop: - { file: 'paper-config', target: 'minecraft', enabled: setting.minecraft.enabled } - - { file: 'paper-plugins', target: 'minecraft', enabled: setting.minecraft.enabled } + - { file: 'build/paper-plugins', target: 'minecraft', enabled: setting.minecraft.enabled } - { file: 'proxy-config', target: 'minecraft', enabled: setting.minecraft.enabled } - - { file: 'proxy-plugins', target: 'minecraft', enabled: setting.minecraft.enabled } + - { file: 'build/proxy-plugins', target: 'minecraft', enabled: setting.minecraft.enabled } - name: Deploy Stacks | Deploy Stacks when: diff --git a/ansible/tasks/preflight-checks.yml b/ansible/tasks/preflight-checks.yml new file mode 100644 index 000000000..0f405b499 --- /dev/null +++ b/ansible/tasks/preflight-checks.yml @@ -0,0 +1,19 @@ +- name: Preflight Checks | Check for secrets.yml + connection: local + stat: path=../variables/secrets.yml + register: secrets_yml + +- name: Preflight Checks | Fail if secrets.yml is missing + fail: + msg: "secrets.yml is missing, please create it by copying variables/secrets.example.yml" + when: not secrets_yml.stat.exists + +- name: Preflight Checks | Check for build dir + connection: local + stat: path=../build/ + register: build_dir + +- name: Preflight Checks | Fail if build dir is missing + fail: + msg: "build/ is missing, please create it by running `gradle :ansible:build`" + when: not build_dir.stat.exists diff --git a/build.gradle.kts b/build.gradle.kts index 2e8c3c20f..4b9301515 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,5 +1,4 @@ import com.gradle.enterprise.gradleplugin.GradleEnterpriseExtension -import xyz.jpenilla.runpaper.task.RunServer plugins { id("io.papermc.paperweight.userdev") version "1.5.10" apply false @@ -18,13 +17,8 @@ project.extensions.configure { } allprojects { - group = "net.civmc" - // TODO: We probably don't want to apply these to every project - apply(plugin = "java-library") - apply(plugin = "maven-publish") - repositories { mavenCentral() maven("https://oss.sonatype.org/content/repositories/snapshots") @@ -36,74 +30,4 @@ allprojects { maven("https://jitpack.io") } - - pluginManager.withPlugin("java-library") { - configure { - toolchain { - languageVersion.set(JavaLanguageVersion.of(17)) - } - withSourcesJar() - withJavadocJar() - } - - tasks.withType { - options.encoding = "UTF-8" - options.release = 17 - } - - tasks.withType { - filteringCharset = "UTF-8" - } - } - - - configure { - val githubActor = System.getenv("GITHUB_ACTOR") - val githubToken = System.getenv("GITHUB_TOKEN") - - repositories { - if (githubActor != null && githubToken != null) { - maven { - name = "GitHubPackages" - url = uri("https://maven.pkg.github.com/CivMC/Civ") - credentials { - username = githubActor - password = githubToken - } - } - } - } - - publications { - create("maven") { - from(components["java"]) - } - } - } - - tasks.withType { - minecraftVersion("1.18") - } - - pluginManager.withPlugin("io.papermc.paperweight.userdev") { - tasks.withType { - filesMatching("plugin.yml") { - expand(project.properties) - } - } - - tasks { - named("build") { - dependsOn("reobfJar") - } - } - } - - pluginManager.withPlugin("com.github.johnrengelman.shadow") { - tasks { - named("build") { - dependsOn("shadowJar") - } - } - } -} \ No newline at end of file +} diff --git a/plugins/build.gradle.kts b/plugins/build.gradle.kts new file mode 100644 index 000000000..a7ad2bd3b --- /dev/null +++ b/plugins/build.gradle.kts @@ -0,0 +1,73 @@ +import xyz.jpenilla.runpaper.task.RunServer + +subprojects { + apply(plugin = "java-library") + apply(plugin = "maven-publish") + + configure { + toolchain { + languageVersion.set(JavaLanguageVersion.of(17)) + } + withSourcesJar() + withJavadocJar() + } + + tasks.withType { + options.encoding = "UTF-8" + options.release = 17 + } + + tasks.withType { + filteringCharset = "UTF-8" + } + + configure { + val githubActor = System.getenv("GITHUB_ACTOR") + val githubToken = System.getenv("GITHUB_TOKEN") + + repositories { + if (githubActor != null && githubToken != null) { + maven { + name = "GitHubPackages" + url = uri("https://maven.pkg.github.com/CivMC/Civ") + credentials { + username = githubActor + password = githubToken + } + } + } + } + + publications { + create("maven") { + from(components["java"]) + } + } + } + + tasks.withType { + minecraftVersion("1.18") + } + + pluginManager.withPlugin("io.papermc.paperweight.userdev") { + tasks.withType { + filesMatching("plugin.yml") { + expand(project.properties) + } + } + + tasks { + named("build") { + dependsOn("reobfJar") + } + } + } + + pluginManager.withPlugin("com.github.johnrengelman.shadow") { + tasks { + named("build") { + dependsOn("shadowJar") + } + } + } +} diff --git a/settings.gradle.kts b/settings.gradle.kts index fa185588d..f7f359d1e 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -4,6 +4,8 @@ plugins { id("com.gradle.enterprise") version "3.16.2" } +include(":ansible") + include(":plugins:banstick-paper") include(":plugins:bastion-paper") include(":plugins:citadel-paper")