Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

paritytech/ci_cd#852: Remove misused artifact instructions #1277

Merged
merged 1 commit into from
Aug 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 12 additions & 20 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,18 @@ variables:
BUILDAH_IMAGE: "quay.io/buildah/stable:v1.29"
BUILDAH_COMMAND: "buildah --storage-driver overlay2"
RUN_IN_CONTAINER: "1"
# Improve gitlab cache performance
CACHE_COMPRESSION_LEVEL: "fastest"
FF_USE_FASTZIP: "true"

cache:
- key:
files:
- javascript/package-lock.json
- paths:
- javascript/packages/
- javascript/package.json
- javascript/package-lock.json

.kubernetes-env: &kubernetes-env
image: $CI_IMAGE
Expand Down Expand Up @@ -58,45 +70,25 @@ variables:
- if: $CI_COMMIT_REF_NAME == "main"
- if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1

# telling gitlab to collect artifacts from artifacts/ folder to path it to other jobs
.collect-artifacts: &collect-artifacts
artifacts:
name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}"
when: on_success
expire_in: 2 days
paths:
- artifacts/

test:
stage: test
<<: *kubernetes-env
<<: *common-refs
<<: *collect-artifacts
script:
- mkdir -p artifacts
- cd javascript
- npm install
# - npm run test
- echo testme
- cp -r packages/ ../artifacts/
- cp package.json ../artifacts/
- cp package-lock.json ../artifacts/
- ls -ltr ../artifacts/*

build:
stage: build
<<: *kubernetes-env
<<: *common-refs
<<: *collect-artifacts
script:
- mkdir -p artifacts
- cd javascript
- npm install
- npm run clean
- npm run build
- cp -r packages/ ../artifacts/
- cp package.json ../artifacts/
- cp package-lock.json ../artifacts/

# template task for building and pushing an image
.build-push-docker-image: &build-push-docker-image
Expand Down
6 changes: 3 additions & 3 deletions scripts/ci/docker/zombienet_injected.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ RUN groupadd --gid 10001 nonroot && \
--uid 10000 nonroot

WORKDIR /home/nonroot/zombie-net
COPY ./artifacts/packages ./packages
COPY javascript/packages ./packages
COPY scripts ./scripts
COPY tests ./tests
COPY artifacts/package.json ./
COPY artifacts/package-lock.json ./
COPY javascript/package.json ./
COPY javascript/package-lock.json ./
RUN npm install --production
RUN chown -R nonroot. /home/nonroot

Expand Down
Loading