mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-10-08 03:47:51 +00:00
Merge pull request #1875 from molecula/cicd-will-it-never-end
Added docker build & rpm, deb packaging for linux arm64
This commit is contained in:
commit
8e775b88b9
6 changed files with 43 additions and 10 deletions
|
|
@ -201,8 +201,24 @@ package for linux amd64:
|
|||
- "*.deb"
|
||||
- "*.rpm"
|
||||
|
||||
# Build a FB Docker image with CI/CD and push to the GitLab registry.
|
||||
build container fb:
|
||||
package for linux arm64:
|
||||
stage: build
|
||||
image: golang:$GOVERSION
|
||||
rules:
|
||||
- if: '$CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "schedule" || $CI_PIPELINE_SOURCE == "web"'
|
||||
variables:
|
||||
GOOS: "linux"
|
||||
GOARCH: "arm64"
|
||||
script:
|
||||
- echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | tee /etc/apt/sources.list.d/goreleaser.list
|
||||
- apt update && apt install nfpm
|
||||
- make package
|
||||
artifacts:
|
||||
paths:
|
||||
- "*.deb"
|
||||
- "*.rpm"
|
||||
|
||||
build amd container fb:
|
||||
stage: build
|
||||
needs:
|
||||
- "build for linux amd64"
|
||||
|
|
@ -214,7 +230,23 @@ build container fb:
|
|||
- echo "${DOCKER_DEPLOY_TOKEN}" | docker login -u ${DOCKER_DEPLOY_USER} --password-stdin ${CI_REGISTRY}
|
||||
script:
|
||||
- tag=${CI_REGISTRY_IMAGE}/server:${CI_COMMIT_REF_SLUG}
|
||||
- docker build --build-arg GO_VERSION=$GOVERSION -t $tag -f .gitlab/Dockerfile .
|
||||
- docker build --build-arg GO_VERSION=$GOVERSION --build-arg ARCH=amd64 -t $tag -f .gitlab/Dockerfile .
|
||||
- docker push $tag
|
||||
- echo Created docker featurebase image with tag "$tag"
|
||||
|
||||
build arm container fb:
|
||||
stage: build
|
||||
needs:
|
||||
- "build for linux arm64"
|
||||
tags:
|
||||
- shell
|
||||
rules:
|
||||
- if: '$CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "schedule" || $CI_PIPELINE_SOURCE == "web"'
|
||||
before_script:
|
||||
- echo "${DOCKER_DEPLOY_TOKEN}" | docker login -u ${DOCKER_DEPLOY_USER} --password-stdin ${CI_REGISTRY}
|
||||
script:
|
||||
- tag=${CI_REGISTRY_IMAGE}/server-arm:${CI_COMMIT_REF_SLUG}
|
||||
- docker build --build-arg GO_VERSION=$GOVERSION --build-arg ARCH=arm64 -t $tag -f .gitlab/Dockerfile .
|
||||
- docker push $tag
|
||||
- echo Created docker featurebase image with tag "$tag"
|
||||
|
||||
|
|
@ -303,7 +335,6 @@ smoke test:
|
|||
- ./qa/scripts/teardownSmokeTest.sh
|
||||
needs:
|
||||
- job: build for linux arm64
|
||||
allow_failure: true
|
||||
artifacts:
|
||||
when: always
|
||||
paths:
|
||||
|
|
|
|||
|
|
@ -3,12 +3,14 @@ FROM alpine:3.14.2
|
|||
LABEL maintainer "dev@molecula.com"
|
||||
LABEL org.opencontainers.image.authors="dev@molecula.com"
|
||||
|
||||
ARG ARCH
|
||||
|
||||
WORKDIR /featurebase
|
||||
|
||||
RUN apk add --no-cache curl jq
|
||||
|
||||
COPY NOTICE .
|
||||
COPY featurebase_linux_amd64 .
|
||||
COPY featurebase_linux_$ARCH .
|
||||
|
||||
RUN chmod ugo+x .
|
||||
EXPOSE 10101
|
||||
|
|
|
|||
|
|
@ -18,5 +18,5 @@ else
|
|||
fi
|
||||
|
||||
$SCRIPT_DIR/setupSamsungGauntlet.sh
|
||||
#$SCRIPT_DIR/testSamsungGauntlet.sh
|
||||
#$SCRIPT_DIR/teardownSamsungGauntlet.sh
|
||||
$SCRIPT_DIR/testSamsungGauntlet.sh
|
||||
$SCRIPT_DIR/teardownSamsungGauntlet.sh
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ executeGeneralNodeConfigCommands() {
|
|||
|
||||
|
||||
# TODO handle different archs
|
||||
echo "Getting featurebase binary..."
|
||||
echo "Getting featurebase binary (https://gitlab.com/api/v4/projects/molecula%2Ffeaturebase/jobs/artifacts/${TF_VAR_branch}/raw/featurebase_linux_arm64?job=build%20for%20linux%20arm64)..."
|
||||
ssh -A -i ~/.ssh/gitlab-featurebase-ci.pem -o StrictHostKeyChecking=no ec2-user@${NODEIP} "curl --fail --header 'PRIVATE-TOKEN: ${TF_VAR_gitlab_token}' -o /home/ec2-user/featurebase_linux_arm64 https://gitlab.com/api/v4/projects/molecula%2Ffeaturebase/jobs/artifacts/${TF_VAR_branch}/raw/featurebase_linux_arm64?job=build%20for%20linux%20arm64"
|
||||
if (( $? != 0 ))
|
||||
then
|
||||
|
|
|
|||
|
|
@ -10,5 +10,5 @@ module "ci-cluster" {
|
|||
vpc_id = "vpc-05a26a122f961dc2b"
|
||||
vpc_cidr_block = "10.0.0.0/16"
|
||||
vpc_public_subnets = ["subnet-066b4b922b54e51a2","subnet-037b8884269a69025","subnet-08482631514426210",]
|
||||
vpc_private_subnets = ["subnet-050b1219d78f2db1b","subnet-07155281789c6d33b","subnet-0d623c769e086e46e",]
|
||||
vpc_private_subnets = ["subnet-0319dde319380326f","subnet-0517ca9a646d80f88","subnet-05a7b685ed27eb1cf",]
|
||||
}
|
||||
|
|
@ -12,5 +12,5 @@ module "samsung-cluster" {
|
|||
vpc_id = "vpc-05a26a122f961dc2b"
|
||||
vpc_cidr_block = "10.0.0.0/16"
|
||||
vpc_public_subnets = ["subnet-066b4b922b54e51a2","subnet-037b8884269a69025","subnet-08482631514426210",]
|
||||
vpc_private_subnets = ["subnet-050b1219d78f2db1b","subnet-0d623c769e086e46e","subnet-07155281789c6d33b",]
|
||||
vpc_private_subnets = ["subnet-0319dde319380326f","subnet-0517ca9a646d80f88","subnet-05a7b685ed27eb1cf",]
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue