Skip to content

Commit

Permalink
Adds various updates for use with the lagoon cli
Browse files Browse the repository at this point in the history
  • Loading branch information
CGoodwin90 committed May 1, 2024
1 parent b9f0c2c commit 13cebdd
Show file tree
Hide file tree
Showing 75 changed files with 3,153 additions and 87 deletions.
12 changes: 12 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Contributing

## Workflow
Pull Requests are welcome. In general, we follow the "fork-and-pull" Git workflow

1. **Fork** the repo on GitHub
2. **Clone** the project to your own machine
3. **Commit** changes to your own branch
4. **Push** your work back up to your fork
5. Submit a **Pull request** so that we can review your changes

NOTE: Be sure to merge the latest from "upstream" before making a pull request!.
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
# Lagoon API Machinery

Shared library/clients for use with Lagoon
Welcome to the Lagoon API Machinery repository.
This repo provides shared library/clients for use with Lagoon.

**Note: This project is currently under heavy development. Changes and updates are expected frequently.**

## Installation

To use Lagoon Machinery in your Go project, you can install it like any other Go library. Run the following command:

```sh
go get -u github.com/uselagoon/machinery
```

## Contributing

We welcome contributions from the community! If you'd like to contribute to the development of Machinery, please follow our [Contribution Guidelines](CONTRIBUTING.md).

## Feedback and Issues

If you encounter any issues with the API or have suggestions for improvements, please [open an issue](https://github.com/uselagoon/machinery/issues) on this repository.
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
mutation (
$project: String!,
$branch: String!,
$project: String!,
$branch: String!,
$branchRef: String,
$returnData: Boolean!) {
$returnData: Boolean!,
$buildVariables: [EnvKeyValueInput]) {
deployEnvironmentBranch(input: {
project:{
name: $project
}
branchName: $branch
branchRef: $branchRef
returnData: $returnData
buildVariables: $buildVariables
}
)
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
mutation (
$project: String!,
$sourceEnvironment: String!,
$project: String!,
$sourceEnvironment: String!,
$destinationEnvironment: String!,
$returnData: Boolean!) {
$returnData: Boolean!,
$buildVariables: [EnvKeyValueInput]) {
deployEnvironmentPromote(input:{
sourceEnvironment:{
name: $sourceEnvironment
Expand All @@ -15,6 +16,7 @@ mutation (
}
destinationEnvironment: $destinationEnvironment
returnData: $returnData
buildVariables: $buildVariables
}
)
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
mutation (
$project: ProjectInput!,
$project: ProjectInput!,
$number: Int!,
$title: String!,
$baseBranchName: String!,
$baseBranchRef: String!,
$headBranchName: String!,
$headBranchRef: String!,
$returnData: Boolean!) {
$returnData: Boolean!,
$buildVariables: [EnvKeyValueInput]) {
deployEnvironmentPullrequest(input: {
project: $project
number: $number
Expand All @@ -16,6 +17,7 @@ mutation (
headBranchName: $headBranchName
headBranchRef: $headBranchRef
returnData: $returnData
buildVariables: $buildVariables
}
)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
mutation (
$environment: Int!
$persistentStorageClaim: String!
$kibUsed: Float!
) {
addOrUpdateStorageOnEnvironment(input: {
environment: $environment
persistentStorageClaim: $persistentStorageClaim
kibUsed: $kibUsed
}
){
id
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@ query (
services{
id
name
{{ if apiVerGreaterThanOrEqual . "2.18.0" }}
type
containers{
name
}
created
updated
{{ end }}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,24 @@ query (
deployType
environmentType
openshiftProjectName
autoIdle
deployTitle
deployBaseRef
deployHeadRef
updated
created
deleted
services{
id
name
{{ if apiVerGreaterThanOrEqual . "2.18.0" }}
type
containers{
name
}
created
updated
{{ end }}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@ query (
services{
id
name
{{ if apiVerGreaterThanOrEqual . "2.18.0" }}
type
containers{
name
}
created
updated
{{ end }}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@ query (
services{
id
name
{{ if apiVerGreaterThanOrEqual . "2.18.0" }}
type
containers{
name
}
created
updated
{{ end }}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ mutation (
services{
id
name
{{ if apiVerGreaterThanOrEqual . "2.18.0" }}
type
containers{
name
}
created
updated
{{ end }}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
query ($name: String!) {
projectByName(name: $name) {
id
name
notifications(type: EMAIL) {
... on NotificationEmail {
__typename
Expand All @@ -8,4 +10,4 @@ query ($name: String!) {
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
query ($name: String!) {
projectByName(name: $name) {
id
name
notifications(type: MICROSOFTTEAMS) {
... on NotificationMicrosoftTeams {
__typename
Expand All @@ -8,4 +10,4 @@ query ($name: String!) {
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
query ($name: String!) {
projectByName(name: $name) {
id
name
notifications(type: ROCKETCHAT) {
... on NotificationRocketChat {
__typename
Expand All @@ -9,4 +11,4 @@ query ($name: String!) {
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
query ($name: String!) {
projectByName(name: $name) {
id
name
notifications(type: SLACK) {
... on NotificationSlack {
__typename
Expand All @@ -9,4 +11,4 @@ query ($name: String!) {
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
query ($name: String!) {
projectByName(name: $name) {
id
name
notifications(type: WEBHOOK) {
... on NotificationWebhook {
__typename
Expand All @@ -8,4 +10,4 @@ query ($name: String!) {
}
}
}
}
}
14 changes: 14 additions & 0 deletions api/lagoon/client/_lgraphql/projects/allProjects.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
query {
allProjects {
id
name
gitUrl
productionEnvironment
developmentEnvironmentsLimit
environments{
id
name
environmentType
}
}
}
9 changes: 9 additions & 0 deletions api/lagoon/client/_lgraphql/projects/deleteProject.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
mutation (
$project: String!
){
deleteProject(
input: {
project: $project
}
)
}
7 changes: 7 additions & 0 deletions api/lagoon/client/_lgraphql/projects/projectKeyByName.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
query (
$name: String!) {
projectByName(
name: $name) {
publicKey
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
query (
$name: String!) {
projectByName(
name: $name) {
privateKey
publicKey
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
query ($project: Int!, $environment: String!){
environmentByName(
project: $project
name: $environment
){
advancedTasks {
... on AdvancedTaskDefinitionCommand {
id
name
description
}
... on AdvancedTaskDefinitionImage {
id
name
description
}
}
}
}
15 changes: 15 additions & 0 deletions api/lagoon/client/_lgraphql/tasks/addTask.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
mutation (
$environment: Int!,
$name: String!,
$command: String!,
$service: String!) {
addTask(input:{
environment: $environment
command: $command
execute:true
name: $name
service: $service
}) {
id
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
query (
$name: String!,
$project: Int!
){
environmentByName(
name: $name,
project: $project
){
id
advancedTasks {
... on AdvancedTaskDefinitionCommand {
id
name
description
}
... on AdvancedTaskDefinitionImage {
id
name
description
}
}
}
}
Loading

0 comments on commit 13cebdd

Please sign in to comment.