-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
107 lines (101 loc) · 4.23 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# image: artifacts.ncei.noaa.gov/ncei/base:alma9
image: artifacts.ncei.noaa.gov/ncei/node-builder:18
variables:
NODE_VERSION: "v18.20.2"
EXB_VERSION: "1.13"
stages:
# setup skipped in lieu of using node-builder image"
# - .pre
- build
#- security # Required for security scan jobs
- artifactory # Required for deployments. The artifacts must be saved somewhere first.
- deploy # Required for deployments.
setup-job:
stage: .pre
script:
- curl -o node-$NODE_VERSION-linux-x64.tar.gz https://artifacts.ncei.noaa.gov:443/artifactory/node-dist/$NODE_VERSION/node-$NODE_VERSION-linux-x64.tar.gz
- tar -xzf node-$NODE_VERSION-linux-x64.tar.gz
- export PATH=$PATH:$PWD/node-$NODE_VERSION-linux-x64/bin
# set up npm registry and CA certs
- npm config set registry https://artifacts.ncei.noaa.gov/artifactory/api/npm/npm.upstream/
- export NODE_EXTRA_CA_CERTS=/etc/pki/tls/certs/ca-bundle.crt
# pass along to the next stage
artifacts:
paths:
- node-$NODE_VERSION-linux-x64
expire_in: 2 week
build-job:
stage: build
tags:
- build
script:
# - export PATH=$PATH:$PWD/node-$NODE_VERSION-linux-x64/bin
- export NODE_EXTRA_CA_CERTS=/etc/pki/tls/certs/ca-bundle.crt
- npm config set registry https://artifacts.ncei.noaa.gov/artifactory/api/npm/npm.upstream/
- echo "setting up Experience Builder..."
- dnf -y -q install unzip
- curl -o arcgis-experience-builder-${EXB_VERSION}.zip https://artifacts.ncei.noaa.gov/artifactory/arcgis/experience-builder/${EXB_VERSION}/arcgis-experience-builder-${EXB_VERSION}.zip
- unzip -q arcgis-experience-builder-${EXB_VERSION}.zip -d arcgis-experience-builder-${EXB_VERSION}
- cp -r widgets/* arcgis-experience-builder-${EXB_VERSION}/ArcGISExperienceBuilder/client/your-extensions/widgets
- mkdir -p arcgis-experience-builder-${EXB_VERSION}/ArcGISExperienceBuilder/server/public/apps
- cp -r apps/* arcgis-experience-builder-${EXB_VERSION}/ArcGISExperienceBuilder/server/public/apps
- echo "installing NPM dependencies for Experience Builder server..."
- cd arcgis-experience-builder-${EXB_VERSION}/ArcGISExperienceBuilder/server && npm ci
- cd ../../..
- echo "installing NPM dependencies for Experience Builder client..."
- cd arcgis-experience-builder-${EXB_VERSION}/ArcGISExperienceBuilder/client
# work around for node-sass failing to compile on NCEI
- npm uninstall node-sass
- npm install sass --save-dev
- npm ci
# - npm.virtual audit fix
- echo "installing NPM dependencies for custom widgets..."
- cd your-extensions/widgets
- |
for d in `find . -mindepth 1 -maxdepth 1 -type d`; do
echo $d
cd $d
if test -f package.json; then
echo "installing dependencies for `pwd`..."
npm i
fi
cd ..
done
- cd ../..
- npm run build:dev
- cd ..
- node -e "require('./server/src/middlewares/dev/apps/app-download.js').zipApp('0', 'app.zip')"
artifacts:
paths:
- arcgis-experience-builder-${EXB_VERSION}/ArcGISExperienceBuilder/app.zip
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
#-----------------------------------------------------------------------------
# Push artifact to artifactory dev repository
#-----------------------------------------------------------------------------
include:
# The utilities for uploading to Artifactory.
- component: git.ncei.noaa.gov/pipeline-components/artifactory/upload_artifact_dev_repo@main
inputs:
job_name: artifactory-upload-deep-sea-corals-exb
artifact_path: './arcgis-experience-builder-${EXB_VERSION}/ArcGISExperienceBuilder'
artifact_name: 'app.zip'
artifactory-upload-deep-sea-corals-exb:
needs:
- build-job
#-----------------------------------------------------------------------------
# Deployments
#-----------------------------------------------------------------------------
deploy-deep-sea-corals-exb-to-test:
variables:
BUILD_REF: ${CI_COMMIT_SHA}
PROJECT_NAME: ${CI_PROJECT_NAME}
PROJECT_PATH_SLUG: ${CI_PROJECT_PATH_SLUG}
TIER: "test"
stage: deploy
needs:
- artifactory-upload-deep-sea-corals-exb
trigger:
project: deployers/deployer
strategy: depend
# when: manual