2023-03-10 20:59:56 +00:00
|
|
|
version: 2
|
|
|
|
jobs:
|
2023-04-10 18:12:08 +00:00
|
|
|
build:
|
2023-03-10 21:03:20 +00:00
|
|
|
machine: # executor type
|
2023-08-11 09:24:50 +00:00
|
|
|
image: ubuntu-2204:2022.04.1 # # recommended linux image - includes Ubuntu 20.04, docker 19.03.13, docker-compose 1.27.4
|
2023-03-10 20:59:56 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
|
2023-08-11 09:28:49 +00:00
|
|
|
- run:
|
2023-08-11 09:27:59 +00:00
|
|
|
name: Setup docker and buildx
|
|
|
|
command: docker buildx create --use
|
2023-08-11 09:26:53 +00:00
|
|
|
|
2023-03-10 21:03:20 +00:00
|
|
|
- run:
|
|
|
|
name: install dependencies
|
|
|
|
command: sudo apt-get install bash curl
|
|
|
|
|
2023-05-28 10:44:28 +00:00
|
|
|
- run:
|
|
|
|
name: download Go
|
|
|
|
command: wget https://golang.org/dl/go1.20.2.linux-amd64.tar.gz
|
|
|
|
|
|
|
|
- run:
|
|
|
|
name: install Go
|
|
|
|
command: sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.20.2.linux-amd64.tar.gz
|
|
|
|
|
|
|
|
- run:
|
|
|
|
name: set Go path
|
|
|
|
command: echo 'export PATH=$PATH:/usr/local/go/bin' >> $BASH_ENV
|
|
|
|
|
|
|
|
- run: |
|
|
|
|
echo 'export NVM_DIR="/opt/circleci/.nvm"' >> $BASH_ENV
|
|
|
|
echo ' [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> $BASH_ENV
|
|
|
|
|
|
|
|
- run: |
|
|
|
|
node -v
|
|
|
|
|
|
|
|
- run: |
|
|
|
|
nvm install v16
|
|
|
|
node -v
|
|
|
|
nvm alias default v16
|
|
|
|
|
|
|
|
- run: |
|
|
|
|
node -v
|
|
|
|
|
2023-03-10 21:03:20 +00:00
|
|
|
- run: docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD
|
2023-05-28 10:44:28 +00:00
|
|
|
|
|
|
|
- run:
|
|
|
|
name: Install dependencies
|
|
|
|
command: npm install
|
2023-03-12 18:17:28 +00:00
|
|
|
|
2023-04-30 12:03:14 +00:00
|
|
|
- run:
|
|
|
|
name: Download GeoLite2-Country database
|
|
|
|
command: |
|
|
|
|
curl -s -L "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-Country&license_key=$MAX_TOKEN&suffix=tar.gz" -o GeoLite2-Country.tar.gz
|
|
|
|
tar -xzf GeoLite2-Country.tar.gz --strip-components 1 --wildcards "*.mmdb"
|
|
|
|
|
2023-05-28 10:44:28 +00:00
|
|
|
- run:
|
|
|
|
name: Build UI
|
|
|
|
command: npm run client-build
|
|
|
|
|
2023-03-10 20:59:56 +00:00
|
|
|
- run:
|
2023-03-25 20:15:00 +00:00
|
|
|
name: Build and publish dockerfiles
|
|
|
|
command: sh docker.sh
|
2023-03-10 20:59:56 +00:00
|
|
|
|
2023-05-03 19:34:24 +00:00
|
|
|
buildarm:
|
2023-05-03 19:35:11 +00:00
|
|
|
machine:
|
|
|
|
image: ubuntu-2004:202101-01
|
2023-05-03 19:34:24 +00:00
|
|
|
resource_class: arm.medium
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
|
|
|
|
- run:
|
|
|
|
name: install dependencies
|
|
|
|
command: sudo apt-get install bash curl
|
|
|
|
|
2023-05-28 10:44:28 +00:00
|
|
|
- run:
|
|
|
|
name: download Go
|
|
|
|
command: wget https://golang.org/dl/go1.20.2.linux-arm64.tar.gz
|
|
|
|
|
|
|
|
- run:
|
|
|
|
name: install Go
|
|
|
|
command: sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.20.2.linux-arm64.tar.gz
|
|
|
|
|
|
|
|
- run:
|
|
|
|
name: set Go path
|
|
|
|
command: echo 'export PATH=$PATH:/usr/local/go/bin' >> $BASH_ENV
|
|
|
|
|
|
|
|
- run: |
|
|
|
|
echo 'export NVM_DIR="/opt/circleci/.nvm"' >> $BASH_ENV
|
|
|
|
echo ' [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> $BASH_ENV
|
|
|
|
|
|
|
|
- run: |
|
|
|
|
node -v
|
|
|
|
|
|
|
|
- run: |
|
|
|
|
nvm install v16
|
|
|
|
node -v
|
|
|
|
nvm alias default v16
|
|
|
|
|
|
|
|
- run: |
|
|
|
|
node -v
|
|
|
|
|
2023-05-03 19:34:24 +00:00
|
|
|
- run: docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD
|
2023-05-28 10:44:28 +00:00
|
|
|
|
|
|
|
- run:
|
|
|
|
name: Install dependencies
|
|
|
|
command: npm install
|
2023-05-03 19:34:24 +00:00
|
|
|
|
|
|
|
- run:
|
|
|
|
name: Download GeoLite2-Country database
|
|
|
|
command: |
|
|
|
|
curl -s -L "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-Country&license_key=$MAX_TOKEN&suffix=tar.gz" -o GeoLite2-Country.tar.gz
|
|
|
|
tar -xzf GeoLite2-Country.tar.gz --strip-components 1 --wildcards "*.mmdb"
|
|
|
|
|
2023-05-28 10:44:28 +00:00
|
|
|
- run:
|
|
|
|
name: Build UI
|
|
|
|
command: npm run client-build
|
|
|
|
|
2023-05-03 19:34:24 +00:00
|
|
|
- run:
|
|
|
|
name: Build and publish dockerfiles
|
2023-05-03 19:37:31 +00:00
|
|
|
command: sh docker.arm64.sh
|
2023-05-03 19:34:24 +00:00
|
|
|
|
2023-03-10 20:59:56 +00:00
|
|
|
workflows:
|
|
|
|
version: 2
|
|
|
|
build-all:
|
|
|
|
jobs:
|
|
|
|
- build:
|
2023-05-03 19:34:24 +00:00
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only:
|
|
|
|
- master
|
|
|
|
- unstable
|
|
|
|
- buildarm:
|
2023-03-10 20:59:56 +00:00
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only:
|
2023-04-18 15:56:14 +00:00
|
|
|
- master
|
|
|
|
- unstable
|