-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.gitlab-ci.yml.bak
41 lines (37 loc) · 1.64 KB
/
.gitlab-ci.yml.bak
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
41
# The Docker image that will be used to build your app
image: ubuntu:latest
variables:
PIP_CACHE_DIR: '$CI_PROJECT_DIR/.cache/pip'
GIT_STRATEGY: clone
before_script:
- echo "Before script section"
- export DEBIAN_FRONTEND=noninteractive
- apt-get update
- apt-get install -yqf bash git python3-pip rsync npm wget curl ldnsutils
- git config --global user.email "${GITLAB_USER_EMAIL}"
- git config --global user.name "${GITLAB_USER_NAME}"
- git remote set-url origin "https://gitlab-ci-token:${CI_JOB_TOKEN}@${CI_REPOSITORY_URL#*@}"
# - python --version # For debugging
- if [ -f requirements.txt ]; then pip install --no-cache -I -r requirements.txt; fi
- - git checkout master
after_script:
- echo -e "After script section...\n"
- git status
- git add .
- git commit -m "Committed new lists. BuildID ${CI_JOB_ID}.${CI_COMMIT_SHA} [ci-skip]" || echo "No changes, nothing to commit!"
- git remote rm origin && git remote add origin "https://${GITLAB_USER_NAME}:${CI_ACCESS_TOKEN}@${CI_REPOSITORY_URL#*@}"
# - git pull --rebase origin master
- git push origin HEAD:$CI_COMMIT_REF_NAME -o skip-ci # Pushes to the same branch as the trigger #"https://gitlab-ci-token:${CI_JOB_TOKEN}@${CI_REPOSITORY_URL#*@}" "HEAD:${CI_COMMIT_REF_NAME}" -o skip-ci
- git status
build:
stage: build
allow_failure: false
script:
# - echo "Install DEPS"
# - sudo bash "$CI_PROJECT_DIR/scripts/dependencies.sh"
- echo "Install mypdns"
- pip install --no-cache mypdns
- echo "Running IMPORT script"
- bash "$CI_PROJECT_DIR/scripts/import.sh"
- echo "Update ACTIVE lists"
- bash "$CI_PROJECT_DIR/scripts/update_active_lists.sh"