diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index 461e205d..1cacdafb 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -15,13 +15,15 @@ jobs: - name: Docker meta id: docker_meta - uses: crazy-max/ghaction-docker-meta@v1 + uses: docker/metadata-action@v3 with: # list of Docker images to use as base name for tags images: | ergw/ergw-c-node # add git short SHA as Docker tag - tag-sha: true + tags: | + type=sha + type=semver,pattern={{version}} - name: Set up QEMU uses: docker/setup-qemu-action@v1 diff --git a/.github/workflows/quay.yaml b/.github/workflows/quay.yaml new file mode 100644 index 00000000..140c87ac --- /dev/null +++ b/.github/workflows/quay.yaml @@ -0,0 +1,61 @@ +name: quay.io + +on: push + +jobs: + docker: + runs-on: ubuntu-20.04 + steps: + - + name: Checkout + uses: actions/checkout@v2 + - + name: Expire Labels + id: expire + run: | + case ${{ github.ref }} in + refs/tags/*) export EXPIRE="";; + *) export EXPIRE="quay.expires-after=7d";; + esac + echo ::set-output name=expire::${EXPIRE} + echo ::set-output name=sha::$(git rev-parse --short HEAD) + - + name: Docker meta + id: docker_meta + uses: docker/metadata-action@v3 + with: + # list of Docker images to use as base name for tags + images: | + quay.io/travelping/ergw-c-node + # add git short SHA as Docker tag + tags: | + type=ref,event=branch,suffix=-${{ steps.expire.outputs.sha }} + type=semver,pattern={{version}} + labels: | + ${{ steps.expire.outputs.expire }} + - + name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - + name: Login to Quay.io + uses: docker/login-action@v1 + with: + registry: quay.io + username: ${{ secrets.QUAY_USER_ID }} + password: ${{ secrets.QUAY_TOKEN }} + - + name: Build and push + uses: docker/build-push-action@v2 + with: + context: . + file: ./docker/Dockerfile + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ steps.docker_meta.outputs.tags }} + labels: ${{ steps.docker_meta.outputs.labels }} + - + name: Image digest + run: echo ${{ steps.docker_build.outputs.digest }} diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 82540ac5..00000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,139 +0,0 @@ -stages: - - prepare - - test - - container - -.check:otp: &check_otp - stage: test - image: erlang - services: - - quay.io/travelping/ergw-dns-test-server:latest - artifacts: - when: always - untracked: true - paths: - - _build - reports: - junit: _build/test/logs/report.xml - before_script: - - apk update - - apk --no-cache upgrade - - | - apk --no-cache add gcc git libc-dev libc-utils libgcc linux-headers make bash \ - musl-dev musl-utils ncurses-dev pcre2 pkgconf scanelf wget \ - zip iproute2 zlib curl yaml-dev - script: - - export CI_DNS_SERVER=127.0.0.1 - - cat /etc/hosts - - ss -aun - - sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6' - - ip addr add fd96:dcd2:efdb:41c3::10:1/64 dev lo - - ip addr add fd96:dcd2:efdb:41c3::10:2/64 dev lo - - ip addr add fd96:dcd2:efdb:41c3::10:3/64 dev lo - - ip addr add fd96:dcd2:efdb:41c3::10:4/64 dev lo - - ip addr add fd96:dcd2:efdb:41c3::20:1/64 dev lo - - ip addr add fd96:dcd2:efdb:41c3::20:2/64 dev lo - - ip addr add fd96:dcd2:efdb:41c3::20:3/64 dev lo - - ip addr add fd96:dcd2:efdb:41c3::20:4/64 dev lo - - ip addr add fd96:dcd2:efdb:41c3::20:5/64 dev lo - - ip addr add fd96:dcd2:efdb:41c3::20:6/64 dev lo - - ip addr add fd96:dcd2:efdb:41c3::20:7/64 dev lo - - ip addr add fd96:dcd2:efdb:41c3::20:8/64 dev lo - - ip addr add fd96:dcd2:efdb:41c3::20:9/64 dev lo - - ip addr add fd96:dcd2:efdb:41c3::100:1/64 dev lo - - ip addr add fd96:dcd2:efdb:41c3::100:2/64 dev lo - - ip addr add fd96:dcd2:efdb:41c3::100:3/64 dev lo - - ip addr add fd96:dcd2:efdb:41c3::100:4/64 dev lo - - ip addr add fd96:dcd2:efdb:41c3::100:5/64 dev lo - - ip addr add fd96:dcd2:efdb:41c3::100:6/64 dev lo - - ip addr add fd96:dcd2:efdb:41c3::100:7/64 dev lo - - ip addr add fd96:dcd2:efdb:41c3::100:8/64 dev lo - - ip addr add fd96:dcd2:efdb:41c3::100:9/64 dev lo - - ip addr add fd96:dcd2:efdb:41c3::200:1/64 dev lo - - ip addr add fd96:dcd2:efdb:41c3::200:2/64 dev lo - - ip addr add fd96:dcd2:efdb:41c3::200:3/64 dev lo - - ip addr add fd96:dcd2:efdb:41c3::300:1/64 dev lo - - ip addr add fd96:dcd2:efdb:41c3::300:2/64 dev lo - - ip addr add fd96:dcd2:efdb:41c3::300:3/64 dev lo - - ip addr add fd96:dcd2:efdb:41c3::400:1/64 dev lo - - ip addr add fd96:dcd2:efdb:41c3::400:2/64 dev lo - - ip addr add fd96:dcd2:efdb:41c3::400:3/64 dev lo - - rebar3 do xref - - rebar3 do ct - - rebar3 do ct --name test@127.0.0.1 --suite=apps/ergw_core/test/pgw_dist_SUITE - -check:otp-23.0: - <<: *check_otp - image: erlang:23.0.4-alpine - -check:otp-23.1: - <<: *check_otp - image: erlang:23.1.5.0-alpine - -check:otp-23.2: - <<: *check_otp - image: erlang:23.2.7.0-alpine - -check:otp-24.0: - <<: *check_otp - image: erlang:24.0-rc1.0.0-alpine - -docker: - image: jdrouet/docker-with-buildx:stable - stage: container - dependencies: [] - variables: - REGISTRY: "quay.io" - BUILD_IMAGE: "travelping/ergw-c-node" - services: - - docker:dind - - linuxkit/binfmt:v0.8 - script: - - export CI_COMMIT_DESCRIBE=$(git describe) - - | - case "$CI_COMMIT_REF_NAME" in - master | stable/*) export LABELS="";; - *) export LABELS="--label quay.expires-after=7d";; - esac - - | - if [ $CI_COMMIT_REF_NAME == "master" ] ; then - export TAGS="-t ${REGISTRY}/${BUILD_IMAGE}:${CI_COMMIT_DESCRIBE}" - else - export TAGS="-t ${REGISTRY}/${BUILD_IMAGE}:${CI_COMMIT_REF_SLUG}_${CI_COMMIT_DESCRIBE}" - fi - - docker login -u ${QUAY_USER_ID} -p ${QUAY_TOKEN} ${REGISTRY} - - | - docker buildx build \ - -f docker/Dockerfile \ - ${TAGS} \ - ${LABELS} \ - --platform=linux/arm64,linux/amd64 \ - --push --no-cache . - when: always - -dns-server: - image: jdrouet/docker-with-buildx:stable - stage: prepare - dependencies: [] - variables: - REGISTRY: "quay.io" - BUILD_IMAGE: "travelping/ergw-dns-test-server" - services: - - docker:dind - - linuxkit/binfmt:v0.8 - script: - - docker version - - docker buildx ls - - docker buildx inspect --bootstrap - - docker login -u ${QUAY_USER_ID} -p ${QUAY_TOKEN} ${REGISTRY} - - | - cd docker/dns-test-server - docker buildx build \ - -t ${REGISTRY}/${BUILD_IMAGE}:latest \ - --platform=linux/arm64,linux/amd64 \ - --push --no-cache \ - -f Dockerfile . - only: - changes: - - docker/dns-test-server/Dockerfile - - docker/dns-test-server/dns_data/*