2021-09-21 18:08:06 +02:00
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: default
|
|
|
|
|
|
|
|
workspace:
|
|
|
|
path: /root
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: install
|
2021-09-21 20:09:29 +02:00
|
|
|
image: bash:latest
|
2021-09-21 18:08:06 +02:00
|
|
|
pull: if-not-exists
|
|
|
|
commands:
|
2021-09-21 18:15:55 +02:00
|
|
|
- echo ". $HOME/trash.sh" > $HOME/.bashrc
|
|
|
|
- . $HOME/.bashrc
|
2021-09-21 18:08:06 +02:00
|
|
|
- ls -la $HOME/.trash/
|
|
|
|
- type trash
|
|
|
|
|
2021-09-21 18:26:46 +02:00
|
|
|
- name: test trash_empty
|
2021-09-21 18:08:06 +02:00
|
|
|
depends_on:
|
|
|
|
- install
|
2021-09-21 20:09:29 +02:00
|
|
|
image: bash:latest
|
2021-09-21 18:08:06 +02:00
|
|
|
pull: if-not-exists
|
|
|
|
commands:
|
2021-09-21 20:11:33 +02:00
|
|
|
- . $HOME/.bashrc
|
2021-09-21 20:41:04 +02:00
|
|
|
- for i in 1 2 3 4; do touch /tmp/testfile$i; done
|
2021-09-21 18:39:57 +02:00
|
|
|
- ls -l /tmp
|
2021-09-21 18:08:06 +02:00
|
|
|
- trash /tmp/testfile*
|
2021-09-21 18:39:57 +02:00
|
|
|
- ls -l /tmp
|
2021-09-21 18:26:46 +02:00
|
|
|
- trash_list
|
2021-09-21 18:08:06 +02:00
|
|
|
- ls -la $HOME/.trash/
|
2021-09-21 18:26:46 +02:00
|
|
|
- trash_empty
|
2021-09-21 20:46:21 +02:00
|
|
|
- trash_list
|
2021-09-21 18:08:06 +02:00
|
|
|
- ls -la $HOME/.trash/
|
|
|
|
|
2021-09-21 18:26:46 +02:00
|
|
|
- name: test trash_restore
|
2021-09-21 18:08:06 +02:00
|
|
|
depends_on:
|
|
|
|
- install
|
2021-09-21 18:48:28 +02:00
|
|
|
- test trash_empty
|
2021-09-21 20:09:29 +02:00
|
|
|
image: bash:latest
|
2021-09-21 18:08:06 +02:00
|
|
|
pull: if-not-exists
|
|
|
|
commands:
|
2021-09-21 20:11:33 +02:00
|
|
|
- . $HOME/.bashrc
|
2021-09-21 20:41:04 +02:00
|
|
|
- for i in 1 2 3 4; do touch /tmp/testfile$i; done
|
2021-09-21 18:39:57 +02:00
|
|
|
- ls -l /tmp
|
2021-09-21 18:08:06 +02:00
|
|
|
- trash /tmp/testfile*
|
2021-09-21 18:39:57 +02:00
|
|
|
- ls -l /tmp
|
2021-09-21 20:26:52 +02:00
|
|
|
- cat $HOME/.trash/.filepaths
|
2021-09-21 18:26:46 +02:00
|
|
|
- trash_list
|
2021-09-21 18:08:06 +02:00
|
|
|
- ls -la $HOME/.trash/
|
2021-09-21 20:28:20 +02:00
|
|
|
- trash_restore testfile2 testfile3
|
2021-09-21 18:39:57 +02:00
|
|
|
- ls -l /tmp
|
2021-09-21 18:08:06 +02:00
|
|
|
- ls -la $HOME/.trash/
|
|
|
|
|
2021-09-21 18:26:46 +02:00
|
|
|
- name: test trash_rm
|
2021-09-21 18:08:06 +02:00
|
|
|
depends_on:
|
|
|
|
- install
|
2021-09-21 18:49:06 +02:00
|
|
|
- test trash_restore
|
2021-09-21 19:59:52 +02:00
|
|
|
image: bash:latest
|
2021-09-21 18:08:06 +02:00
|
|
|
pull: if-not-exists
|
|
|
|
commands:
|
2021-09-21 20:11:33 +02:00
|
|
|
- . $HOME/.bashrc
|
2021-09-21 20:41:04 +02:00
|
|
|
- for i in 1 2 3 4; do touch /tmp/testfile$i; done
|
2021-09-21 18:39:57 +02:00
|
|
|
- ls -l /tmp
|
2021-09-21 18:08:06 +02:00
|
|
|
- trash /tmp/testfile*
|
2021-09-21 18:39:57 +02:00
|
|
|
- ls -l /tmp
|
2021-09-21 18:26:46 +02:00
|
|
|
- trash_list
|
2021-09-21 18:08:06 +02:00
|
|
|
- ls -la $HOME/.trash/
|
2021-09-21 18:26:46 +02:00
|
|
|
- trash_rm testfile2 testfile3
|
|
|
|
- trash_list
|
2021-09-21 21:06:22 +02:00
|
|
|
- ls -la $HOME/.trash/
|
|
|
|
|
|
|
|
- name: test usage
|
|
|
|
depends_on:
|
|
|
|
- install
|
|
|
|
- test trash_restore
|
|
|
|
image: bash:latest
|
|
|
|
pull: if-not-exists
|
|
|
|
commands:
|
|
|
|
- . $HOME/.bashrc
|
2021-10-28 02:07:09 +02:00
|
|
|
- trash | grep required
|