-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add the remote-build command (#769)
Fixes #766
- Loading branch information
Showing
9 changed files
with
86 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- | ||
# | ||
# Copyright 2023 Canonical Ltd. | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License version 3 as | ||
# published by the Free Software Foundation. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
"""Rockcraft Remote Build service.""" | ||
from craft_application.launchpad import RockRecipe | ||
from craft_application.services import RemoteBuildService | ||
|
||
|
||
class RockcraftRemoteBuildService(RemoteBuildService): | ||
"""Rockcraft Remote Build service.""" | ||
|
||
RecipeClass = RockRecipe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
summary: Test the remote builder | ||
manual: true | ||
kill-timeout: 30m | ||
|
||
environment: | ||
LAUNCHPAD_TOKEN: '$(HOST: echo "${LAUNCHPAD_TOKEN}")' | ||
|
||
prepare: | | ||
if [[ -z "$LAUNCHPAD_TOKEN" ]]; then | ||
echo "No credentials set in env LAUNCHPAD_TOKEN" | ||
exit 1 | ||
fi | ||
mkdir work | ||
cd work | ||
rockcraft init --name="remote-build" | ||
# commit the project | ||
git init | ||
git add rockcraft.yaml | ||
git commit -m "Initial Commit" | ||
# set up launchpad token | ||
CREDENTIALS_FILE="$HOME/.local/share/rockcraft/launchpad-credentials" | ||
mkdir -p "$(dirname "$CREDENTIALS_FILE")" | ||
echo -e "$LAUNCHPAD_TOKEN" >> "$CREDENTIALS_FILE" | ||
execute: | | ||
cd work | ||
rockcraft remote-build --launchpad-accept-public-upload | ||
# The rock | ||
test -f remote-build_0.1_amd64.rock | ||
# The build log | ||
test -f rockcraft-remote-build-*_amd64_*.txt | ||
restore: | | ||
rm -f ./work/*.rock ./work/*.txt |