diff --git a/.github/workflows/image-build.yaml b/.github/workflows/image-build.yaml deleted file mode 100644 index 34a8c40..0000000 --- a/.github/workflows/image-build.yaml +++ /dev/null @@ -1,81 +0,0 @@ -name: Build and Push Ansible Creator EE Image - -on: - push: - branches: - - 'devspaces-[0-9].[0-9]+-rhel-8' - - devspaces-3-rhel-8 - - workflow_call: - secrets: - QUAY_USERNAME: - required: true - QUAY_PASSWORD: - required: true - -jobs: - build_ansible_creator_ee_image: - runs-on: ubuntu-22.04 - steps: - - name: Checkout code - uses: actions/checkout@v3 - with: - token: ${{secrets.VSVYDENK_GITHUB_TOKEN}} - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: "Docker quay.io Login" - uses: docker/login-action@v2 - with: - registry: quay.io - username: ${{ secrets.QUAY_USERNAME }} - password: ${{ secrets.QUAY_PASSWORD }} - - - name: Check Commit Message - id: check_message - run: | - commit_message=$(git log --format=%B -n 1 ${{ github.sha }}) - prefix="chore(devfile):auto-update Ansible Creator EE image" - if [[ $commit_message == "$prefix"* ]]; then - echo "update_devfile=false" >> $GITHUB_OUTPUT - else - echo "update_devfile=true" >> $GITHUB_OUTPUT - fi - - - name: Build and push Docker image; Update image in devfile - if: steps.check_message.outputs.update_devfile == 'true' || github.actor == 'devstudio-release' - run: | - echo "Branch name: ${{ github.ref }}" - branch_name=${{ github.ref }} - branch_name=${branch_name#refs/heads/} - if [[ $branch_name == "devspaces-3-rhel-8" ]]; then - tag="latest" - else - tag=$(echo "$branch_name" | grep -o '[0-9]\+\.[0-9]\+') - fi - echo "Tag: $tag" - image_id=$(docker build -q -t "quay.io/devspaces/ansible-creator-ee:${tag}" .) - - short_sha=$(echo $image_id | cut -c8-12) - echo "Short SHA: $short_sha" - docker tag quay.io/devspaces/ansible-creator-ee:${tag} quay.io/devspaces/ansible-creator-ee:${tag}-${short_sha} - docker image push --all-tags quay.io/devspaces/ansible-creator-ee - - # rewrite devfile to update digest for ansible-creator-ee - docker pull quay.io/devspaces/ansible-creator-ee:${tag} - digest=$(docker inspect --format='{{index .RepoDigests 0}}' quay.io/devspaces/ansible-creator-ee:${tag}) - sed -r -i devfile.yaml -e "s|(image: .+devspaces/ansible-creator-ee.+)|image: ${digest}|g" - - - name: Set up Git - if: steps.check_message.outputs.update_devfile == 'true' || github.actor == 'devstudio-release' - run: | - git config --global user.email "vsvydenk@redhat.com" - git config --global user.name "Valerii Svydenko" - - - name: Commit and Push Changes - if: steps.check_message.outputs.update_devfile == 'true' || github.actor == 'devstudio-release' - run: | - git add . - git commit -m "chore(devfile):auto-update Ansible Creator EE image" - git push diff --git a/.yamllint b/.yamllint index cf86578..8e8a42e 100644 --- a/.yamllint +++ b/.yamllint @@ -15,8 +15,12 @@ rules: commas: max-spaces-after: -1 level: error - comments: enable - comments-indentation: enable + comments: + min-spaces-from-content: 1 + comments-indentation: false + octal-values: + forbid-implicit-octal: true + forbid-explicit-octal: true document-start: disable empty-lines: max: 3 diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index d295263..0000000 --- a/Dockerfile +++ /dev/null @@ -1,50 +0,0 @@ -# quay.io/ansible/creator-ee:v0.21.0 -FROM quay.io/ansible/creator-ee@sha256:bf95ae745601a9d199eeb12807be24413fc2d6488016069816ee74342c2c255b - -ENV HOME=/home/runner - -# install additional modules required by ansible -COPY requirements.txt requirements.txt -RUN pip3 install -r requirements.txt - -## install golang for pre-commit -RUN microdnf install -y go - -## kubectl -RUN \ - microdnf install -y which && \ - microdnf clean all && \ - curl -LO https://dl.k8s.io/release/`curl -LS https://dl.k8s.io/release/stable.txt`/bin/linux/amd64/kubectl && \ - chmod +x ./kubectl && \ - mv ./kubectl /usr/local/bin && \ - kubectl version --client - -## helm -RUN \ - TEMP_DIR="$(mktemp -d)" && \ - cd "${TEMP_DIR}" && \ - HELM_VERSION="3.7.0" && \ - HELM_ARCH="linux-amd64" && \ - HELM_TGZ="helm-v${HELM_VERSION}-${HELM_ARCH}.tar.gz" && \ - HELM_TGZ_URL="https://get.helm.sh/${HELM_TGZ}" && \ - curl -sSLO "${HELM_TGZ_URL}" && \ - curl -sSLO "${HELM_TGZ_URL}.sha256sum" && \ - sha256sum -c "${HELM_TGZ}.sha256sum" 2>&1 | grep OK && \ - tar -zxvf "${HELM_TGZ}" && \ - mv "${HELM_ARCH}"/helm /usr/local/bin/helm && \ - cd - && \ - rm -rf "${TEMP_DIR}" - -# nodejs 18 + VSCODE_NODEJS_RUNTIME_DIR are required on ubi9 based images -# until we fix https://github.com/eclipse/che/issues/21778 -# When fixed, we won't need this Dockerfile anymore. -# c.f. https://github.com/che-incubator/che-code/pull/120 -RUN \ -curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash && \ -export NVM_DIR="$HOME/.nvm" && \ -[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ -nvm install 18.18.0 -ENV VSCODE_NODEJS_RUNTIME_DIR="$HOME/.nvm/versions/node/v18.18.0/bin/" - -# Set permissions on /etc/passwd and /home to allow arbitrary users to write -RUN chgrp -R 0 /home && chmod -R g=u /etc/passwd /etc/group /home diff --git a/README.md b/README.md index 1a90892..5db5ef7 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ To get started with OpenShift Dev Spaces, refer to the [OpenShift Dev Spaces doc ## Base Image Of Devfile -Ultimately we intend to use the [ansible creator image](https://github.com/ansible/creator-ee) as the base image, however there are currently some [technical blockers](https://github.com/eclipse/che/issues/21778) to doing that. The `Dockerfile` in this repo is that of the image we are currently pulling down for reference. +[Community Ansible Dev Spaces Image](https://github.com/ansible/community-ansible-devspaces-image) is used as an image for Ansible development and it's defined in the `devfile.yaml`. ### GitHub OAuth2 diff --git a/devfile.yaml b/devfile.yaml index 444362b..fed9275 100644 --- a/devfile.yaml +++ b/devfile.yaml @@ -4,7 +4,7 @@ metadata: components: - name: tooling-container container: - image: quay.io/devspaces/ansible-creator-ee@sha256:a1d053d24f0b80438568bd4e06437900f0afe0ae29fcfa749bbace5cfff8c2ca + image: ghcr.io/ansible/ansible-workspace-env-reference@sha256:f02448b3b8423cfedf2773bb2dc8c21e2bf3a00c3df6e501916af2c5467a93f2 memoryRequest: 256M memoryLimit: 6Gi cpuRequest: 250m diff --git a/playbooks/install_oc.yml b/playbooks/install_oc.yml index 1cce46b..d94e8cf 100644 --- a/playbooks/install_oc.yml +++ b/playbooks/install_oc.yml @@ -18,13 +18,13 @@ ansible.builtin.file: path: "{{ molecule_user_home_dir }}/bin" state: directory - mode: 0770 + mode: a+x - name: Download oc binary from OCP downloads svc endpoint ansible.builtin.get_url: url: http://downloads.openshift-console.svc.cluster.local/amd64/linux/oc dest: "{{ molecule_user_home_dir }}/bin/oc" - mode: '0770' + mode: a+x - name: Add another bin dir to system-wide $PATH. ansible.builtin.lineinfile: diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 7ca710b..0000000 --- a/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -kubernetes==26.1.0 -ansible-navigator==3.5.0 -pre-commit==3.6.0 -ansible-creator -