Compare commits

...

19 Commits

2
Jenkinsfile vendored

@ -5,7 +5,7 @@ pipeline {
steps { steps {
sh '''echo " sh '''echo "
NEXTAUTH_URL=\'https://devops.dsp-archiwebo21-ad-ec-cb-mt.fr\' NEXTAUTH_URL=\'https://devops.dsp-archiwebo21-ad-ec-cb-mt.fr\'
DATABASE_URL="postgres://postgres:dandanalaa@212.227.206.140:5454/thetiptop" DATABASE_URL="postgres://postgres:dandanalaa@127.0.0.1:5454/thetiptop"
GITHUB_ID=YOUR_GITHUB_CLIENT_ID GITHUB_ID=YOUR_GITHUB_CLIENT_ID
GITHUB_SECRET=YOUR_GITHUB_CLIENT_SECRET GITHUB_SECRET=YOUR_GITHUB_CLIENT_SECRET

@ -0,0 +1,5 @@
/** @type {import('next-sitemap').IConfig} */
module.exports = {
siteUrl: process.env.NEXTAUTH_URL || 'https://dsp-archiwebo21-ad-ec-cb-mt.fr/',
generateRobotsTxt: true
}

58
package-lock.json generated

@ -22,6 +22,7 @@
"js-confetti": "^0.11.0", "js-confetti": "^0.11.0",
"next": "13.0.2", "next": "13.0.2",
"next-auth": "4.16.4", "next-auth": "4.16.4",
"next-sitemap": "^3.1.42",
"nodemailer": "^6.8.0", "nodemailer": "^6.8.0",
"react": "18.2.0", "react": "18.2.0",
"react-chartjs-2": "^5.0.1", "react-chartjs-2": "^5.0.1",
@ -667,6 +668,11 @@
"integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==",
"dev": true "dev": true
}, },
"node_modules/@corex/deepmerge": {
"version": "4.0.29",
"resolved": "https://registry.npmjs.org/@corex/deepmerge/-/deepmerge-4.0.29.tgz",
"integrity": "sha512-q/yVUnqckA8Do+EvAfpy7RLdumnBy9ZsducMUtZTvpdbJC7azEf1hGtnYYxm0QfphYxjwggv6XtH64prvS1W+A=="
},
"node_modules/@cspotcode/source-map-support": { "node_modules/@cspotcode/source-map-support": {
"version": "0.8.1", "version": "0.8.1",
"resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz",
@ -6424,6 +6430,14 @@
"node": "*" "node": "*"
} }
}, },
"node_modules/minimist": {
"version": "1.2.7",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz",
"integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==",
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/mkdirp": { "node_modules/mkdirp": {
"version": "1.0.4", "version": "1.0.4",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",
@ -6572,6 +6586,31 @@
"url": "https://github.com/sponsors/panva" "url": "https://github.com/sponsors/panva"
} }
}, },
"node_modules/next-sitemap": {
"version": "3.1.42",
"resolved": "https://registry.npmjs.org/next-sitemap/-/next-sitemap-3.1.42.tgz",
"integrity": "sha512-z/m440ZDCTxoE3FWbBWZLK66ZEh9e2R+j/Bm0d1Vo4PFkMi4yhWdIjWqhj//kyFyBvMYk3YWs8QQqVCCe15E6g==",
"funding": [
{
"url": "https://github.com/iamvishnusankar/next-sitemap.git"
}
],
"dependencies": {
"@corex/deepmerge": "^4.0.29",
"minimist": "^1.2.7"
},
"bin": {
"next-sitemap": "bin/next-sitemap.mjs",
"next-sitemap-cjs": "bin/next-sitemap.cjs"
},
"engines": {
"node": ">=14.18"
},
"peerDependencies": {
"@next/env": "*",
"next": "*"
}
},
"node_modules/nice-try": { "node_modules/nice-try": {
"version": "1.0.5", "version": "1.0.5",
"resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz",
@ -9389,6 +9428,11 @@
"integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==",
"dev": true "dev": true
}, },
"@corex/deepmerge": {
"version": "4.0.29",
"resolved": "https://registry.npmjs.org/@corex/deepmerge/-/deepmerge-4.0.29.tgz",
"integrity": "sha512-q/yVUnqckA8Do+EvAfpy7RLdumnBy9ZsducMUtZTvpdbJC7azEf1hGtnYYxm0QfphYxjwggv6XtH64prvS1W+A=="
},
"@cspotcode/source-map-support": { "@cspotcode/source-map-support": {
"version": "0.8.1", "version": "0.8.1",
"resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz",
@ -13585,6 +13629,11 @@
"brace-expansion": "^1.1.7" "brace-expansion": "^1.1.7"
} }
}, },
"minimist": {
"version": "1.2.7",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz",
"integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g=="
},
"mkdirp": { "mkdirp": {
"version": "1.0.4", "version": "1.0.4",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",
@ -13677,6 +13726,15 @@
} }
} }
}, },
"next-sitemap": {
"version": "3.1.42",
"resolved": "https://registry.npmjs.org/next-sitemap/-/next-sitemap-3.1.42.tgz",
"integrity": "sha512-z/m440ZDCTxoE3FWbBWZLK66ZEh9e2R+j/Bm0d1Vo4PFkMi4yhWdIjWqhj//kyFyBvMYk3YWs8QQqVCCe15E6g==",
"requires": {
"@corex/deepmerge": "^4.0.29",
"minimist": "^1.2.7"
}
},
"nice-try": { "nice-try": {
"version": "1.0.5", "version": "1.0.5",
"resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz",

@ -10,7 +10,8 @@
"build": "next build", "build": "next build",
"start": "next start", "start": "next start",
"db": "npx prisma migrate reset --force", "db": "npx prisma migrate reset --force",
"test": "playwright test" "test": "playwright test",
"postbuild": "next-sitemap"
}, },
"dependencies": { "dependencies": {
"@hookform/resolvers": "^2.9.10", "@hookform/resolvers": "^2.9.10",
@ -26,6 +27,7 @@
"js-confetti": "^0.11.0", "js-confetti": "^0.11.0",
"next": "13.0.2", "next": "13.0.2",
"next-auth": "4.16.4", "next-auth": "4.16.4",
"next-sitemap": "^3.1.42",
"nodemailer": "^6.8.0", "nodemailer": "^6.8.0",
"react": "18.2.0", "react": "18.2.0",
"react-chartjs-2": "^5.0.1", "react-chartjs-2": "^5.0.1",

@ -59,8 +59,7 @@ export async function getServerSideProps(context) {
const users = await prisma.user.findMany({ const users = await prisma.user.findMany({
include: { include: {
gains: true gains: true
}, }
take: 5
}); });
const user = await prisma.user.findUnique({ const user = await prisma.user.findUnique({
@ -71,7 +70,6 @@ export async function getServerSideProps(context) {
const ticketRestants = await prisma.gain.count({ const ticketRestants = await prisma.gain.count({
where: { where: {
codeActif: true,
dateAchat: { dateAchat: {
not: null, not: null,
} }
@ -90,8 +88,6 @@ export async function getServerSideProps(context) {
}, },
}) })
console.log("🚀 ~ file: admin.tsx:87 ~ getServerSideProps ~ gainsRetires", gainsRetires)
const produits = await prisma.produit.findMany({}) const produits = await prisma.produit.findMany({})
return { return {

@ -157,7 +157,7 @@ const Index = () => {
<div className={`${style['imageWrapper']}`}> <div className={`${style['imageWrapper']}`}>
<Image <Image
src={testerCodeCadeau} src={testerCodeCadeau}
alt="thetiptop navigation logo" alt="Tester le code cadeau"
layout="responsive" layout="responsive"
className={`${style['rotatingImage']}`} className={`${style['rotatingImage']}`}
/> />

@ -0,0 +1,11 @@
# *
User-agent: *
Allow: /*
Disallow: /admin
Disallow: /mon-compte
# Host
Host: https://dsp-archiwebo21-ad-ec-cb-mt.fr
# Sitemaps
Sitemap: https://dsp-archiwebo21-ad-ec-cb-mt.fr/sitemap.xml

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
<url><loc>https://dsp-archiwebo21-ad-ec-cb-mt.fr</loc><lastmod>2022-12-15T20:38:21.840Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://dsp-archiwebo21-ad-ec-cb-mt.fr/admin</loc><lastmod>2022-12-15T20:38:21.840Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://dsp-archiwebo21-ad-ec-cb-mt.fr/auth-error</loc><lastmod>2022-12-15T20:38:21.840Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://dsp-archiwebo21-ad-ec-cb-mt.fr/cgu</loc><lastmod>2022-12-15T20:38:21.840Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://dsp-archiwebo21-ad-ec-cb-mt.fr/connexion</loc><lastmod>2022-12-15T20:38:21.840Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://dsp-archiwebo21-ad-ec-cb-mt.fr/contact</loc><lastmod>2022-12-15T20:38:21.840Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://dsp-archiwebo21-ad-ec-cb-mt.fr/mentions-legales</loc><lastmod>2022-12-15T20:38:21.840Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://dsp-archiwebo21-ad-ec-cb-mt.fr/mon-compte</loc><lastmod>2022-12-15T20:38:21.840Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://dsp-archiwebo21-ad-ec-cb-mt.fr/tout-savoir</loc><lastmod>2022-12-15T20:38:21.840Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://dsp-archiwebo21-ad-ec-cb-mt.fr/verify-request</loc><lastmod>2022-12-15T20:38:21.840Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
</urlset>

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap><loc>https://dsp-archiwebo21-ad-ec-cb-mt.fr/sitemap-0.xml</loc></sitemap>
</sitemapindex>

@ -1,29 +1,18 @@
#!/usr/bin/env sh #!/usr/bin/env sh
echo 'The following "npm" command builds your Node.js/React application for'
echo 'production in the local "build" directory (i.e. within the'
echo '"/var/jenkins_home/workspace/simple-node-js-react-app" directory),'
echo 'correctly bundles React in production mode and optimizes the build for'
echo 'the best performance.'
set -x set -x
npm run build npm run build
set +x set +x
echo 'The following "npm" command runs your Node.js/React application in'
echo 'development mode and makes the application available for web browsing.'
echo 'The "npm start" command has a trailing ampersand so that the command runs'
echo 'as a background process (i.e. asynchronously). Otherwise, this command'
echo 'can pause running builds of CI/CD applications indefinitely. "npm start"'
echo 'is followed by another command that retrieves the process ID (PID) value'
echo 'of the previously run process (i.e. "npm start") and writes this value to'
echo 'the file ".pidfile".'
set -x set -x
npm start & npm start &
sleep 1 sleep 1
echo $! > .pidfile echo $! > .pidfile
set +x set +x
echo 'Now...' echo 'Maintenant...'
echo 'Visit http://localhost:3000 to see your Node.js/React application in action.' echo 'Visiter https://devops.dsp-archiwebo21-ad-ec-cb-mt.fr/ '
echo '(This is why you specified the "args ''-p 3000:3000''" parameter when you' echo 'L_application tourne sur le docker jenkins sur via le port 3000 voici un ip a'
echo 'created your initial Pipeline as a Jenkinsfile.)' ip a
echo 'Pour fermer l_application a appuyer sur le bouton proced'
Loading…
Cancel
Save