forked from rbauction/sfdclib
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
pipeline { | ||
agent any | ||
environment { | ||
ARTIFACTORY_CREDS = credentials('ARTIFACTORY_CREDS') | ||
ARTIFACTORY_USER = "${ARTIFACTORY_CREDS_USR}" | ||
ARTIFACTORY_PASSWORD = "${ARTIFACTORY_CREDS_PSW}" | ||
} | ||
stages { | ||
stage('Publish') { | ||
when { | ||
expression { env.BRANCH_NAME.endsWith('-acv') } | ||
} | ||
steps { | ||
sh 'make deploy' | ||
} | ||
} | ||
} | ||
post { | ||
always { | ||
sh 'make --ignore-errors stop-ci' | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
CONTAINER_NAME := acv-sfdc-ci | ||
VERSION := $(shell git fetch --tags && git describe --tags) | ||
|
||
.PHONY: clean | ||
clean: | ||
find . -type f -name '.DS_Store' -delete -o -type f -name '*.py[co]' -delete -o -type d -name __pycache__ -delete | ||
|
||
.PHONY: deps | ||
deps: | ||
pipenv install | ||
pipenv install --dev | ||
|
||
build: clean | ||
git submodule update --init --recursive | ||
@docker build \ | ||
--build-arg ARTIFACTORY_USER=${ARTIFACTORY_USER} \ | ||
--build-arg ARTIFACTORY_PASSWORD=${ARTIFACTORY_PASSWORD} \ | ||
--build-arg VERSION=${VERSION} \ | ||
--tag $(CONTAINER_NAME):$(VERSION) . | ||
|
||
.PHONY: deploy | ||
deploy: build | ||
docker run \ | ||
-e APP_MODE=deploy \ | ||
-e ARTIFACTORY_USER=${ARTIFACTORY_USER} \ | ||
-e ARTIFACTORY_PASSWORD=${ARTIFACTORY_PASSWORD} \ | ||
-v /var/run/docker.sock:/var/run/docker.sock \ | ||
$(CONTAINER_NAME):$(VERSION) | ||
|
||
.PHONY: stop-ci | ||
stop-ci: | ||
docker ps -a -q --filter ancestor=$(CONTAINER_NAME):$(VERSION) | xargs docker rm -f | ||
docker ps -a -q --filter ancestor=mysql:5.7git s | xargs docker rm -f |