-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
40 lines (36 loc) · 1.25 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# GitLab CI Automation for PantherX Packages
# generates _latest.tgz version
# Author: Franz Geffke <[email protected]>
# Version: 0.0.9
# GitLab provided templates
include:
# - template: SAST.gitlab-ci.yml
# - template: Code-Quality.gitlab-ci.yml
# - template: License-Scanning.gitlab-ci.yml
# Git submodules
variables:
GIT_SUBMODULE_STRATEGY: recursive
stages:
- test
- deploy
# Pack and upload to S3
deploy:
stage: deploy
image: alpine:latest
script:
- cd ../
- apk add py-pip
- pip install --break-system-packages --user awscli
- export PATH="$PATH:/root/.local/bin"
- export AWS_ACCESS_KEY_ID=$(echo "$AWS_ACCESS_KEY_ID")
- export AWS_SECRET_ACCESS_KEY=$(echo "$AWS_SECRET_ACCESS_KEY")
- export AWS_DEFAULT_REGION=eu-central-1
- export PACKAGE_NAME="$(echo $CI_PROJECT_NAME)_$(echo $CI_COMMIT_TAG).tgz"
- export PACKAGE_NAME_LATEST="$(echo $CI_PROJECT_NAME)_latest.tgz"
- tar --exclude="$CI_PROJECT_NAME/.git" -zcvf "$PACKAGE_NAME" "$CI_PROJECT_NAME"
- tar --exclude="$CI_PROJECT_NAME/.git" -zcvf "$PACKAGE_NAME_LATEST" "$CI_PROJECT_NAME"
- aws s3 cp "$PACKAGE_NAME" s3://source-git-pantherx-org/
- aws s3 cp "$PACKAGE_NAME_LATEST" s3://source-git-pantherx-org/
only:
- tags
tags: [source]