Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions .github/workflows/docker-image-build-pull-request.yml

This file was deleted.

41 changes: 0 additions & 41 deletions .github/workflows/docker-publish.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rabbitmq:3.13.7
FROM rabbitmq:3.13.7-alpine
RUN rabbitmq-plugins enable --offline rabbitmq_management
RUN rabbitmq-plugins enable --offline rabbitmq_stomp
RUN rabbitmq-plugins enable --offline rabbitmq_web_stomp
Expand Down
74 changes: 74 additions & 0 deletions pipelines/azure-pipelines.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@

name: $(date:yyyyMMdd)-$(rev:.r)

parameters:
- name: publish_docker
displayName: 'Publish Docker Container ???'
type: string
default: 'false'
values:
- true
- false

trigger:
branches:
include:
- refs/heads/master
- refs/heads/main

resources:
repositories:
- repository: self

variables:
- group: GITHUB-PAT-TOKEN
- name: PUBLISH_DOCKER
value: ${{parameters.publish_docker}}
- name: VM_IMAGE
value: ubuntu-latest
- name: IMAGE_NAME
value: "think-cube/docker-rabbitmq-stomp"

pool:
vmImage: $(VM_IMAGE)

stages:
- stage: TestBuild
condition: eq('${{parameters.publish_docker}}', 'false')
displayName: "Build Docker Image"
jobs:
- job: Build
steps:
- script: echo "##vso[task.setvariable variable=IMAGE_TAG]$(date +%Y%m%d)"
displayName: "Set IMAGE_TAG variable"

- task: Docker@2
inputs:
repository: '$(IMAGE_NAME)'
command: 'build'
Dockerfile: 'Dockerfile'
tags: '$(IMAGE_TAG)'

- stage: BuildAndPush
condition: eq('${{parameters.publish_docker}}', 'true')
displayName: "Push Docker Image"
jobs:
- job: Push
steps:
- checkout: self
- script: echo "##vso[task.setvariable variable=IMAGE_TAG]$(date +%Y%m%d)"
displayName: "Set IMAGE_TAG variable"
- task: Docker@2
inputs:
command: 'login'
containerRegistry: 'ghcr.io'
username: '$(USERNAME)'
password: '$(TOKEN-FOR-GHCR)'

- task: Docker@2
inputs:
containerRegistry: 'ghcr.io'
repository: '$(IMAGE_NAME)'
command: 'buildAndPush'
Dockerfile: 'Dockerfile'
tags: '$(IMAGE_TAG)'