Skip to content

Commit

Permalink
Merge pull request rockcrafters#9 from vpa1977/add_push_rock_mojo
Browse files Browse the repository at this point in the history
feat: add push rock mojo
  • Loading branch information
vpa1977 authored Oct 9, 2024
2 parents b8c4f4d + 45eb64e commit a2f9f16
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rockcraft-maven/src/it/manual-create-rock-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<goals>
<goal>create-rock</goal>
<goal>build-rock</goal>
<goal>push-rock</goal>
</goals>
</execution>
</executions>
Expand All @@ -30,8 +31,8 @@
<jlink>false</jlink>
<summary>foo</summary>
<description>readme.txt</description>
<source>https://github.com/vpa1977/chisel-releases</source>
<branch>24.04-openjdk-17</branch>
<source>https://github.com/canonical/chisel-releases</source>
<branch>ubuntu-24.04</branch>
<architectures>
<architecture>amd64</architecture>
<architecture>arm64</architecture>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/**
* Copyright 2024 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.
* <p>
* 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/>.
*/
package com.canonical.rockcraft.maven;

import com.canonical.rockcraft.builder.RockBuilder;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;

import java.io.IOException;

@Mojo(name = "push-rock", threadSafe = false, requiresProject = true, defaultPhase = LifecyclePhase.INSTALL)
public class PushRockMojo extends AbstractRockMojo {
public void execute() throws MojoExecutionException {
super.execute();
try {
RockBuilder.pushRock(RockSettingsFactory.createRockProjectSettings(getProject()), getOptions());
} catch (InterruptedException | IOException e) {
throw new MojoExecutionException(e.getMessage(), e);
}
}
}

0 comments on commit a2f9f16

Please sign in to comment.