forked from rockcrafters/java-rockcraft-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request rockcrafters#7 from vpa1977/add_push_rock_task
feat: rock push task
- Loading branch information
Showing
4 changed files
with
93 additions
and
1 deletion.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
rockcraft-gradle/src/main/java/com/canonical/rockcraft/gradle/PushRockcraftTask.java
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,35 @@ | ||
package com.canonical.rockcraft.gradle; | ||
|
||
import com.canonical.rockcraft.builder.RockBuilder; | ||
import com.canonical.rockcraft.builder.RockcraftOptions; | ||
import org.gradle.api.tasks.TaskAction; | ||
|
||
import javax.inject.Inject; | ||
import java.io.IOException; | ||
|
||
/** | ||
* This task pushes rock image to the local docker | ||
*/ | ||
public class PushRockcraftTask extends AbstractRockcraftTask { | ||
|
||
/** | ||
* Constructs PushRockcraftTask | ||
* | ||
* @param options - rockcraft options | ||
*/ | ||
@Inject | ||
public PushRockcraftTask(RockcraftOptions options) { | ||
super(options); | ||
} | ||
|
||
/** | ||
* The task action | ||
* | ||
* @throws IOException - IO error while writing <i>rockcraft.yaml</i> | ||
* @throws InterruptedException - <i>rockcraft</i> process was aborted | ||
*/ | ||
@TaskAction | ||
public void pushRock() throws IOException, InterruptedException { | ||
RockBuilder.buildRock(RockSettingsFactory.createRockProjectSettings(getProject()), getOptions()); | ||
} | ||
} |
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