-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[docs] Explain the builtin commands and the separating script for script run stage #5127
Changes from 1 commit
5f58c28
3ab416e
ed4f0b0
c502a27
dc78b67
48d7819
bfb1765
48022da
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -55,6 +55,51 @@ The commands run in the directory where this application configuration file exis | |||||
|
||||||
![](/images/script-run.png) | ||||||
|
||||||
### Execute the script file | ||||||
|
||||||
If your script is so long, you can separate the script as a file. | ||||||
You can put the file with the app.pipecd.yaml in the same dir and then you can execute the script like this. | ||||||
|
||||||
``` | ||||||
apiVersion: pipecd.dev/v1beta1 | ||||||
kind: KubernetesApp | ||||||
spec: | ||||||
name: script-run | ||||||
labels: | ||||||
env: example | ||||||
team: product | ||||||
pipeline: | ||||||
stages: | ||||||
- name: SCRIPT_RUN | ||||||
with: | ||||||
run: | | ||||||
sh script.sh | ||||||
``` | ||||||
|
||||||
``` | ||||||
. | ||||||
├── app.pipecd.yaml | ||||||
└── script.sh | ||||||
``` | ||||||
|
||||||
## Builtin command | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [nits]
Suggested change
|
||||||
|
||||||
Currently, you can use the commands which are installed in the environment for the piped. | ||||||
|
||||||
For example, If you are using the container platform and the offcial piped container image, you can use the command below. | ||||||
- git | ||||||
- ssh | ||||||
- jq | ||||||
- curl | ||||||
- and the builtin commands installed in the base image. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Users can also use piped installed tools such as terraform, kubectl, helm, kustomize, etc 👀 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @khanhtc1202 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, I don't really get your point. Could you explain it 🙏 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📝 Discussed about it in person. I agree that users can use the commands installed for the piped.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed on 48d7819 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree with @khanhtc1202 . There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I forgot it. So I think we should not explain it. It might be confusing for users who use SCRIPT_RUN that the command does not exist until the first deployment is executed. WDYT? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The app administrator can use the SCRIPT_RUN stage, such as executing I think it's okay to mention some tools are sometimes available under PIPED_TOOLS_DIR because it's a fact. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried adding it anyway. bfb1765 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Plz check it 🙏 @Warashi @khanhtc1202 |
||||||
|
||||||
The public piped image available in PipeCD main repo (ref: [Dockerfile](https://github.com/pipe-cd/pipecd/blob/master/cmd/piped/Dockerfile)) is based on [alpine](https://hub.docker.com/_/alpine/) and only has a few UNIX command available (ref: [piped-base Dockerfile](https://github.com/pipe-cd/pipecd/blob/master/tool/piped-base/Dockerfile)). | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [nits]
Suggested change
|
||||||
|
||||||
If you want to use your commands, you can: | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [nits] I wanna clarify whether the options are isolated or combined. e.g.
Suggested change
|
||||||
- Prepare your own environment container image then add [piped binary](https://github.com/pipe-cd/pipecd/releases) to it. | ||||||
- Build your own container image based on `ghcr.io/pipe-cd/piped` image. | ||||||
- Manually update your running piped container (not recommended). | ||||||
|
||||||
## Default environment values | ||||||
|
||||||
You can use the envrionment values related to the deployment. | ||||||
|
@@ -86,7 +131,6 @@ You can use jq command to refer to the values from `SR_CONTEXT_RAW`. | |||||
echo "rollback script-run" | ||||||
``` | ||||||
|
||||||
|
||||||
## Rollback | ||||||
|
||||||
> Note: Currently, this feature is only for the application kind of KubernetesApp. | ||||||
|
@@ -147,12 +191,3 @@ Then | |||||
- If 3 is canceled or fails while running, only SCRIPT_RUN of 3 will be rollbacked. | ||||||
- If 4 is canceled or fails while running, only SCRIPT_RUN of 3 will be rollbacked. | ||||||
- If 6 is canceled or fails while running, only SCRIPT_RUNs 3 and 5 will be rollbacked. The order of executing is 3 -> 5. | ||||||
|
||||||
## Note | ||||||
1. You can use `SCRIPT_RUN` stage with only the application kind of `KubernetesApp`. Soon we will implement it. for other application kinds. | ||||||
|
||||||
2. The public piped image available in PipeCD main repo (ref: [Dockerfile](https://github.com/pipe-cd/pipecd/blob/master/cmd/piped/Dockerfile)) is based on [alpine](https://hub.docker.com/_/alpine/) and only has a few UNIX command available (ref: [piped-base Dockerfile](https://github.com/pipe-cd/pipecd/blob/master/tool/piped-base/Dockerfile)). If you want to use your commands, you can: | ||||||
|
||||||
- Prepare your own environment container image then add [piped binary](https://github.com/pipe-cd/pipecd/releases) to it. | ||||||
- Build your own container image based on `ghcr.io/pipe-cd/piped` image. | ||||||
- Manually update your running piped container (not recommended). |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,6 +55,51 @@ The commands run in the directory where this application configuration file exis | |
|
||
![](/images/script-run.png) | ||
|
||
### Execute the script file | ||
|
||
If your script is so long, you can separate the script as a file. | ||
You can put the file with the app.pipecd.yaml in the same dir and then you can execute the script like this. | ||
|
||
``` | ||
apiVersion: pipecd.dev/v1beta1 | ||
kind: KubernetesApp | ||
spec: | ||
name: script-run | ||
labels: | ||
env: example | ||
team: product | ||
pipeline: | ||
stages: | ||
- name: SCRIPT_RUN | ||
with: | ||
run: | | ||
sh script.sh | ||
``` | ||
|
||
``` | ||
. | ||
├── app.pipecd.yaml | ||
└── script.sh | ||
``` | ||
|
||
## Builtin command | ||
|
||
Currently, you can use the commands which are installed in the environment for the piped. | ||
|
||
For example, If you are using the container platform and the offcial piped container image, you can use the command below. | ||
- git | ||
- ssh | ||
- jq | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't install jq in 0.46.x images, because it's installed at 0.48.0 release There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed on dc78b67 |
||
- curl | ||
- and the builtin commands installed in the base image. | ||
|
||
The public piped image available in PipeCD main repo (ref: [Dockerfile](https://github.com/pipe-cd/pipecd/blob/master/cmd/piped/Dockerfile)) is based on [alpine](https://hub.docker.com/_/alpine/) and only has a few UNIX command available (ref: [piped-base Dockerfile](https://github.com/pipe-cd/pipecd/blob/master/tool/piped-base/Dockerfile)). | ||
|
||
If you want to use your commands, you can: | ||
- Prepare your own environment container image then add [piped binary](https://github.com/pipe-cd/pipecd/releases) to it. | ||
- Build your own container image based on `ghcr.io/pipe-cd/piped` image. | ||
- Manually update your running piped container (not recommended). | ||
|
||
# When to rollback | ||
|
||
You can define the command as `onRollback` to execute when to rollback similar to `run`. | ||
|
@@ -113,12 +158,3 @@ Then | |
- If 3 is canceled or fails while running, only SCRIPT_RUN of 3 will be rollbacked. | ||
- If 4 is canceled or fails while running, only SCRIPT_RUN of 3 will be rollbacked. | ||
- If 6 is canceled or fails while running, only SCRIPT_RUNs 3 and 5 will be rollbacked. The order of executing is 3 -> 5. | ||
|
||
# Note | ||
1. You can use `SCRIPT_RUN` stage with only the application kind of `KubernetesApp`. Soon we will implement it. for other application kinds. | ||
|
||
2. The public piped image available in PipeCD main repo (ref: [Dockerfile](https://github.com/pipe-cd/pipecd/blob/master/cmd/piped/Dockerfile)) is based on [alpine](https://hub.docker.com/_/alpine/) and only has a few UNIX command available (ref: [piped-base Dockerfile](https://github.com/pipe-cd/pipecd/blob/master/tool/piped-base/Dockerfile)). If you want to use your commands, you can: | ||
|
||
- Prepare your own environment container image then add [piped binary](https://github.com/pipe-cd/pipecd/releases) to it. | ||
- Build your own container image based on `ghcr.io/pipe-cd/piped` image. | ||
- Manually update your running piped container (not recommended). |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,6 +55,51 @@ The commands run in the directory where this application configuration file exis | |
|
||
![](/images/script-run.png) | ||
|
||
### Execute the script file | ||
|
||
If your script is so long, you can separate the script as a file. | ||
You can put the file with the app.pipecd.yaml in the same dir and then you can execute the script like this. | ||
|
||
``` | ||
apiVersion: pipecd.dev/v1beta1 | ||
kind: KubernetesApp | ||
spec: | ||
name: script-run | ||
labels: | ||
env: example | ||
team: product | ||
pipeline: | ||
stages: | ||
- name: SCRIPT_RUN | ||
with: | ||
run: | | ||
sh script.sh | ||
``` | ||
|
||
``` | ||
. | ||
├── app.pipecd.yaml | ||
└── script.sh | ||
``` | ||
|
||
## Builtin command | ||
|
||
Currently, you can use the commands which are installed in the environment for the piped. | ||
|
||
For example, If you are using the container platform and the offcial piped container image, you can use the command below. | ||
- git | ||
- ssh | ||
- jq | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't install jq in 0.47.x images, because it's installed at 0.48.0 release There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed on dc78b67 |
||
- curl | ||
- and the builtin commands installed in the base image. | ||
|
||
The public piped image available in PipeCD main repo (ref: [Dockerfile](https://github.com/pipe-cd/pipecd/blob/master/cmd/piped/Dockerfile)) is based on [alpine](https://hub.docker.com/_/alpine/) and only has a few UNIX command available (ref: [piped-base Dockerfile](https://github.com/pipe-cd/pipecd/blob/master/tool/piped-base/Dockerfile)). | ||
|
||
If you want to use your commands, you can: | ||
- Prepare your own environment container image then add [piped binary](https://github.com/pipe-cd/pipecd/releases) to it. | ||
- Build your own container image based on `ghcr.io/pipe-cd/piped` image. | ||
- Manually update your running piped container (not recommended). | ||
|
||
# When to rollback | ||
|
||
You can define the command as `onRollback` to execute when to rollback similar to `run`. | ||
|
@@ -113,12 +158,3 @@ Then | |
- If 3 is canceled or fails while running, only SCRIPT_RUN of 3 will be rollbacked. | ||
- If 4 is canceled or fails while running, only SCRIPT_RUN of 3 will be rollbacked. | ||
- If 6 is canceled or fails while running, only SCRIPT_RUNs 3 and 5 will be rollbacked. The order of executing is 3 -> 5. | ||
|
||
# Note | ||
1. You can use `SCRIPT_RUN` stage with only the application kind of `KubernetesApp`. Soon we will implement it. for other application kinds. | ||
|
||
2. The public piped image available in PipeCD main repo (ref: [Dockerfile](https://github.com/pipe-cd/pipecd/blob/master/cmd/piped/Dockerfile)) is based on [alpine](https://hub.docker.com/_/alpine/) and only has a few UNIX command available (ref: [piped-base Dockerfile](https://github.com/pipe-cd/pipecd/blob/master/tool/piped-base/Dockerfile)). If you want to use your commands, you can: | ||
|
||
- Prepare your own environment container image then add [piped binary](https://github.com/pipe-cd/pipecd/releases) to it. | ||
- Build your own container image based on `ghcr.io/pipe-cd/piped` image. | ||
- Manually update your running piped container (not recommended). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nits] I think
labels
section is not necessary for the explanation.