Nativescript Compilation in docker container stopped working

Answered

Hello.

 

Since last week we have noticed issues with our Teamcity installation. We updated to version TeamCity Professional 2019.2 (build 71499) and since then, coincidentally or not, some of our projects stopped compiling correctly.

 

Projects are compiled using docker containers, and they fail with what seems to be an NPM issue, but the strangest thing is that I can compile the same project, using the same commands that are in teamcity, in the same container in my machine. And also, this was working with no problem a couple of weeks ago.

 

Compilation configuration is as follows:

 

Docker container where compilation is executed (publicly available): alfasoft/nativescript:0.1

VCS Control Settings: Delete all files in the checkout directory before the build, plus a custom build path in case something was getting left behind.

 

echo "Definitions"
echo "Node Version"
node --version
echo "NPM Version"
npm -v

npm config set unsafe-perm true


echo "Clearing NPM cache"
npm cache clear --force

echo "Removing node modules"
rm -rf node_modules

echo "Removing package lock"
rm -rf package-lock.json

echo "Removing .npm"
rm -rf ~/.npm

echo "User"
whoami
echo "Working Directory"
pwd
echo "List folder contents"
ls -la

echo "Running NPM install"
npm install

echo "Running audit fix"
npm audit fix

 

echo "TNS install"
tns install
echo "TNS update and migrate"
tns update
tns platform remove android
tns platform add android
tns migrate


echo "build android"
tns build android --hmr --env.prod --clean --env.snapshot --env.uglify

 

This runs without issue and compiles successfully in the docker container mentioned above in 2 different machines, but not in the teamcity agent.

 

Any hints?

1 comment
Comment actions Permalink

Hi,

 

does the compilation throw any error message? The only cause I can think off is a permissions issue or some other problem where the environment is not passed identically to the docker image. Even if the same image is used in both teamcity and your local environment, there is a set of required folders and tools that need to be passed to the image, which are different from one environment to the other. Those are very likely the cause, given that docker should ensure everything else is equal.

0

Please sign in to leave a comment.