My pipeline bitbucket-pipelines.yml is below
image: maven:3.6.3
pipelines:
default:
- step:
name: Install Unzip
script:
- apt-get update
- apt-get install unzip
- step:
name: Install Gauge
script:
- curl -SsL https://downloads.gauge.org/stable | sh
- step:
name: Install Gauge-Java Plugin
script:
- gauge install java
- step:
name: Run Pre-Requisites
caches:
- maven
script:
- mvn test-compile gauge:execute -DspecsDir="specs/Get Auth Token.spec" -Denv="uat"
- step:
name: Run Regression Tests
caches:
- maven
script:
- mvn test-compile gauge:execute -DspecsDir="specs" -Denv="uat" -DinParallel=true
When I run this. I am getting error,
bash: apt-get: command not found
I am working on a maven project
This would suggest that apt-get is not in the path in the build environment.
Is the build server an apt based linux distribution? Are you running the build with root privileges (at least for the software installation part of it)?
Hi Nic,
My project is a maven project. As I used the pipeline template as a maven template, I am not sure its linux distribution.
image: maven:3.6.3
Can I use image as Debian and work with maven project?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Your build tools are not really relevant here (although, yes, Maven is usable on pretty much all Linux distributions)
You need to understand what your build process is doing, and put it together properly. Why is it trying to run apt-get? What is that step supposed to do? As Apt is only valid on certain operating systems, you're going to need to do your builds on the right one.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My project is using an outside API call gauge(https://docs.gauge.org/latest/index.html) which need to be installed on the host machine. When installing it using the curl command (curl -SsL https://downloads.gauge.org/stable | sh) it says "unzip command not found". To install "unzip". I am using "apt-get"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I changed image to "atlassian/default-image:2" and it is now installing gauge dependency. But in the 3rd step "Install Gauge-Java Plugin", it says,
gauge command not found
image: atlassian/default-image:2 pipelines: default: - step: name: Install Unzip script: - echo "Installing Unzip" - apt-get update - apt-get install unzip - step: name: Install Gauge script: - echo "Installing Gauge" - curl -SsL https://downloads.gauge.org/stable | sh - step: name: Install Gauge-Java Plugin script: - echo "Installing Gauge-Java Plugin" - gauge install java - step: name: Run Pre-Requisites caches: - maven script: - echo "Running Pre-Requisites" - mvn test-compile gauge:execute -DspecsDir="specs/Get Auth Token.spec" -Denv="uat" - step: name: Run Regression Tests caches: - maven script: - echo "Running Regression Tests" - mvn test-compile gauge:execute -DspecsDir="specs" -Denv="uat" -DinParallel=true
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm not familiar with gauge, but that's not the core of the actual problem.
You need to take a step back and look at what you're doing. The bitbucket pipeline yaml file looks fine, but it is clear that you do not understand what it is trying to do.
It is set up to run a build on a certain type of operating system, and you do not appear to be using one of the right type.
Rather than try to botch the OS in the build environment, you should go back to the docs for the build and look at what it is expecting to be built on. Then you should do one of three things:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think after installing gauge, it is reflecting on other pipeline steps. Because when I use all the commands on one step it is working fine without any issues.
image: atlassian/default-image:2
pipelines:
default:
- step:
name: Installing Dependencies & Runing Regression Test Suite
caches:
- maven
script:
- echo "Fetching Package Updates"
- apt-get update
- echo "Installing Unzip"
- apt-get install unzip
- echo "Installing Gauge"
- curl -SsL https://downloads.gauge.org/stable | sh
- echo "Getting Gauge Version"
- gauge -v
- echo "Installing Gauge-Java Language Runner"
- gauge install java --version 0.7.15
- echo "Running Pre-Requisites"
- mvn test-compile gauge:execute -DspecsDir="specs/Get Auth Token.spec" -Denv="uat"
- echo "Running Regression Tests"
- mvn test-compile gauge:execute -DspecsDir="specs" -Denv="uat" -DinParallel=true
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I can't help you any further, you've basically got a broken build process that pipelines can't run.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
One of my colleagues has asked me to explain that last comment because it was not too clear to a couple of our clients.
The build process is broken somewhere. The error messages are coming from the build that the pipeline is invoking, not the pipeline process (which is supposed to be controlling the build)
You can tell pipelines to do whatever you want, but if you tell it to do something that isn't going to work, then it is going to tell you that.
Step back. Then tell the build to work. Get the build to work, then ask other things to trigger the build.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.