Skip to content

Commit

Permalink
feat(ci): add a sfp-lite docker image just containing sfp
Browse files Browse the repository at this point in the history
  • Loading branch information
azlam-abdulsalam committed Oct 28, 2023
1 parent 044310f commit 0699e51
Show file tree
Hide file tree
Showing 3 changed files with 124 additions and 11 deletions.
64 changes: 54 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,20 @@ jobs:
username: ${{ secrets.DOCKER_USERNAME }}
token: ${{ secrets.DOCKER_SECRET }}
needs: [ build ]

build-docker-lite:
name: 'build sfp lite docker image'
uses: ./.github/workflows/sfpowerscripts-build-docker.yml
with:
job-environment: 'build-docker'
suffix-tag: ${{ github.run_id }}
repo: 'dxatscale'
dockerFileName: 'sfp-lite'
image: 'sfp-lite-rc'
secrets:
username: ${{ secrets.DOCKER_USERNAME }}
token: ${{ secrets.DOCKER_SECRET }}
needs: [ build ]

#Promotion Stages

Expand Down Expand Up @@ -82,6 +96,19 @@ jobs:
token: ${{ secrets.DOCKER_SECRET }}
needs: [ build-docker ]

alpha-docker-lite:
name: 'promote docker to alpha'
uses: ./.github/workflows/sfpowerscripts-promote-docker.yml
with:
job-environment: 'sfpowerscripts-alpha-docker'
repo: 'dxatscale'
new-tag: alpha
image: 'sfp-lite-rc'
secrets:
username: ${{ secrets.DOCKER_USERNAME }}
token: ${{ secrets.DOCKER_SECRET }}
needs: [ build-docker ]


sfpowerscripts-beta:
name: 'sfpowerscripts beta'
Expand All @@ -95,6 +122,19 @@ jobs:
needs: [ build ]

beta-docker:
name: 'promote docker to beta'
uses: ./.github/workflows/sfpowerscripts-promote-docker.yml
with:
job-environment: 'sfpowerscripts-beta-docker'
repo: 'dxatscale'
new-tag: beta
image: 'sfp-lite-rc'
secrets:
username: ${{ secrets.DOCKER_USERNAME }}
token: ${{ secrets.DOCKER_SECRET }}
needs: [ build-docker ]

beta-docker-lite:
name: 'promote docker to beta'
uses: ./.github/workflows/sfpowerscripts-promote-docker.yml
with:
Expand All @@ -107,6 +147,7 @@ jobs:
token: ${{ secrets.DOCKER_SECRET }}
needs: [ build-docker ]




sfpowerscripts-prod:
Expand All @@ -120,19 +161,20 @@ jobs:
npm-token: ${{ secrets.NPM_TOKEN }}
needs: [ build ]

sfp-prod:
name: 'sfp prod'
uses: ./.github/workflows/promotePackage.yml
prod-docker:
name: 'copy rc docker to prod'
uses: ./.github/workflows/sfpowerscripts-copy-docker.yml
with:
version: 'latest'
pathToPackageJson: 'packages/sfp-cli/package.json'
environment: sfp-prod
job-environment: 'sfpowerscripts-prod-docker'
secrets:
npm-token: ${{ secrets.NPM_TOKEN }}
needs: [ build ]
username: ${{ secrets.DOCKER_USERNAME }}
token: ${{ secrets.DOCKER_SECRET }}
signing_secret: ${{ secrets.SIGNING_SECRET }}
cosign_password: ${{ secrets.COSIGN_PASSWORD }}
needs: [ build-docker ]

prod-docker:
name: 'copy rc docker to prod'
prod-docker-lite:
name: 'copy rc lite docker to prod'
uses: ./.github/workflows/sfpowerscripts-copy-docker.yml
with:
job-environment: 'sfpowerscripts-prod-docker'
Expand All @@ -141,6 +183,8 @@ jobs:
token: ${{ secrets.DOCKER_SECRET }}
signing_secret: ${{ secrets.SIGNING_SECRET }}
cosign_password: ${{ secrets.COSIGN_PASSWORD }}
image: sfp-lite-rc
image-as: sfp-lite
needs: [ build-docker ]


6 changes: 5 additions & 1 deletion .github/workflows/sfpowerscripts-build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on:
repo:
type: string
required: true
dockerFileName:
type: string
required: false
default: sfpowerscripts
image:
type: string
required: false
Expand Down Expand Up @@ -70,7 +74,7 @@ jobs:
id: docker_build
uses: docker/build-push-action@v2
with:
file: dockerfiles/sfpowerscripts.Dockerfile
file: dockerfiles/${{inputs.dockerFileName}}.Dockerfile
context: dockerfiles
push: true
labels: ${{ steps.meta.outputs.labels }}
Expand Down
65 changes: 65 additions & 0 deletions dockerfiles/sfp-lite.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
FROM ubuntu:22.04


ARG SFPOWERSCRIPTS_VERSION=alpha
ARG GIT_COMMIT
ARG NODE_MAJOR=18

LABEL org.opencontainers.image.description "sfpowerscripts is a build system for modular development in Salesforce."
LABEL org.opencontainers.image.licenses "MIT"
LABEL org.opencontainers.image.url "https://github.com/dxatscale/sfpowerscripts"
LABEL org.opencontainers.image.documentation "https://docs.dxatscale.io/sfpowerscripts/sfpowerscripts"
LABEL org.opencontainers.image.revision $GIT_COMMIT
LABEL org.opencontainers.image.vendor "DX@Scale"
LABEL org.opencontainers.image.source "https://github.com/dxatscale/sfpowerscripts"
LABEL org.opencontainers.image.title "DX@Scale sfp lite docker image - December 23"


ENV DEBIAN_FRONTEND=noninteractive


RUN ln -sf bash /bin/sh


RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get -y install --no-install-recommends \
git \
curl \
sudo \
jq \
zip \
unzip \
make \
g++ \
tzdata \
&& apt-get autoremove --assume-yes \
&& apt-get clean --assume-yes \
&& rm -rf /var/lib/apt/list/*

# Set timezone to UTC
ENV TZ=UTC
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

# install nodejs via nodesource
RUN mkdir -p /etc/apt/keyrings \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
&& apt-get update \
&& apt-get -y install --no-install-recommends nodejs \
&& apt-get autoremove --assume-yes \
&& apt-get clean --assume-yes \
&& rm -rf /var/lib/apt/list/*


# Install sfpowerscripts
RUN npm install --global --omit=dev \
@dxatscale/sfpowerscripts@${SFPOWERSCRIPTS_VERSION}

WORKDIR /root



# clear the entrypoint for azure
ENTRYPOINT []
CMD ["/bin/sh"]

0 comments on commit 0699e51

Please sign in to comment.