-
Notifications
You must be signed in to change notification settings - Fork 432
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
43 changed files
with
1,131 additions
and
33 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
docs/content/workflows/pipelines/actions/builtin/serve-static-files.md
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,29 @@ | ||
+++ | ||
title = "Serve Static Files" | ||
chapter = true | ||
+++ | ||
|
||
**Serve Static Files Action** is a builtin action, you can't modify it. | ||
|
||
This action can be used to upload static files and serve them. For example your HTML report about coverage, tests, performances, ... | ||
|
||
Pay attention this action is only available if your objectstore is configured to use Openstack Swift. And fow now by default your static files will be deleted after 2 months. | ||
|
||
## Parameters | ||
* name: Name to display in CDS UI and identify your static files | ||
* path: Path where static files will be uploaded (example: mywebsite/*). If it's a file, the entrypoint would be set to this filename by default. | ||
* tag: Filename (and not path) for the entrypoint when serving static files (default: if empty it would be index.html). | ||
|
||
### Example | ||
|
||
* In this example I created a website with script in bash and use action `Serve Static Files`. | ||
|
||
![img](/images/workflows.pipelines.actions.builtin.serve-static-files-job.png) | ||
|
||
* Launch pipeline, check logs | ||
|
||
![img](/images/workflows.pipelines.actions.builtin.serve-static-files-logs.png) | ||
|
||
* View your static files with links in the tab artifact | ||
|
||
![img](/images/workflows.pipelines.actions.builtin.serve-static-files-tab.png) |
Binary file added
BIN
+78.1 KB
docs/static/images/workflows.pipelines.actions.builtin.serve-static-files-job.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+35.6 KB
docs/static/images/workflows.pipelines.actions.builtin.serve-static-files-logs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+28.8 KB
docs/static/images/workflows.pipelines.actions.builtin.serve-static-files-tab.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
|
@@ -8,6 +8,7 @@ import ( | |
"io/ioutil" | ||
|
||
"github.com/ovh/cds/sdk" | ||
|
||
"golang.org/x/crypto/ssh" | ||
) | ||
|
||
|
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,44 @@ | ||
package workflow | ||
|
||
import ( | ||
"database/sql" | ||
"time" | ||
|
||
"github.com/go-gorp/gorp" | ||
|
||
"github.com/ovh/cds/sdk" | ||
) | ||
|
||
func loadStaticFilesByNodeRunID(db gorp.SqlExecutor, nodeRunID int64) ([]sdk.StaticFiles, error) { | ||
var dbstaticFiles []dbStaticFiles | ||
if _, err := db.Select(&dbstaticFiles, `SELECT | ||
id, | ||
name, | ||
entrypoint, | ||
created, | ||
public_url, | ||
workflow_node_run_id | ||
FROM workflow_node_run_static_files WHERE workflow_node_run_id = $1`, nodeRunID); err != nil { | ||
if err == sql.ErrNoRows { | ||
return nil, nil | ||
} | ||
return nil, err | ||
} | ||
|
||
staticFiles := make([]sdk.StaticFiles, len(dbstaticFiles)) | ||
for i := range dbstaticFiles { | ||
staticFiles[i] = sdk.StaticFiles(dbstaticFiles[i]) | ||
} | ||
return staticFiles, nil | ||
} | ||
|
||
// InsertStaticFiles insert in table workflow_artifacts | ||
func InsertStaticFiles(db gorp.SqlExecutor, sf *sdk.StaticFiles) error { | ||
sf.Created = time.Now() | ||
dbstaticFiles := dbStaticFiles(*sf) | ||
if err := db.Insert(&dbstaticFiles); err != nil { | ||
return err | ||
} | ||
sf.ID = dbstaticFiles.ID | ||
return nil | ||
} |
Oops, something went wrong.