cptLamo
(Cpt Lamo)
November 21, 2019, 2:23am
1
Hello, I have .drone.yml file with this block of code:
---
kind: pipeline
type: exec
name: default
steps:
- name: show environments
commands:
- echo "CI_BUILD_DIR = ${CI_BUILD_DIR}
- echo "DRONE_DIR = ${DRONE_DIR}"
And when i start commiting, i go on drone server to my recent build, and see this:
How can i make variable DRONE_DIR to show up my working directory?
anhgien
(gientran)
November 21, 2019, 2:46am
2
What is your Drone version?
cptLamo
(Cpt Lamo)
November 21, 2019, 2:51am
3
I’ve pulled docker container with dron server yesterday by command:
docker pull drone/drone:1
So i can’t tell what version is
The variable names you are using do not exist and will always be empty. Here is a list of environment variables available to your pipeline: https://docs.drone.io/pipeline/environment/reference/
cptLamo
(Cpt Lamo)
November 21, 2019, 3:01am
5
Thank you for replaying.
Now i understand.
But what if i want to see my directory? And i need to keep my directory in variable DRONE_DIR ? How can i do that?
you can use bash scripting:
---
kind: pipeline
type: exec
name: default
steps:
- name: show environments
commands:
- pwd
- DRONE_DIR=$(pwd)
- echo $DRONE_DIR
cptLamo
(Cpt Lamo)
November 21, 2019, 3:13am
7
Thank you very much
Now it work’s)