https://travis-ci.org/poma/ton/builds/600655302
The 2 jobs that failed are listed in allow_failures list, but the build overall is still marked as failed. Why?
Travis config:
if: tag IS blank
language: cpp
compiler: clang
matrix:
include:
- os: linux
dist: bionic
addons:
apt:
packages:
- ninja-build
- pkg-config
- libssl-dev
- zlib1g-dev
- libreadline-dev
- libmicrohttpd-dev
- gperf
- os: linux
dist: xenial
compiler: gcc
addons:
apt:
packages:
- ninja-build
- pkg-config
- libssl-dev
- zlib1g-dev
- libreadline-dev
- libmicrohttpd-dev
- gperf
- os: osx
osx_image: xcode11.2
addons:
homebrew:
packages:
- ninja
- cmake
- openssl
- os: osx
osx_image: xcode10.2
addons:
homebrew:
packages:
- ninja
- cmake
- openssl
- os: osx
osx_image: xcode9.4
addons:
homebrew:
packages:
- ninja
- cmake
- openssl
- os: windows
allow_failures:
- os: linux
dist: xenial
- os: windows
install:
- env
- ${CC} --version
- ${CC} -v
- ${CXX} --version
- ${CXX} -v
- git clone --recursive https://github.com/ton-blockchain/ton
- cd ton
- export COMMIT=`git rev-parse HEAD`
- export COMMIT_SHORT=`git rev-parse --short HEAD`
- export COMMIT_MESSAGE=`git log -1 --pretty=%B`
- echo "Using git commit $COMMIT"
- |
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
export RELEASE_FILE=ton_linux_${TRAVIS_DIST}_${TRAVIS_ARCH}_${TRAVIS_COMPILER}_${COMMIT_SHORT}.tar.gz
wget https://test.ton.org/ton-lite-client-test1.config.json
wget https://test.ton.org/ton-global.config.json
elif [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
export RELEASE_FILE=ton_osx_$(sw_vers -productVersion)_${TRAVIS_OSX_IMAGE}_${TRAVIS_ARCH}_${TRAVIS_COMPILER}_${COMMIT_SHORT}.tar.gz
export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig"
wget https://test.ton.org/ton-lite-client-test1.config.json
wget https://test.ton.org/ton-global.config.json
elif [[ "${TRAVIS_OS_NAME}" == "windows" ]]; then
export RELEASE_FILE=ton_windows_${TRAVIS_ARCH}_${TRAVIS_COMPILER}_${COMMIT_SHORT}.tar.gz
fi
- |
if [[ "${TRAVIS_OS_NAME}" == "windows" ]]; then
choco install ninja gperf openssl getopt # zlib libmicrohttpd
# git clone https://github.com/Microsoft/vcpkg.git
# cd vcpkg
# export VCPKG_DEFAULT_TRIPLET=x86-windows
# ./bootstrap-vcpkg.bat
# ./vcpkg integrate install
# ./vcpkg install zlib # libmicrohttpd
# cd ..
fi
script:
- mkdir build
- cd build
- cmake -G "Ninja" ..
- ninja
# Also compatible with regular CMake build (slower)
# - cmake -DCMAKE_TOOLCHAIN_FILE="../vcpkg/scripts/buildsystems/vcpkg.cmake" ..
# - cmake ..
# - cmake --build .
# - test?
- mkdir -p release/lib
# todo: exe file names
- |
mv lite-client/lite-client \
crypto/fift \
crypto/tlbc \
crypto/create-state \
crypto/dump-block \
crypto/func \
validator-engine/validator-engine \
validator-engine-console/validator-engine-console \
tonlib/tonlib-cli \
utils/generate-random-id \
adnl/adnl-proxy \
adnl/adnl-pong \
tdnet/tcp_ping_pong \
tdnet/udp_ping_pong \
dht-server/dht-server \
../ton-lite-client-test1.config.json \
../ton-global.config.json \
release/
- |
mv ../crypto/fift/lib/* \
../crypto/smartcont/stdlib.fc \
release/lib/
- tar -czvf $RELEASE_FILE release
# Skipped files:
# ./tl/generate/generate_common
# ./tl/generate/tonlib_generate_java_api
# ../tl/generate/scheme
# ./utils/json2tlo
before_deploy:
- git config --local user.name "poma"
- git config --local user.email "semenov.roman#mail.ru"
- export TRAVIS_TAG=${TRAVIS_TAG:-build-$TRAVIS_BUILD_NUMBER}
- git tag -f $TRAVIS_TAG
deploy:
provider: releases
name: TON binaries for commit $COMMIT_SHORT
# body: "Last commit: $COMMIT_MESSAGE" # causes error in travis
api_key:
secure: FHXDvia6qgFleDoTVBoOgKYZKHN8GG5A98E9z/mO+5EZ4GNssa7kUZylXkNnDq1GFSiBI8GojME2MnryqPKPX7+eAdRW+BfxdjNoY2mkqKFV2pTSBfC5M6W/qvgYE7w8U+8vVKexPWl6AnX4ex5xwWE0Eu7LgI0eNCOOagypieO0E7VzB8Au8s4KQ+00VYt/U6i0hVvyHkQOksk7cpWXLZr3qkspBOlgBS2erOAKtw3uVdXSMa4XKVvHBTV+OmlDrTvPK66eGtopAGbS8MRtfJP4H5FULyD+uHCeyYj5eE1mEmUsOjMOrv7Q69rVYj9gAFbmFfAFv4uL+6mZSQwKw+sm6VmqUxxbii0pD7TXaUK0BBiVgKDSkV8v1qYJKCWkynjdznX4yzSsm7jh8AjnL9GCa7vGjngTniBZiVaTCr3NriEVpQ8/cWsqv3fWnvdjNg6gNysWg8mHQhclabNUhOoDVYJEuoyifxVqIWP0SEBuaZl/i/YA00EyIwsgTughbrjdX/odLCRKvfHtTRLwIjKAgpsVJ8UMYaCa7trfa8+NmIpDsGIpzq9CyxOaUBry0QQOO9IPVm/TfPpCqMTIpOmHqY22Re7fkwmIqfJxTXiLjVOH9d+oHj1+kUBw+HIP+lXv/3jd8HaI8fhxlyhFbeijLBrp5WY4oBSs2mx97tA=
file: $RELEASE_FILE
skip_cleanup: true
allow_failures should be under matrix but was top level
Related
I'm trying to set up Ansible molecule for testing roles on different OSes. For example, this role is failing when it gets to the task that installs with snap install core:
https://github.com/ProfessorManhattan/Ansible-Role-Snapd
molecule.yml:
---
dependency:
name: galaxy
options:
role-file: requirements.yml
requirements-file: requirements.yml
driver:
name: docker
platforms:
- name: Ubuntu-20.04
image: professormanhattan/ansible-molecule-ubuntu2004
command: /sbin/init
tmpfs:
- /run
- /tmp
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
privileged: true
pre_build_image: true
provisioner:
name: ansible
connection_options:
ansible_connection: docker
ansible_password: ansible
ansible_ssh_user: ansible
inventory:
group_vars:
all:
molecule_test: true
options:
vvv: true
playbooks:
converge: converge.yml
verifier:
name: ansible
scenario:
create_sequence:
- dependency
- create
- prepare
check_sequence:
- dependency
- cleanup
- destroy
- create
- prepare
- converge
- check
- destroy
converge_sequence:
- dependency
- create
- prepare
- converge
destroy_sequence:
- dependency
- cleanup
- destroy
test_sequence:
- lint
- dependency
- cleanup
- destroy
- syntax
- create
- prepare
- converge
- idempotence
- side_effect
- verify
- cleanup
- destroy
install-Debian.yml:
---
- name: Ensure snapd is installed
apt:
name: snapd
state: present
update_cache: true
- name: Ensure fuse filesystem is installed
apt:
name: fuse
state: present
- name: Ensure snap is started and enabled on boot
ansible.builtin.systemd:
enabled: true
name: snapd
state: started
- name: Ensure snap core is installed # This task is failing
community.general.snap:
name: core
state: present
The error I receive is:
TASK [professormanhattan.snapd : Ensure fuse filesystem is installed] **********
ok: [Ubuntu-20.04]
TASK [professormanhattan.snapd : Ensure snap is started and enabled on boot] ***
changed: [Ubuntu-20.04]
TASK [professormanhattan.snapd : Ensure snap core is installed] ****************
fatal: [Ubuntu-20.04]: FAILED! => {"changed": false, "channel": "stable", "classic": false, "cmd": "sh -c \"/usr/bin/snap install core\"", "msg": "Ooops! Snap installation failed while executing 'sh -c \"/usr/bin/snap install core\"', please examine logs and error output for more details.", "rc": 1, "stderr": "error: cannot perform the following tasks:\n- Setup snap \"core\" (10823) security profiles (cannot reload udev rules: exit status 1\nudev output:\nFailed to send reload request: No such file or directory\n)\n", "stderr_lines": ["error: cannot perform the following tasks:", "- Setup snap \"core\" (10823) security profiles (cannot reload udev rules: exit status 1", "udev output:", "Failed to send reload request: No such file or directory", ")"], "stdout": "", "stdout_lines": []}
The same is true for all the other operating systems I'm trying to test. Here's a link to the Dockerfile I'm using to build the Ubuntu image:
Dockerfile:
FROM ubuntu:20.04
LABEL maintainer="help#megabyte.space"
ENV container docker
ENV DEBIAN_FRONTEND noninteractive
# Source: https://github.com/ansible/molecule/issues/1104
RUN set -xe \
&& apt-get update \
&& apt-get install -y apt-utils \
&& apt-get upgrade -y \
&& apt-get install -y \
build-essential \
libyaml-dev \
python3-apt \
python3-dev \
python3-pip \
python3-setuptools \
python3-yaml \
software-properties-common \
sudo \
systemd \
systemd-sysv \
&& apt-get clean \
&& pip3 install \
ansible \
ansible-lint \
flake8 \
molecule \
yamllint \
&& mkdir -p /etc/ansible \
&& echo "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts \
&& groupadd -r ansible \
&& useradd -m -g ansible ansible \
&& usermod -aG sudo ansible \
&& sed -i "/^%sudo/s/ALL\$/NOPASSWD:ALL/g" /etc/sudoers
VOLUME ["/sys/fs/cgroup", "/tmp", "/run"]
CMD ["/sbin/init"]
Looking for a geerlingguy.
I want run PHPUnit code coverage using GitLab CI but when i run the command vendor/bin/phpunit --coverage-text --colors=never is only show code test result and not generating code coverage.
When I test it on local using XAMPP with Xdebug enable the code coverage generated with using xdebug.mode=coverage. How to change the xdebug.mode on php.ini on docker setup script ?
I also override it via PHPUnit XML configuration like this also not work.
<ini name="xdebug.mode" value="coverage" />
Here is my .gitlab-ci.yml
image: php:7.4.14
cache:
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
paths:
- vendor
before_script:
# Install git
- apt-get update -yqq
- apt-get install git -yqq
# Install packages
- apt-get install libcurl4-openssl-dev
# Install required php extension
- docker-php-ext-install curl
# Install Xdebug
- pecl install xdebug
- docker-php-ext-enable xdebug
# Install composer
- curl -sS https://getcomposer.org/installer | php
# Install dependencies
- php composer.phar update --prefer-stable --prefer-dist --no-interaction --no-progress
run-test:
script:
- vendor/bin/phpunit --coverage-text --colors=never
After searching some article finally i can do it like this.
Here my example .gitlab-ci.yml
image: php:7.4.14
cache:
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
paths:
- vendor
before_script:
# Install git
- apt-get update -yqq
- apt-get install git -yqq
# Install packages
- apt-get install libcurl4-openssl-dev
# Install required php extension
- docker-php-ext-install curl
# Install Xdebug
- pecl install xdebug
- docker-php-ext-enable xdebug
# Install composer
- curl -sS https://getcomposer.org/installer | php
# Install dependencies
- php composer.phar update --prefer-stable --prefer-dist --no-interaction --no-progress
# Here to change xdebug mode
- echo xdebug.mode=coverage > /usr/local/etc/php/conf.d/xdebug.ini
run-test:
script:
- vendor/bin/phpunit --coverage-text --colors=never
In my dockerfile I added this lines :
RUN pecl install xdebug \
&& docker-php-ext-enable xdebug \
&& echo "xdebug.mode=debug" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo "xdebug.client_host=host.docker.internal" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo "xdebug.mode=coverage" >> /usr/local/etc/php/conf.d/xdebug.ini
We have unit tests that require rospy (One of the test uses geometry_msgs/Twist).
When we run the unit tests locally, everything is fine.
pytest
============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-3.6.3, py-1.5.4, pluggy-0.6.0
rootdir: /home/cedric/Programming/robotics-prototype, inifile: pytest.ini
collected 10 items
tests/unit/branch_name_test.py ...... [ 60%]
tests/unit/drive_controls_test.py .. [ 80%]
tests/unit/import_test.py .. [100%]
========================== 10 passed in 2.73 seconds ===========================
When we run it on Travis, it fails. This is because it fails to find rospy. Our Travis setup installs ROS, runs catkin_make successfully, but fails at the unit tests.
The repo is public so if you're interesting in seeing the complete travis logs click here.
os: linux
dist: bionic
language: python
cache:
- apt
env:
global:
- REPO_ROOT=$(pwd)
- ARDUINO_IDE_VERSION="1.8.12"
- ARDUINO_PATH="$HOME/arduino-$ARDUINO_IDE_VERSION" # Required for CMake script
- TEENSYDUINO_VERSION="152"
- ROS_PYTHON_VERSION="3.6"
- ROS_VERSION="melodic"
- OS_VERSION="bionic"
install:
# Taken from this tutorial https://github.com/newdigate/teensy-blink
- mkdir -p robot/rover/build
- mkdir -p ~/Arduino/libraries
- wget --quiet https://downloads.arduino.cc/arduino-$ARDUINO_IDE_VERSION-linux64.tar.xz
- tar xf arduino-$ARDUINO_IDE_VERSION-linux64.tar.xz -C /home/$USER/
- curl -fsSL https://www.pjrc.com/teensy/td_$TEENSYDUINO_VERSION/TeensyduinoInstall.linux64 -o TeensyduinoInstall.linux64
- chmod +x TeensyduinoInstall.linux64
- /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_1.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :1 -ac -screen 0 1280x1024x16
- sleep 3
- export DISPLAY=:1.0
- ./TeensyduinoInstall.linux64 --dir=$ARDUINO_PATH
# Install pip dependencies and setup robot python package
- pip install -r requirements.txt -r requirements-dev.txt
- pip install -e .
# Install ros-base and necessary packages
- sudo sh -c "echo \"deb http://packages.ros.org/ros/ubuntu $OS_VERSION main\" > /etc/apt/sources.list.d/ros-latest.list"
- sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
- sudo apt update -q
- sudo apt install -y ros-$ROS_VERSION-ros-base ros-$ROS_VERSION-cv-camera ros-$ROS_VERSION-web-video-server
- sudo apt install -y python-rosdep python-wstool
# Install ros package dependencies
- cd $REPO_ROOT/robot/rospackages
- sudo rosdep init
- rosdep update
- rosdep install -y -r --from-paths src --ignore-src --rosdistro $ROS_VERSION
script:
# Set up 'robot' python module and test python installation
- cd $REPO_ROOT
- python setup.py develop
- pytest --continue-on-collection-errors
# Set up and initialize catkin workspace for ros packages
- cd $REPO_ROOT/robot/rospackages
- source /opt/ros/$ROS_VERSION/setup.bash
- catkin_make
# Allow to compile arduino code in external IDEs or something
- cd $REPO_ROOT/robot/rover/build
- cmake ..
- make
notifications:
email:
recipients:
- (hidden for the purpose of the question)
on_success: change
on_failure: change
python:
- "3.6"
git:
submodules: true
It seems that you are calling the test before sourcing your ROS environment. You need change that around:
script:
# Set up and initialize catkin workspace for ros packages
- cd $REPO_ROOT/robot/rospackages
- source /opt/ros/$ROS_VERSION/setup.bash
- catkin_make
# Set up 'robot' python module and test python installation
- cd $REPO_ROOT
- python setup.py develop
- pytest --continue-on-collection-errors
Is there a way to setup travis-ci to build multiple projects in different languages ?
Lets say my repo is
AwesomeRepoThatDoestOneThingInDifferentLanguages
-cpp
-csharp
-python2
-python3
-java
-go
-ruby
-lua
-objectivec
Now, I wish to apply ci to this.
If I just add .travis.yml file to my python2 project, travis-ci complains that no .travis.yml found, since its looking for one at the root of the repo.
So, is there a way where I can put a .travis.yml at the top, which then further invokes the travis.yml in each of my sub-modules ?
I was able to find a way to actually do this. This is not complete yet since some of the jobs are still failing and I need to fix them individually, but overall the idea works just fine.
I am using travis ci's matrix way. Here is my .travis.yml
Thought this might help if someone else had the same question or scenario.
---
matrix:
include:
-
before_script:
- "cd java"
jdk: oraclejdk8
language: java
script: "mvn clean package"
-
before_script:
- "cd python2"
- "pip install --upgrade setuptools"
- "pip install nose"
- "pip freeze > requirements.txt"
- "pip install -r requirements.txt"
- "cd tests"
cache: pip
language: python
python: 2.7
script: nosetests
-
before_script:
- "cd python3"
- "pip install --upgrade setuptools"
- "pip install nose"
- "pip freeze > requirements.txt"
- "pip install -r requirements.txt"
- "cd tests"
language: python
python: 3.6
script: nosetests
-
before_script:
- "cd objectivec"
language: objective-c
os: osx
osx_image: xcode10
script:
- "xcodebuild clean test -project DiffMatchPatch.xcodeproj -scheme DiffMatchPatch -destination 'platform=OS X,arch=x86_64'"
-
before_script:
- "sudo add-apt-repository --yes ppa:ubuntu-sdk-team/ppa"
- "sudo apt-get update -qq"
- "sudo apt-get install -qq qt5-qmake qtbase5-dev qtdeclarative5-dev libqt5webkit5-dev libsqlite3-dev"
language: cpp
script:
- "qmake -qt=qt5 -v"
- "qmake -qt=qt5"
- make
-
before_script:
- "cd csharp"
dotnet: "1.1.5"
env: DOTNETCORE=1
language: csharp
mono: latestscript
script:
- "dotnet restore"
solution: solution-name.sln
-
before_script:
- "cd dart"
dart: "1.15.0"
dart_task:
-
test: "--exclude-tags no-xvfb"
-
test: "--tags no-xvfb"
language: dart
with_content_shell: true
-
after_success:
- coveralls -b .. -r .. -i ./lua --dump c.report.json
- luacov-coveralls -j c.report.json -v
before_install:
- "cd lua"
- "pip install --upgrade pip"
- "pip install --upgrade setuptools"
- "pip freeze > requirements.txt"
- "pip install -r requirements.txt"
- "sudo wget https://luarocks.org/releases/luarocks-2.4.4.tar.gz"
- "sudo tar zxpf luarocks-2.4.4.tar.gz"
- "cd luarocks-2.4.4"
- "./configure --prefix=/usr/local/openresty/luajit \
--with-lua=/usr/local/openresty/luajit \
--lua-suffix=jit-2.1.0-beta2 \
--with-lua-include=/usr/local/openresty/luajit/include/luajit-2.1; sudo make bootstrap"
- "sudo luarocks install luasocket"
- "pip install cpp-coveralls"
- "luarocks install Lua-cURL --server=https://luarocks.org/dev"
- "luarocks install luacov-coveralls --server=https://luarocks.org/dev"
- "luarocks install lunitx"
- "luarocks install luabitop"
language: python
script:
- "lunit.sh tests/diff_match_patch_test.lua"
- "lunit.sh tests/speedtest.lua"
notifications:
email:
-
sudo: required
I have a matrix in travis for different builds. The ideas is to use a CLANG_SRC_VER variable. This variable is set through a travis matrix and in the before_install part, I launch a script which install package based on the value of the variable CLANG_SRC_VER.
The travis.yml looks like this:
matrix:
include:
- os: linux
dist: trusty
sudo: required
rvm: 2.1
env:
- CLANG_SRC_VER='35'
...
- os: linux
dist: trusty
sudo: required
rvm: ruby-head
env:
- CLANG_SRC_VER='35'
- os: linux
dist: trusty
sudo: required
rvm: 2.1
env:
- CLANG_SRC_VER='37'
- os: linux
dist: trusty
sudo: required
rvm: 2.2
env:
- CLANG_SRC_VER='37'
...
- os: linux
dist: trusty
sudo: required
rvm: 2.1
env:
- CLANG_SRC_VER='36'
- os: linux
dist: trusty
sudo: required
rvm: 2.2
env:
- CLANG_SRC_VER='36'
...
before_install:
- sudo ./tools/travis_before_install.sh
- gem install bundler
script:
- bundle exec tools/travis_build_gem.sh
- bundle exec gem install --debug --verbose --local clangc-0.0.1.gem
- ./tools/travis_run_tests.sh
And the travis_before_install.sh looks like that:
#!/bin/bash
case $CLANG_SRC_VER in
35)
echo "$CLANG_SRC_VER"
apt-get update -qq
echo "install the libs for $CLANG_SRC_VER"
apt-get install -qq llvm-dev libclang-3.5-dev libclang1-3.5 libclang-common-3.5-dev build-essential ruby-dev
echo "add symbolic link for $CLANG_SRC_VER"
ln -s /usr/lib/x86_64-linux-gnu/libclang-3.5.so /usr/lib/x86_64-linux-gnu/libclang.so;;
36)
echo "${CLANG_SRC_VER}"
apt-get update -qq
echo "install the libs for $CLANG_SRC_VER"
apt-get install -qq llvm-dev libclang-3.6-dev libclang1-3.6 libclang-common-3.6-dev build-essential ruby-dev
echo "add symbolic link for $CLANG_SRC_VER"
ln -s /usr/lib/x86_64-linux-gnu/libclang-3.6.so /usr/lib/x86_64-linux-gnu/libclang.so;;
37)
echo "$CLANG_SRC_VER"
apt-get update -qq
echo "install the libs for $CLANG_SRC_VER"
apt-get install -qq llvm-dev libclang-3.7-dev libclang1-3.7 libclang-common-3.7-dev build-essential ruby-dev
echo "add symbolic link for $CLANG_SRC_VER"
ln -s /usr/lib/x86_64-linux-gnu/libclang-3.7.so /usr/lib/x86_64-linux-gnu/libclang.so;;
38)
echo "$CLANG_SRC_VER"
apt-get update -qq
echo "install the libs for $CLANG_SRC_VER"
apt-get install -qq llvm-dev libclang-3.8-dev libclang1-3.8 libclang-common-3.8-dev build-essential ruby-dev
echo "add symbolic link for $CLANG_SRC_VER"
ln -s /usr/lib/x86_64-linux-gnu/libclang-3.8.so /usr/lib/x86_64-linux-gnu/libclang.so;;
*)
echo "$CLANG_SRC_VER"
apt-get update -qq
echo "install the libs for $CLANG_SRC_VER"
apt-get install -qq llvm-dev libclang-3.5-dev libclang1-3.5 libclang-common-3.5-dev build-essential ruby-dev
echo "add symbolic link for $CLANG_SRC_VER"
ln -s /usr/lib/x86_64-linux-gnu/libclang-3.5.so /usr/lib/x86_64-linux-gnu/libclang.so;;
esac
The problem is that in each case of the matrix, the CLANG_SRC_VER is empty.
I have checked the travis ouput and I have that line that shows that the variable is set and exported:
Setting environment variables from .travis.yml
$ export CLANG_SRC_VER='37'
It was easy, in the travis.yml I just changed this line:
sudo ./tools/travis_before_install.sh
to
sudo CLANG_SRC_VER=$CLANG_SRC_VER ./tools/travis_before_install.sh
In order to define the variable in the sudo environment.