Not able to generate and reflect generated artifacts in my project

Hello gitlab-community!

image: alpine:latest

stages:

  • build
  • test
  • deploy

before_script:

  • apk update
  • apk add maven

build:
stage: build
tags:

  • runner
    script:
  • echo “Building your application…”

artifacts:
stage: test
tags:

  • runner
    script:
  • echo “Running unit tests…”
    #- k6 run <test_script.js>

deploy:
stage: deploy
tags:

  • runner
    script:
  • echo “Deploying application…”
  • echo “Application successfully deployed.”

with the above script i am not able to get the artifacts as per my analysis . how to get proper artifacts and that should reflect in my project repo

Any help is kindly appreciated, thanks in advance

Hi @sudha27

I suppose you are using shell executor since you cd to some absolute path.
As mentioned in the docs, you can only push files as artifacts from job’s working directory. Not from any file on the system (otherwise I could just upload /etc/shadow from the host, as an example).

So if you need something to be artifact, it needs to be in $CI_PROJECT_DIR

I am not sure what do you mean, artifacts can be downloaded from Pipelines UI.

If you want to deploy your jar file, you need to write a job for it. Now what the job should do depends on your local environment and setup.

solved