File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ *
2+ . *
3+ ! index.js
4+ ! lib /* .js
5+ ! package * .json
Original file line number Diff line number Diff line change 1+ cache :
2+ key : ${CI_COMMIT_REF_SLUG}
3+ paths :
4+ - node_modules/
5+
6+ stages :
7+ - test
8+ - deploy
9+
10+ test :
11+ image : node:lts
12+ stage : test
13+ before_script :
14+ - npm ci
15+ script :
16+ - npm test
17+
18+ build :
19+ image : docker:latest
20+ stage : deploy
21+ services :
22+ - docker:dind
23+ variables :
24+ DOCKER_DRIVER : overlay
25+ script :
26+ - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
27+ - docker build --pull --label "git-ref=$CI_COMMIT_SHORT_SHA" --label "build-date=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" -t "${CI_REGISTRY_IMAGE}:latest" .
28+ - docker tag "${CI_REGISTRY_IMAGE}:latest" "${CI_REGISTRY_IMAGE}:$CI_COMMIT_SHORT_SHA" && docker push "${CI_REGISTRY_IMAGE}:$CI_COMMIT_SHORT_SHA"
29+ - docker push "${CI_REGISTRY_IMAGE}:latest"
30+ only :
31+ - master
Original file line number Diff line number Diff line change 1+ FROM node:lts-alpine
2+ LABEL name="wei/pull" maintainer="Wei He <docker@weispot.com>"
3+
4+ ENV \
5+ NODE_ENV=production \
6+ PORT=3000 \
7+ LOG_FORMAT=short \
8+ LOG_LEVEL=info \
9+ PULL_INTERVAL=1800 \
10+ WEBHOOK_PATH=/webhook \
11+ # ###################
12+ # ## Required ###
13+ # ###################
14+ APP_ID= \
15+ WEBHOOK_SECRET= \
16+ PRIVATE_KEY= \
17+ # ###################
18+ # ## Optional ###
19+ # ###################
20+ # CLIENT_ID= \
21+ # CLIENT_SECRET= \
22+ # SENTRY_DSN= \
23+ # SYSLOG_UDP_HOST= \
24+ # SYSLOG_UDP_PORT= \
25+ # GHE_HOST= \
26+ # IGNORED_ACCOUNTS= \
27+ # DISABLE_STATS= \
28+ _=
29+
30+ WORKDIR /home/node
31+ COPY package*.json ./
32+ RUN \
33+ apk add --no-cache --virtual build-dependencies build-base gcc wget git && \
34+ apk add --no-cache python && \
35+ npm ci --production && \
36+ apk del build-dependencies && \
37+ :
38+
39+ COPY . .
40+
41+ EXPOSE 3000
42+ CMD ["npm" , "start" ]
Original file line number Diff line number Diff line change 1+ version : " 3"
2+ services :
3+ pull :
4+ build : ./
5+ volumes :
6+ - ./pk.pem:/home/node/pk.pem:ro
7+ env_file :
8+ - ./.env
9+ ports :
10+ - 3000:3000
You can’t perform that action at this time.
0 commit comments