Skip to content

Instantly share code, notes, and snippets.

@zdravko-il
Created March 20, 2023 15:33
Show Gist options
  • Save zdravko-il/b2d3dfa0b8056310ebf80edeff6bc311 to your computer and use it in GitHub Desktop.
Save zdravko-il/b2d3dfa0b8056310ebf80edeff6bc311 to your computer and use it in GitHub Desktop.
build-job:
stage: build
image: zyanakiev/snowpark-devops:latest
artifacts:
name: app
untracked: false
when: on_success
expire_in: "7 days"
paths:
- "app.zip"
script:
- |
echo "Installing Python packages"
pip install -r requirements.txt
- |
if [[ -z $CI_COMMIT_TAG ]]
then
echo "Create schema for branch if not exists"
~/bin/snowsql -q "create schema if not exists $SF_SCHEMA" -o friendly=false
fi
- |
echo "Running unit tests"
python -m pytest
- |
echo "Installing manually managed packages for deployment"
pip install -t .packages -r requirements.other.txt
- |
echo "Creating zip package..."
if [ -d "build" ] ; then
cd .packages
zip -r ../app.zip .
cd ..
fi
zip -g -x .\* -r app.zip .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment