diff --git a/.drone.star b/.drone.star deleted file mode 100644 index 2072c11..0000000 --- a/.drone.star +++ /dev/null @@ -1,121 +0,0 @@ -def main(ctx): - return [ - lint(), - test("2_php8.1", "2-php8.1"), - test("2_php8.2", "2-php8.2"), - test("2_php8.3", "2-php8.3"), - test("2_php8.4", "2-php8.4"), - release("2_php8.1", "2-php8.1", app_env = "php8.1"), - release("2_php8.2", "2-php8.2", app_env = "php8.2"), - release("2_php8.3", "2-php8.3", app_env = "php8.3"), - release("2_php8.4", "2-php8.4", app_env = "php8.4", custom_tags = "latest"), - ] - -def lint(): - return { - "kind": "pipeline", - "type": "docker", - "name": "lint", - "steps": [ - { - "name": "Lint Dockerfiles", - "image": "hadolint/hadolint:latest-debian", - "pull": "if-not-exists", - "commands": [ - "hadolint --version", - "hadolint */Dockerfile", - ], - }, - ], - "trigger": { - "event": [ - "pull_request", - "push", - ], - "ref": { - "exclude": [ - "refs/heads/renovate/*", - ], - }, - }, - } - -def test(name, composer_variant, dockerfile = "Dockerfile"): - return { - "kind": "pipeline", - "type": "docker", - "name": "test_%s" % name, - "steps": [ - { - "name": "build test", - "image": "plugins/docker", - "pull": "if-not-exists", - "settings": { - "dockerfile": "%s/%s" % (composer_variant, dockerfile), - "username": { - "from_secret": "dockerhub_username", - }, - "password": { - "from_secret": "dockerhub_password_ro", - }, - "dry_run": "true", - "repo": "mwalbeck/composer", - }, - }, - ], - "trigger": { - "event": [ - "pull_request", - ], - }, - "depends_on": [ - "lint", - ], - } - -def release(name, composer_variant, dockerfile = "Dockerfile", app_env = "", custom_tags = ""): - return { - "kind": "pipeline", - "type": "docker", - "name": "release_%s" % name, - "steps": [ - { - "name": "determine tags", - "image": "mwalbeck/determine-docker-tags", - "pull": "if-not-exists", - "environment": { - "VERSION_TYPE": "docker_env", - "APP_NAME": "COMPOSER", - "DOCKERFILE_PATH": "%s/%s" % (composer_variant, dockerfile), - "APP_ENV": app_env, - "CUSTOM_TAGS": custom_tags, - }, - }, - { - "name": "build and publish", - "image": "plugins/docker", - "pull": "if-not-exists", - "settings": { - "dockerfile": "%s/%s" % (composer_variant, dockerfile), - "username": { - "from_secret": "dockerhub_username", - }, - "password": { - "from_secret": "dockerhub_password", - }, - "repo": "mwalbeck/composer", - }, - }, - ], - "trigger": { - "branch": [ - "master", - ], - "event": [ - "push", - ], - }, - "depends_on": [ - "lint", - ], - } diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index 65051a7..0000000 --- a/.drone.yml +++ /dev/null @@ -1,303 +0,0 @@ ---- -kind: pipeline -type: docker -name: lint - -platform: - os: linux - arch: amd64 - -steps: -- name: Lint Dockerfiles - pull: if-not-exists - image: hadolint/hadolint:latest-debian - commands: - - hadolint --version - - hadolint */Dockerfile - -trigger: - event: - - pull_request - - push - ref: - exclude: - - refs/heads/renovate/* - ---- -kind: pipeline -type: docker -name: test_2_php8.1 - -platform: - os: linux - arch: amd64 - -steps: -- name: build test - pull: if-not-exists - image: plugins/docker - settings: - dockerfile: 2-php8.1/Dockerfile - dry_run: true - password: - from_secret: dockerhub_password_ro - repo: mwalbeck/composer - username: - from_secret: dockerhub_username - -trigger: - event: - - pull_request - -depends_on: -- lint - ---- -kind: pipeline -type: docker -name: test_2_php8.2 - -platform: - os: linux - arch: amd64 - -steps: -- name: build test - pull: if-not-exists - image: plugins/docker - settings: - dockerfile: 2-php8.2/Dockerfile - dry_run: true - password: - from_secret: dockerhub_password_ro - repo: mwalbeck/composer - username: - from_secret: dockerhub_username - -trigger: - event: - - pull_request - -depends_on: -- lint - ---- -kind: pipeline -type: docker -name: test_2_php8.3 - -platform: - os: linux - arch: amd64 - -steps: -- name: build test - pull: if-not-exists - image: plugins/docker - settings: - dockerfile: 2-php8.3/Dockerfile - dry_run: true - password: - from_secret: dockerhub_password_ro - repo: mwalbeck/composer - username: - from_secret: dockerhub_username - -trigger: - event: - - pull_request - -depends_on: -- lint - ---- -kind: pipeline -type: docker -name: test_2_php8.4 - -platform: - os: linux - arch: amd64 - -steps: -- name: build test - pull: if-not-exists - image: plugins/docker - settings: - dockerfile: 2-php8.4/Dockerfile - dry_run: true - password: - from_secret: dockerhub_password_ro - repo: mwalbeck/composer - username: - from_secret: dockerhub_username - -trigger: - event: - - pull_request - -depends_on: -- lint - ---- -kind: pipeline -type: docker -name: release_2_php8.1 - -platform: - os: linux - arch: amd64 - -steps: -- name: determine tags - pull: if-not-exists - image: mwalbeck/determine-docker-tags - environment: - APP_ENV: php8.1 - APP_NAME: COMPOSER - DOCKERFILE_PATH: 2-php8.1/Dockerfile - VERSION_TYPE: docker_env - -- name: build and publish - pull: if-not-exists - image: plugins/docker - settings: - dockerfile: 2-php8.1/Dockerfile - password: - from_secret: dockerhub_password - repo: mwalbeck/composer - username: - from_secret: dockerhub_username - -trigger: - branch: - - master - event: - - push - -depends_on: -- lint - ---- -kind: pipeline -type: docker -name: release_2_php8.2 - -platform: - os: linux - arch: amd64 - -steps: -- name: determine tags - pull: if-not-exists - image: mwalbeck/determine-docker-tags - environment: - APP_ENV: php8.2 - APP_NAME: COMPOSER - DOCKERFILE_PATH: 2-php8.2/Dockerfile - VERSION_TYPE: docker_env - -- name: build and publish - pull: if-not-exists - image: plugins/docker - settings: - dockerfile: 2-php8.2/Dockerfile - password: - from_secret: dockerhub_password - repo: mwalbeck/composer - username: - from_secret: dockerhub_username - -trigger: - branch: - - master - event: - - push - -depends_on: -- lint - ---- -kind: pipeline -type: docker -name: release_2_php8.3 - -platform: - os: linux - arch: amd64 - -steps: -- name: determine tags - pull: if-not-exists - image: mwalbeck/determine-docker-tags - environment: - APP_ENV: php8.3 - APP_NAME: COMPOSER - DOCKERFILE_PATH: 2-php8.3/Dockerfile - VERSION_TYPE: docker_env - -- name: build and publish - pull: if-not-exists - image: plugins/docker - settings: - dockerfile: 2-php8.3/Dockerfile - password: - from_secret: dockerhub_password - repo: mwalbeck/composer - username: - from_secret: dockerhub_username - -trigger: - branch: - - master - event: - - push - -depends_on: -- lint - ---- -kind: pipeline -type: docker -name: release_2_php8.4 - -platform: - os: linux - arch: amd64 - -steps: -- name: determine tags - pull: if-not-exists - image: mwalbeck/determine-docker-tags - environment: - APP_ENV: php8.4 - APP_NAME: COMPOSER - CUSTOM_TAGS: latest - DOCKERFILE_PATH: 2-php8.4/Dockerfile - VERSION_TYPE: docker_env - -- name: build and publish - pull: if-not-exists - image: plugins/docker - settings: - dockerfile: 2-php8.4/Dockerfile - password: - from_secret: dockerhub_password - repo: mwalbeck/composer - username: - from_secret: dockerhub_username - -trigger: - branch: - - master - event: - - push - -depends_on: -- lint - ---- -kind: signature -hmac: fcc372edef5a413432143b6d9eb88cd8424d73d901013787350f6011ce9fde31 - -... diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml new file mode 100644 index 0000000..9fdc9e9 --- /dev/null +++ b/.forgejo/workflows/build.yml @@ -0,0 +1,136 @@ +name: Build and publish + +on: + push: + branches: + - main + +jobs: + lint: + runs-on: docker + steps: + - uses: actions/checkout@v4 + - uses: https://github.com/hadolint/hadolint-action@v3.1.0 + with: + dockerfile: Dockerfile + recursive: true + + php8_1: + runs-on: dind + steps: + - uses: actions/checkout@v4 + - name: Get docker tags + id: tags + shell: sh + env: + VERSION_TYPE: "docker_env" + APP_ENV: "php8.1" + APP_NAME: "COMPOSER" + DOCKERFILE_PATH: "php8.1/Dockerfile" + IMAGE_NAME: "mwalbeck/composer" + run: | + determine-docker-tags + dockerd & + - name: Login to Docker Hub + uses: https://github.com/docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Set up Docker Buildx + uses: https://github.com/docker/setup-buildx-action@v3 + - name: Build and push + uses: https://github.com/docker/build-push-action@v6 + with: + push: true + tags: ${{ steps.tags.outputs.tags }} + context: ./php8.1 + + php8_2: + runs-on: dind + steps: + - uses: actions/checkout@v4 + - name: Get docker tags + id: tags + shell: sh + env: + VERSION_TYPE: "docker_env" + APP_ENV: "php8.2" + APP_NAME: "COMPOSER" + DOCKERFILE_PATH: "php8.2/Dockerfile" + IMAGE_NAME: "mwalbeck/composer" + run: | + determine-docker-tags + dockerd & + - name: Login to Docker Hub + uses: https://github.com/docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Set up Docker Buildx + uses: https://github.com/docker/setup-buildx-action@v3 + - name: Build and push + uses: https://github.com/docker/build-push-action@v6 + with: + push: true + tags: ${{ steps.tags.outputs.tags }} + context: ./php8.2 + + php8_3: + runs-on: dind + steps: + - uses: actions/checkout@v4 + - name: Get docker tags + id: tags + shell: sh + env: + VERSION_TYPE: "docker_env" + APP_ENV: "php8.3" + APP_NAME: "COMPOSER" + DOCKERFILE_PATH: "php8.3/Dockerfile" + IMAGE_NAME: "mwalbeck/composer" + run: | + determine-docker-tags + dockerd & + - name: Login to Docker Hub + uses: https://github.com/docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Set up Docker Buildx + uses: https://github.com/docker/setup-buildx-action@v3 + - name: Build and push + uses: https://github.com/docker/build-push-action@v6 + with: + push: true + tags: ${{ steps.tags.outputs.tags }} + context: ./php8.3 + + php8_4: + runs-on: dind + steps: + - uses: actions/checkout@v4 + - name: Get docker tags + id: tags + shell: sh + env: + VERSION_TYPE: "docker_env" + APP_ENV: "php8.4" + APP_NAME: "COMPOSER" + DOCKERFILE_PATH: "php8.4/Dockerfile" + IMAGE_NAME: "mwalbeck/composer" + run: | + determine-docker-tags + dockerd & + - name: Login to Docker Hub + uses: https://github.com/docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Set up Docker Buildx + uses: https://github.com/docker/setup-buildx-action@v3 + - name: Build and push + uses: https://github.com/docker/build-push-action@v6 + with: + push: true + tags: ${{ steps.tags.outputs.tags }} + context: ./php8.4 \ No newline at end of file diff --git a/.forgejo/workflows/test.yml b/.forgejo/workflows/test.yml new file mode 100644 index 0000000..4e2520a --- /dev/null +++ b/.forgejo/workflows/test.yml @@ -0,0 +1,110 @@ +name: Test + +on: pull_request + +jobs: + lint: + if: github.ref != 'refs/heads/renovate/*' + runs-on: docker + steps: + - uses: actions/checkout@v4 + - uses: https://github.com/hadolint/hadolint-action@v3.1.0 + with: + dockerfile: Dockerfile + recursive: true + + php8_1: + runs-on: dind + steps: + - uses: actions/checkout@v4 + - name: Get docker tags + id: tags + shell: sh + env: + VERSION_TYPE: "docker_env" + APP_ENV: "php8.1" + APP_NAME: "COMPOSER" + DOCKERFILE_PATH: "php8.1/Dockerfile" + IMAGE_NAME: "mwalbeck/composer" + run: | + determine-docker-tags + dockerd & + - name: Set up Docker Buildx + uses: https://github.com/docker/setup-buildx-action@v3 + - name: Test build + uses: https://github.com/docker/build-push-action@v6 + with: + tags: ${{ steps.tags.outputs.tags }} + context: ./php8.1 + + php8_2: + runs-on: dind + steps: + - uses: actions/checkout@v4 + - name: Get docker tags + id: tags + shell: sh + env: + VERSION_TYPE: "docker_env" + APP_ENV: "php8.2" + APP_NAME: "COMPOSER" + DOCKERFILE_PATH: "php8.2/Dockerfile" + IMAGE_NAME: "mwalbeck/composer" + run: | + determine-docker-tags + dockerd & + - name: Set up Docker Buildx + uses: https://github.com/docker/setup-buildx-action@v3 + - name: Test build + uses: https://github.com/docker/build-push-action@v6 + with: + tags: ${{ steps.tags.outputs.tags }} + context: ./php8.2 + + php8_3: + runs-on: dind + steps: + - uses: actions/checkout@v4 + - name: Get docker tags + id: tags + shell: sh + env: + VERSION_TYPE: "docker_env" + APP_ENV: "php8.3" + APP_NAME: "COMPOSER" + DOCKERFILE_PATH: "php8.3/Dockerfile" + IMAGE_NAME: "mwalbeck/composer" + run: | + determine-docker-tags + dockerd & + - name: Set up Docker Buildx + uses: https://github.com/docker/setup-buildx-action@v3 + - name: Test build + uses: https://github.com/docker/build-push-action@v6 + with: + tags: ${{ steps.tags.outputs.tags }} + context: ./php8.3 + + php8_4: + runs-on: dind + steps: + - uses: actions/checkout@v4 + - name: Get docker tags + id: tags + shell: sh + env: + VERSION_TYPE: "docker_env" + APP_ENV: "php8.4" + APP_NAME: "COMPOSER" + DOCKERFILE_PATH: "php8.4/Dockerfile" + IMAGE_NAME: "mwalbeck/composer" + run: | + determine-docker-tags + dockerd & + - name: Set up Docker Buildx + uses: https://github.com/docker/setup-buildx-action@v3 + - name: Test build + uses: https://github.com/docker/build-push-action@v6 + with: + tags: ${{ steps.tags.outputs.tags }} + context: ./php8.4 diff --git a/2-php8.1/Dockerfile b/php8.1/Dockerfile similarity index 100% rename from 2-php8.1/Dockerfile rename to php8.1/Dockerfile diff --git a/2-php8.2/Dockerfile b/php8.2/Dockerfile similarity index 100% rename from 2-php8.2/Dockerfile rename to php8.2/Dockerfile diff --git a/2-php8.3/Dockerfile b/php8.3/Dockerfile similarity index 100% rename from 2-php8.3/Dockerfile rename to php8.3/Dockerfile diff --git a/2-php8.4/Dockerfile b/php8.4/Dockerfile similarity index 100% rename from 2-php8.4/Dockerfile rename to php8.4/Dockerfile