diff --git a/.circleci/config.yml b/.circleci/config.yml index 5bfdbd6ac8..b7f3585b65 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -28,25 +28,33 @@ jobs: # muffet (https://github.com/raviqqe/muffet) to perform the link check. website_link_check: docker: - # This image's Dockerfile is at runatlantis.io/Dockerfile - - image: ghcr.io/runatlantis/ci-link-checker:2021.06.22 + - image: cimg/node:18.12.1 + environment: + # renovate: datasource=github-releases depName=raviqqe/terraform + MUFFET_VERSION: 2.6.2 steps: - checkout + - run: | + # http-server is used to serve the website locally as muffet checks it. + yarn global add http-server + # install raviqqe/muffet to check for broken links. + curl -L https://github.com/raviqqe/muffet/releases/download/v${MUFFET_VERSION}/muffet_${MUFFET_VERSION}_Linux_x86_64.tar.gz | tar -xz - run: yarn install - run: yarn website:build - run: name: http-server command: http-server runatlantis.io/.vuepress/dist background: true - # We use dockerize -wait here to wait until the server is up. + - run: + name: wait until server listened + command: curl --retry-delay 1 --retry 30 --retry-all-error http://localhost:8080 - run: | - dockerize -wait tcp://localhost:8080 -- \ - muffet \ - -e 'https://github\.com/runatlantis/atlantis/edit/main/.*' \ - -e 'https://github.com/runatlantis/helm-charts#customization' \ - --header 'Accept-Encoding:deflate, gzip' \ - --buffer-size 8192 \ - http://localhost:8080/ + ./muffet \ + -e 'https://github\.com/runatlantis/atlantis/edit/main/.*' \ + -e 'https://github.com/runatlantis/helm-charts#customization' \ + --header 'Accept-Encoding:deflate, gzip' \ + --buffer-size 8192 \ + http://localhost:8080/ workflows: version: 2 diff --git a/.github/website_link_checker/Dockerfile b/.github/website_link_checker/Dockerfile deleted file mode 100644 index 1c53ac11f4..0000000000 --- a/.github/website_link_checker/Dockerfile +++ /dev/null @@ -1,16 +0,0 @@ -# This Dockerfile builds runatlantis/ci-link-checker. -# It is used in CircleCI to check if the website has any broken links. -FROM node:18 -ENV DOCKERIZE_VERSION v0.6.1 - -# Muffet is used to check for broken links. -COPY --from=raviqqe/muffet:2.6.2 muffet /usr/local/bin/muffet - -# http-server is used to serve the website locally as muffet checks it. -RUN yarn global add http-server - -# Dockerize is used to wait until the server is up and running before running -# muffet. -RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ - && tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ - && rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz diff --git a/.github/workflows/ci-link-checker-image.yml b/.github/workflows/ci-link-checker-image.yml deleted file mode 100644 index 8b8efab170..0000000000 --- a/.github/workflows/ci-link-checker-image.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: ci-link-checker-image - -on: - push: - paths: - - '.github/website_link_checker/**' - branches: - - "main" - workflow_dispatch: - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -defaults: - run: - working-directory: .github/website_link_checker - -jobs: - build: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3 - - name: Login to Packages Container registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - run: echo "TODAY=$(date +"%Y.%m.%d")" >> $GITHUB_ENV - - name: build ci-link-checker:${{env.TODAY}} image - run: | - docker build -t ghcr.io/runatlantis/ci-link-checker:${{env.TODAY}} . - - name: publish ci-link-checker:${{env.TODAY}} image - run: | - docker push ghcr.io/runatlantis/ci-link-checker:${{env.TODAY}} - docker tag ghcr.io/runatlantis/ci-link-checker:${{env.TODAY}} ghcr.io/runatlantis/ci-link-checker:latest - docker push ghcr.io/runatlantis/ci-link-checker:latest