CI updates #1
This commit is contained in:
parent
59ae833099
commit
5a343c7eb9
27 changed files with 707 additions and 652 deletions
27
apps/metamigo-cli/.gitlab-ci.yml
Normal file
27
apps/metamigo-cli/.gitlab-ci.yml
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
metamigo-docker-build:
|
||||
image: registry.gitlab.com/guardianproject-ops/docker-alpine-git:latest
|
||||
services:
|
||||
- docker:dind
|
||||
stage: docker-build
|
||||
variables:
|
||||
DOCKER_NS: ${CI_REGISTRY}/digiresilience/link/link-stack/metamigo
|
||||
DOCKER_TAG: ${CI_COMMIT_SHORT_SHA}
|
||||
script:
|
||||
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
|
||||
- cd apps/metamigo-cli && make docker/build-fresh-push
|
||||
|
||||
metamigo-docker-release:
|
||||
image: registry.gitlab.com/guardianproject-ops/docker-alpine-git:latest
|
||||
services:
|
||||
- docker:dind
|
||||
stage: docker-release
|
||||
variables:
|
||||
DOCKER_NS: ${CI_REGISTRY}/digiresilience/link/link-stack/metamigo
|
||||
DOCKER_TAG: ${CI_COMMIT_SHORT_SHA}
|
||||
DOCKER_TAG_NEW: ${CI_COMMIT_REF_NAME}
|
||||
only:
|
||||
- main
|
||||
- develop
|
||||
script:
|
||||
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
|
||||
- cd apps/metamigo-cli && make docker/add-tag
|
||||
40
apps/metamigo-cli/Makefile
Normal file
40
apps/metamigo-cli/Makefile
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
PACKAGE_NAME ?= $(shell jq -r '.name' package.json)
|
||||
PACKAGE_VERSION?= $(shell jq -r '.version' package.json)
|
||||
BUILD_DATE ?=$(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
|
||||
DOCKER_ARGS ?=
|
||||
DOCKER_NS ?= registry.gitlab.com/digiresilience/link/link-stack/metamigo
|
||||
DOCKER_TAG ?= test
|
||||
DOCKER_BUILD := docker build ${DOCKER_ARGS} --build-arg BUILD_DATE=${BUILD_DATE}
|
||||
DOCKER_BUILD_FRESH := ${DOCKER_BUILD} --pull --no-cache
|
||||
DOCKER_BUILD_ARGS := --build-arg VCS_REF=${CI_COMMIT_SHORT_SHA}
|
||||
DOCKER_PUSH := docker push
|
||||
DOCKER_BUILD_TAG := ${DOCKER_NS}:${DOCKER_TAG}
|
||||
|
||||
.PHONY: .npmrc
|
||||
.EXPORT_ALL_VARIABLES:
|
||||
|
||||
.npmrc:
|
||||
ifdef CI_JOB_TOKEN
|
||||
echo '@guardianproject-ops:registry=https://gitlab.com/api/v4/packages/npm/' > .npmrc
|
||||
echo '@digiresilience:registry=https://gitlab.com/api/v4/packages/npm/' >> .npmrc
|
||||
echo '//gitlab.com/api/v4/packages/npm/:_authToken=${CI_JOB_TOKEN}' >> .npmrc
|
||||
echo '//gitlab.com/api/v4/projects/:_authToken=${CI_JOB_TOKEN}' >> .npmrc
|
||||
echo '//gitlab.com/api/v4/projects/${CI_PROJECT_ID}/packages/npm/:_authToken=${CI_JOB_TOKEN}' >> .npmrc
|
||||
endif
|
||||
|
||||
docker/build: .npmrc
|
||||
DOCKER_BUILDKIT=1 ${DOCKER_BUILD} ${DOCKER_BUILD_ARGS} -t ${DOCKER_BUILD_TAG} ${PWD}
|
||||
|
||||
docker/build-fresh: .npmrc
|
||||
DOCKER_BUILDKIT=1 ${DOCKER_BUILD_FRESH} ${DOCKER_BUILD_ARGS} -t ${DOCKER_BUILD_TAG} ${PWD}
|
||||
|
||||
docker/add-tag:
|
||||
docker pull ${DOCKER_NS}:${DOCKER_TAG}
|
||||
docker tag ${DOCKER_NS}:${DOCKER_TAG} ${DOCKER_NS}:${DOCKER_TAG_NEW}
|
||||
docker push ${DOCKER_NS}:${DOCKER_TAG_NEW}
|
||||
|
||||
docker/push:
|
||||
${DOCKER_PUSH} ${DOCKER_BUILD_TAG}
|
||||
|
||||
docker/build-push: docker/build docker/push
|
||||
docker/build-fresh-push: docker/build-fresh docker/push
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
"@digiresilience/metamigo-db": "*",
|
||||
"@digiresilience/metamigo-api": "*",
|
||||
"@digiresilience/metamigo-worker": "*",
|
||||
"commander": "^10.0.1",
|
||||
"commander": "^11.0.0",
|
||||
"graphile-migrate": "^1.4.1",
|
||||
"graphile-worker": "^0.13.0",
|
||||
"node-jose": "^2.2.0",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue